示例#1
0
    $options[$authinstance->id] = $authinstance->displayname . ': ' . $authinstance->instancename;
    if (!$default && $authinstance->name == 'mahara') {
        $default = $authinstance->id;
    }
}
// Suspend users
$suspendform = pieform(array('name' => 'suspend', 'class' => 'bulkactionform', 'renderer' => 'oneline', 'elements' => array('users' => $userelement, 'reason' => array('type' => 'text', 'title' => get_string('suspendedreason', 'admin') . ': '), 'suspend' => array('type' => 'submit', 'value' => get_string('Suspend', 'admin')))));
// Change authentication method
$changeauthform = null;
if (count($options) > 1) {
    $changeauthform = pieform(array('name' => 'changeauth', 'class' => 'bulkactionform', 'renderer' => 'oneline', 'dieaftersubmit' => false, 'elements' => array('users' => $userelement, 'title' => array('type' => 'html', 'class' => 'bulkaction-title', 'value' => get_string('changeauthmethod', 'admin') . ': '), 'authinstance' => array('type' => 'select', 'options' => $options, 'defaultvalue' => $default), 'changeauth' => array('type' => 'submit', 'value' => get_string('submit')))));
}
// Set probation points
$probationform = null;
if (is_using_probation()) {
    $probationform = pieform(array('name' => 'probation', 'class' => 'bulkactionform', 'renderer' => 'oneline', 'elements' => array('users' => $userelement, 'probationpoints' => array('type' => 'select', 'title' => get_string('probationbulksetspamprobation', 'admin') . ': ', 'options' => probation_form_options(), 'defaultvalue' => '0'), 'setprobation' => array('type' => 'submit', 'confirm' => get_string('probationbulkconfirm', 'admin'), 'value' => get_string('probationbulkset', 'admin')))));
}
// Delete users
$deleteform = pieform(array('name' => 'delete', 'class' => 'bulkactionform delete', 'renderer' => 'oneline', 'elements' => array('users' => $userelement, 'title' => array('type' => 'html', 'class' => 'bulkaction-title', 'value' => get_string('deleteusers', 'admin') . ': '), 'delete' => array('type' => 'submit', 'confirm' => get_string('confirmdeleteusers', 'admin'), 'value' => get_string('delete')))));
$smarty = smarty();
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('users', $users);
$smarty->assign('changeauthform', $changeauthform);
$smarty->assign('suspendform', $suspendform);
$smarty->assign('deleteform', $deleteform);
$smarty->assign('probationform', $probationform);
$smarty->display('admin/users/bulk.tpl');
function changeauth_validate(Pieform $form, $values)
{
    global $userids, $SESSION;
    // Make sure all users are members of the institution that
示例#2
0
}
if ($USER->get('admin')) {
    $elements['staff'] = array('type' => 'checkbox', 'title' => get_string('sitestaff', 'admin'), 'defaultvalue' => $user->staff, 'help' => true);
    $elements['admin'] = array('type' => 'checkbox', 'title' => get_string('siteadmin', 'admin'), 'defaultvalue' => $user->admin, 'help' => true);
}
$elements['maildisabled'] = array('type' => 'checkbox', 'defaultvalue' => get_account_preference($user->id, 'maildisabled'), 'title' => get_string('disableemail', 'admin'), 'help' => true);
$elements['expiry'] = array('type' => 'date', 'title' => get_string('accountexpiry', 'admin'), 'description' => get_string('accountexpirydescription', 'admin'), 'minyear' => $currentdate['year'] - 2, 'maxyear' => $currentdate['year'] + 20, 'defaultvalue' => $user->expiry);
$quotaused = get_string('quotaused', 'admin') . ': ' . display_size($user->quotaused);
if ($USER->get('admin') || get_config_plugin('artefact', 'file', 'institutionaloverride')) {
    $elements['quota'] = array('type' => 'bytes', 'title' => get_string('filequota1', 'admin'), 'description' => get_string('filequotadescription', 'admin') . '<br>' . $quotaused, 'rules' => array('integer' => true), 'defaultvalue' => $user->quota);
} else {
    $elements['quota'] = array('type' => 'text', 'disabled' => true, 'title' => get_string('filequota1', 'admin'), 'description' => get_string('filequotadescription', 'admin') . '<br>' . $quotaused, 'value' => display_size($user->quota));
}
// Probation points
if (is_using_probation($user->id)) {
    $elements['probationpoints'] = array('type' => 'select', 'title' => get_string('probationtitle', 'admin'), 'help' => true, 'options' => probation_form_options(), 'defaultvalue' => ensure_valid_probation_points($user->probation));
}
$authinstances = auth_get_auth_instances();
if (count($authinstances) > 1) {
    $options = array();
    // NOTE: This is a little broken at the moment. The "username in the remote
    // system" setting is only actively used by the XMLRPC authentication
    // plugin, and thus only makes sense when the user is authenticating in
    // this manner.
    //
    // We hope to one day make it possible for users to get into accounts via
    // multiple methods, at which time we can tie the username-in-remote-system
    // setting to the XMLRPC plugin only, making the UI a bit more consistent
    $external = false;
    $externalauthjs = array();
    // OVERWRITE 2: replace