'edit', 'userid' => $userid)); exit; } } function build_priv_list() { global $spriv_list, $a_user; $list = array(); foreach ($spriv_list as $pname => $pdata) { if (in_array($pname, $a_user['priv'])) { continue; } $list[$pname] = $pdata['name']; } return($list); } function get_root_priv_item_text() { global $priv_list; $priv_text = ""; foreach ($priv_list as $pname => $pdata) { if (isset($pdata['warn']) && ($pdata['warn'] == 'standard-warning-root')) { $priv_text .= '
' . $pdata['name']; } } return($priv_text); } include("head.inc"); if ($input_errors) { print_input_errors($input_errors); } $tab_array = array(); $tab_array[] = array(gettext("Users"), true, "system_usermanager.php"); $tab_array[] = array(gettext("Groups"), false, "system_groupmanager.php"); $tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php"); $tab_array[] = array(gettext("Authentication Servers"), false, "system_authservers.php"); display_top_tabs($tab_array); $form = new Form(); $section = new Form_Section('User Privileges'); $section->addInput(new Form_Select( 'sysprivs', '*Assigned privileges', null, build_priv_list(), true ))->addClass('multiselect') ->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.'); $section->addInput(new Form_Select( 'shadow', 'Shadow', null, build_priv_list(), true ))->addClass('shadowselect') ->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.'); $section->addInput(new Form_Input( 'filtertxt', 'Filter', 'text', null ))->setHelp('Show only the choices containing this term'); $section->addInput(new Form_StaticText( gettext('Privilege information'), ''. gettext('The following privileges effectively give the user administrator-level access ' . ' because the user gains access to execute general commands, edit system files, ' . ' modify users, change passwords or similar:') . '
' . get_root_priv_item_text() . '

' . gettext('Please take care when granting these privileges.') . '
' )); $btnfilter = new Form_Button( 'btnfilter', 'Filter', null, 'fa-filter' ); $btnfilter->setAttribute('type','button')->addClass('btn btn-info'); $form->addGlobal($btnfilter); $btnclear = new Form_Button( 'btnclear', 'Clear', null, 'fa-times' ); $btnclear->setAttribute('type','button')->addClass('btn btn-warning'); $form->addGlobal($btnclear); if (isset($userid)) { $section->addInput(new Form_Input( 'userid', null, 'hidden', $userid )); } $form->add($section); print($form); ?>