Changeset 6768
- Timestamp:
- 09/17/08 23:08:54 (5 years ago)
- Files:
-
- modules/branches/2.5/core/functions.inc.php (modified) (4 diffs)
- modules/branches/2.5/core/page.ampusers.php (modified) (1 diff)
- modules/branches/2.5/core/page.devices.php (modified) (1 diff)
- modules/branches/2.5/core/page.extensions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5/core/functions.inc.php
r6730 r6768 4595 4595 } elseif ( $extdisplay == '' && $tech_hardware == '' ) { // Adding 4596 4596 4597 if ( $display != 'extensions') { 4598 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add Device")), 0); 4597 if ($_SESSION["AMP_user"]->checkSection('999')) { 4598 if ( $display != 'extensions') { 4599 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add Device")), 0); 4600 } else { 4601 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add an Extension")), 0); 4602 } 4603 $currentcomponent->addguielem('_top', new gui_label('instructions', _("Please select your Device below then click Submit"))); 4604 $currentcomponent->addguielem('Device', new gui_selectbox('tech_hardware', $currentcomponent->getoptlist('devicelist'), '', _("Device"), '', false)); 4599 4605 } else { 4600 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add an Extension")), 0); 4601 } 4602 $currentcomponent->addguielem('_top', new gui_label('instructions', _("Please select your Device below then click Submit"))); 4603 $currentcomponent->addguielem('Device', new gui_selectbox('tech_hardware', $currentcomponent->getoptlist('devicelist'), '', _("Device"), '', false)); 4606 if ( $display != 'extensions') { 4607 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Edit existing Device")), 0); 4608 } else { 4609 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Edit existing Extension")), 0); 4610 } 4611 } 4604 4612 4605 4613 } else { … … 4637 4645 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add").' '.strtoupper($deviceInfo['tech']).' '._("Extension")), 0); 4638 4646 } 4639 4640 4647 } 4641 4648 … … 4728 4735 case "add": 4729 4736 // really bad hack - but if core_users_add fails, want to stop core_devices_add 4730 if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 4737 4738 if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true || !$_SESSION["AMP_user"]->checkSection('999')) { 4731 4739 if (core_devices_add($deviceid,$tech,$devinfo_dial,$devicetype,$deviceuser,$description,$emergency_cid)) { 4732 4740 needreload(); … … 4735 4743 } 4736 4744 } 4737 } 4745 } else { 4746 // This is a bit messy, because by this time, other modules may have added the device but this tries to block 4747 // the user who does not have add permission from adding a new extension. 4748 // 4749 $GLOBALS['abort'] = true; 4750 } 4738 4751 break; 4739 4752 case "del": modules/branches/2.5/core/page.ampusers.php
r5953 r6768 229 229 echo ">"._("Apply Changes Bar")."</option>\n"; 230 230 231 // Apply Changes Bar 232 echo "<option value=\"999\""; 233 if (in_array("999", $sections)) echo " SELECTED"; 234 echo ">".(($amp_conf['AMPEXTENSIONS'] == 'deviceanduser')?_("Add Device"):_("Add Extension"))."</option>\n"; 235 231 236 // All Sections 232 237 echo "<option value=\"*\""; modules/branches/2.5/core/page.devices.php
r2617 r6768 16 16 <?php 17 17 $devices = core_devices_list(); 18 drawListMenu($devices, $skip, $type, $display, $extdisplay, _("Device")); 18 $description = $_SESSION["AMP_user"]->checkSection('999') ? _("Device") : false; 19 drawListMenu($devices, $skip, $type, $display, $extdisplay, $description); 19 20 ?> 20 21 </div> modules/branches/2.5/core/page.extensions.php
r2842 r6768 16 16 <?php 17 17 $extens = core_users_list(); 18 drawListMenu($extens, $skip, $type, $display, $extdisplay, _("Extension")); 18 $description = $_SESSION["AMP_user"]->checkSection('999') ? _("Extension") : false; 19 drawListMenu($devices, $skip, $type, $display, $extdisplay, $description); 19 20 ?> 20 21 <br />
