. // // Copyright (C) 2004 Greg MacLellan (greg@mtechsolutions.ca) // Copyright (C) 2004 Coalescent Systems Inc. (info@coalescentsystems.ca) // $userdisplay = isset($_REQUEST['userdisplay'])?$_REQUEST['userdisplay']:''; $action = isset($_REQUEST['action'])?$_REQUEST['action']:''; $tech = isset($_REQUEST['tech'])?$_REQUEST['tech']:''; $tabindex = 0; // populate some global variables from the request string $set_globals = array("username","password","extension_high","extension_low","deptname"); foreach ($set_globals as $var) { if (isset($_REQUEST[$var])) { $$var = stripslashes( $_REQUEST[$var] ); } } $form_password_sha1 = stripslashes(isset($_REQUEST['password_sha1'])?$_REQUEST['password_sha1']:''); //Search ALL active modules while generating admin access list $active_modules = module_getinfo(false, MODULE_STATUS_ENABLED); if(is_array($active_modules)){ foreach($active_modules as $key => $module) { //create an array of module sections to display if (isset($module['items']) && is_array($module['items'])) { foreach($module['items'] as $itemKey => $item) { $listKey = (!empty($item['display']) ? $item['display'] : $itemKey); $item['rawname'] = $module['rawname']; $module_list[ $listKey ] = $item; } } } } // extensions vs device/users ... module_list setting if (isset($amp_conf["AMPEXTENSIONS"]) && ($amp_conf["AMPEXTENSIONS"] == "deviceanduser")) { unset($module_list["extensions"]); } else { unset($module_list["devices"]); unset($module_list["users"]); } // no more adding the APPLY Changes bar to module list because array_multisort messes up integer array keys // $module_list['99'] = array('category' => NULL, 'name' => _("Apply Changes Bar")); // changed from $module_name to $admin_module_name because the former is used by framework foreach ($module_list as $key => $row) { $module_category[$key] = $row['category']; $admin_module_name[$key] = $row['name']; } array_multisort($module_category, SORT_ASC, $admin_module_name, SORT_ASC, $module_list); $sections = array(); if (isset($_REQUEST["sections"])) { if (is_array($_REQUEST["sections"])) { $sections = $_REQUEST["sections"]; } else { //TODO do we even need this?? $sections = explode(";",$_REQUEST["sections"]); } } //if submitting form, update database switch ($action) { case "addampuser": core_ampusers_add($username, $password, $extension_low, $extension_high, $deptname, $sections); //indicate 'need reload' link in footer.php needreload(); redirect_standard(); break; case "editampuser": // Check to make sure the hidden var is sane, and that they haven't changed the password field if (strlen($form_password_sha1)==40 && $password == "******") { // Password unchanged core_ampusers_del($userdisplay); core_ampusers_add($username, $form_password_sha1, $extension_low, $extension_high, $deptname, $sections); } elseif ($password != "******") { // Password has been changed core_ampusers_del($userdisplay); core_ampusers_add($username, $password, $extension_low, $extension_high, $deptname, $sections); } //indicate 'need reload' link in footer.php needreload(); redirect_standard('userdisplay'); break; case "delampuser": core_ampusers_del($userdisplay); //indicate 'need reload' link in footer.php needreload(); $userdisplay = ""; // go "add" screen redirect_standard(); break; } ?>
"._("Edit Administrator").""; $user = getAmpUser($userdisplay); $username = $user["username"]; $password = "******"; $password_sha1 = $user["password_sha1"]; $extension_high = $user["extension_high"]; $extension_low = $user["extension_low"]; $deptname = $user["deptname"]; $sections = $user["sections"]; $tlabel = sprintf(_("Delete User: %s"),$userdisplay); $label = ' '.$tlabel.''; ?>

"._("Add Administrator").""; } ?>

'._("NOTE:").''._("AUTHTYPE is not set to 'database' in /etc/amportal.conf - note that this module is not currently providing access control, and changing passwords here or adding users will have no effect unless AUTHTYPE is set to 'database'.") ?>

Create a unique username for this new user")?>:
Create a password for this new user")?>:

Restrict this user's view of Digital Receptionist menus and System Recordings to only those for this department.")?>:
Restrict this user's view to only Extensions, Ring Groups, and Queues within this range.")?>:  to
Select the Admin Sections this user should have access to.")?>:
" onclick="checkAmpUser(ampuserEdit, '')" tabindex="">