2009-11-01 10:55:31 +00:00
|
|
|
<?php
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2006-08-18 07:52:56 +00:00
|
|
|
require_once('../config.php');
|
2006-09-24 11:55:11 +00:00
|
|
|
require_once($CFG->libdir.'/adminlib.php');
|
2007-11-13 08:43:20 +00:00
|
|
|
require_once($CFG->dirroot.'/user/filters/lib.php');
|
2006-03-07 16:42:30 +00:00
|
|
|
|
|
|
|
$delete = optional_param('delete', 0, PARAM_INT);
|
|
|
|
$confirm = optional_param('confirm', '', PARAM_ALPHANUM); //md5 confirmation hash
|
|
|
|
$confirmuser = optional_param('confirmuser', 0, PARAM_INT);
|
|
|
|
$sort = optional_param('sort', 'name', PARAM_ALPHA);
|
|
|
|
$dir = optional_param('dir', 'ASC', PARAM_ALPHA);
|
|
|
|
$page = optional_param('page', 0, PARAM_INT);
|
|
|
|
$perpage = optional_param('perpage', 30, PARAM_INT); // how many per page
|
2007-01-04 03:19:49 +00:00
|
|
|
$ru = optional_param('ru', '2', PARAM_INT); // show remote users
|
|
|
|
$lu = optional_param('lu', '2', PARAM_INT); // show local users
|
|
|
|
$acl = optional_param('acl', '0', PARAM_INT); // id of user to tweak mnet ACL (requires $access)
|
|
|
|
|
2007-04-30 17:08:34 +00:00
|
|
|
|
|
|
|
admin_externalpage_setup('editusers');
|
2007-01-25 00:04:02 +00:00
|
|
|
|
2007-11-13 08:43:20 +00:00
|
|
|
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
2007-01-25 00:04:02 +00:00
|
|
|
$site = get_site();
|
|
|
|
|
|
|
|
if (!has_capability('moodle/user:update', $sitecontext) and !has_capability('moodle/user:delete', $sitecontext)) {
|
2008-04-10 03:44:09 +00:00
|
|
|
print_error('nopermissions', 'error', '', 'edit/delete users');
|
2006-09-03 14:45:57 +00:00
|
|
|
}
|
2006-08-11 02:44:42 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
$stredit = get_string('edit');
|
|
|
|
$strdelete = get_string('delete');
|
|
|
|
$strdeletecheck = get_string('deletecheck');
|
|
|
|
$strshowallusers = get_string('showallusers');
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2007-04-06 07:51:18 +00:00
|
|
|
if (empty($CFG->loginhttps)) {
|
|
|
|
$securewwwroot = $CFG->wwwroot;
|
|
|
|
} else {
|
|
|
|
$securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
|
|
|
|
}
|
|
|
|
|
2009-06-21 18:45:07 +00:00
|
|
|
$returnurl = "$CFG->wwwroot/$CFG->admin/user.php";
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
if ($confirmuser and confirm_sesskey()) {
|
2008-05-31 10:43:51 +00:00
|
|
|
if (!$user = $DB->get_record('user', array('id'=>$confirmuser))) {
|
2008-04-10 03:44:09 +00:00
|
|
|
print_error('nousers');
|
2006-08-11 03:58:52 +00:00
|
|
|
}
|
2006-08-11 02:44:42 +00:00
|
|
|
|
2007-04-17 21:30:02 +00:00
|
|
|
$auth = get_auth_plugin($user->auth);
|
2006-08-11 02:44:42 +00:00
|
|
|
|
2008-05-31 10:43:51 +00:00
|
|
|
$result = $auth->user_confirm($user->username, $user->secret);
|
2007-04-17 21:30:02 +00:00
|
|
|
|
|
|
|
if ($result == AUTH_CONFIRM_OK or $result == AUTH_CONFIRM_ALREADY) {
|
2009-06-21 18:45:07 +00:00
|
|
|
redirect($returnurl);
|
2007-01-25 00:04:02 +00:00
|
|
|
} else {
|
2010-03-31 08:05:53 +00:00
|
|
|
echo $OUTPUT->header();
|
2009-06-21 18:45:07 +00:00
|
|
|
redirect($returnurl, get_string('usernotconfirmed', '', fullname($user, true)));
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
2006-09-24 11:55:11 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
} else if ($delete and confirm_sesskey()) { // Delete a selected user, after confirmation
|
2006-08-11 02:44:42 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
if (!has_capability('moodle/user:delete', $sitecontext)) {
|
2008-04-10 03:44:09 +00:00
|
|
|
print_error('nopermissions', 'error', '', 'delete a user');
|
2002-08-08 14:17:55 +00:00
|
|
|
}
|
2006-09-24 11:55:11 +00:00
|
|
|
|
2008-05-31 10:43:51 +00:00
|
|
|
if (!$user = $DB->get_record('user', array('id'=>$delete))) {
|
2008-04-10 03:44:09 +00:00
|
|
|
print_error('nousers', 'error');
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
2006-09-24 11:55:11 +00:00
|
|
|
|
2010-08-12 08:22:26 +00:00
|
|
|
if (is_siteadmin($user->id)) {
|
|
|
|
print_error('nopermissions', 'error', '', 'delete the admin users');
|
2006-08-11 02:44:42 +00:00
|
|
|
}
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
if ($confirm != md5($delete)) {
|
2010-03-31 08:05:53 +00:00
|
|
|
echo $OUTPUT->header();
|
2007-01-25 00:04:02 +00:00
|
|
|
$fullname = fullname($user, true);
|
2009-08-06 08:17:12 +00:00
|
|
|
echo $OUTPUT->heading(get_string('deleteuser', 'admin'));
|
2007-01-25 00:04:02 +00:00
|
|
|
$optionsyes = array('delete'=>$delete, 'confirm'=>md5($delete), 'sesskey'=>sesskey());
|
2009-08-20 08:39:07 +00:00
|
|
|
echo $OUTPUT->confirm(get_string('deletecheckfull', '', "'$fullname'"), new moodle_url('user.php', $optionsyes), 'user.php');
|
2009-08-06 14:12:46 +00:00
|
|
|
echo $OUTPUT->footer();
|
2007-01-25 00:04:02 +00:00
|
|
|
die;
|
|
|
|
} else if (data_submitted() and !$user->deleted) {
|
2007-08-21 20:52:36 +00:00
|
|
|
if (delete_user($user)) {
|
2009-06-21 18:45:07 +00:00
|
|
|
session_gc(); // remove stale sessions
|
|
|
|
redirect($returnurl);
|
2007-01-25 00:04:02 +00:00
|
|
|
} else {
|
2009-06-21 18:45:07 +00:00
|
|
|
session_gc(); // remove stale sessions
|
2010-03-31 08:05:53 +00:00
|
|
|
echo $OUTPUT->header();
|
2009-08-18 04:28:40 +00:00
|
|
|
echo $OUTPUT->notification($returnurl, get_string('deletednot', '', fullname($user, true)));
|
2002-08-08 15:51:23 +00:00
|
|
|
}
|
2002-08-08 14:17:55 +00:00
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
} else if ($acl and confirm_sesskey()) {
|
|
|
|
if (!has_capability('moodle/user:delete', $sitecontext)) {
|
|
|
|
// TODO: this should be under a separate capability
|
2008-04-10 03:44:09 +00:00
|
|
|
print_error('nopermissions', 'error', '', 'modify the NMET access control list');
|
2006-08-18 07:52:56 +00:00
|
|
|
}
|
2008-05-31 10:43:51 +00:00
|
|
|
if (!$user = $DB->get_record('user', array('id'=>$acl))) {
|
2008-04-10 03:44:09 +00:00
|
|
|
print_error('nousers', 'error');
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
|
|
|
if (!is_mnet_remote_user($user)) {
|
2008-04-10 03:44:09 +00:00
|
|
|
print_error('usermustbemnet', 'error');
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
|
|
|
$accessctrl = strtolower(required_param('accessctrl', PARAM_ALPHA));
|
|
|
|
if ($accessctrl != 'allow' and $accessctrl != 'deny') {
|
2008-04-10 03:44:09 +00:00
|
|
|
print_error('invalidaccessparameter', 'error');
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
2008-05-31 10:43:51 +00:00
|
|
|
$aclrecord = $DB->get_record('mnet_sso_access_control', array('username'=>$user->username, 'mnet_host_id'=>$user->mnethostid));
|
2007-01-25 00:04:02 +00:00
|
|
|
if (empty($aclrecord)) {
|
|
|
|
$aclrecord = new object();
|
|
|
|
$aclrecord->mnet_host_id = $user->mnethostid;
|
|
|
|
$aclrecord->username = $user->username;
|
|
|
|
$aclrecord->accessctrl = $accessctrl;
|
2009-01-31 20:07:32 +00:00
|
|
|
$DB->insert_record('mnet_sso_access_control', $aclrecord);
|
2007-01-25 00:04:02 +00:00
|
|
|
} else {
|
|
|
|
$aclrecord->accessctrl = $accessctrl;
|
2009-01-31 20:07:32 +00:00
|
|
|
$DB->update_record('mnet_sso_access_control', $aclrecord);
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
2008-05-31 10:43:51 +00:00
|
|
|
$mnethosts = $DB->get_records('mnet_host', null, 'id', 'id,wwwroot,name');
|
2009-06-21 18:45:07 +00:00
|
|
|
redirect($returnurl);
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
2006-09-24 11:55:11 +00:00
|
|
|
|
2007-11-13 08:43:20 +00:00
|
|
|
// create the user filter form
|
|
|
|
$ufiltering = new user_filtering();
|
2010-03-31 08:05:53 +00:00
|
|
|
echo $OUTPUT->header();
|
2009-11-01 10:57:00 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
// Carry on with the user listing
|
2003-06-21 04:09:20 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
$columns = array("firstname", "lastname", "email", "city", "country", "lastaccess");
|
2003-06-21 04:09:20 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
foreach ($columns as $column) {
|
|
|
|
$string[$column] = get_string("$column");
|
|
|
|
if ($sort != $column) {
|
|
|
|
$columnicon = "";
|
|
|
|
if ($column == "lastaccess") {
|
|
|
|
$columndir = "DESC";
|
|
|
|
} else {
|
|
|
|
$columndir = "ASC";
|
2007-01-04 03:19:49 +00:00
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
} else {
|
|
|
|
$columndir = $dir == "ASC" ? "DESC":"ASC";
|
|
|
|
if ($column == "lastaccess") {
|
|
|
|
$columnicon = $dir == "ASC" ? "up":"down";
|
2007-01-04 03:19:49 +00:00
|
|
|
} else {
|
2007-01-25 00:04:02 +00:00
|
|
|
$columnicon = $dir == "ASC" ? "down":"up";
|
2007-01-04 03:19:49 +00:00
|
|
|
}
|
2009-12-16 21:50:45 +00:00
|
|
|
$columnicon = " <img src=\"" . $OUTPUT->pix_url('t/' . $columnicon) . "\" alt=\"\" />";
|
2007-01-25 00:04:02 +00:00
|
|
|
|
2002-09-22 03:01:17 +00:00
|
|
|
}
|
2007-11-13 08:43:20 +00:00
|
|
|
$$column = "<a href=\"user.php?sort=$column&dir=$columndir\">".$string[$column]."</a>$columnicon";
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
2002-08-08 14:17:55 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
if ($sort == "name") {
|
|
|
|
$sort = "firstname";
|
|
|
|
}
|
2007-11-13 08:43:20 +00:00
|
|
|
|
2008-05-25 09:39:02 +00:00
|
|
|
list($extrasql, $params) = $ufiltering->get_sql_filter();
|
|
|
|
$users = get_users_listing($sort, $dir, $page*$perpage, $perpage, '', '', '', $extrasql, $params);
|
2007-01-25 00:04:02 +00:00
|
|
|
$usercount = get_users(false);
|
2008-05-25 09:39:02 +00:00
|
|
|
$usersearchcount = get_users(false, '', true, null, "", '', '', '', '', '*', $extrasql, $params);
|
2002-09-22 14:06:38 +00:00
|
|
|
|
2007-11-13 08:43:20 +00:00
|
|
|
if ($extrasql !== '') {
|
2009-08-06 08:17:12 +00:00
|
|
|
echo $OUTPUT->heading("$usersearchcount / $usercount ".get_string('users'));
|
2007-01-25 00:04:02 +00:00
|
|
|
$usercount = $usersearchcount;
|
|
|
|
} else {
|
2009-08-06 08:17:12 +00:00
|
|
|
echo $OUTPUT->heading("$usercount ".get_string('users'));
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
2002-09-22 14:06:38 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
$strall = get_string('all');
|
2009-11-01 10:57:00 +00:00
|
|
|
|
2009-08-07 00:29:59 +00:00
|
|
|
$baseurl = new moodle_url('user.php', array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage));
|
2010-02-17 16:59:41 +00:00
|
|
|
echo $OUTPUT->paging_bar($usercount, $page, $perpage, $baseurl);
|
2004-03-19 04:29:00 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
flush();
|
2004-03-19 04:29:00 +00:00
|
|
|
|
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
if (!$users) {
|
|
|
|
$match = array();
|
2009-08-06 08:17:12 +00:00
|
|
|
echo $OUTPUT->heading(get_string('nousersfound'));
|
2004-03-20 06:58:52 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
$table = NULL;
|
2002-08-08 14:17:55 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
} else {
|
2002-11-11 07:58:11 +00:00
|
|
|
|
2010-04-14 14:27:10 +00:00
|
|
|
$countries = get_string_manager()->get_list_of_countries(false);
|
2007-01-25 00:04:02 +00:00
|
|
|
if (empty($mnethosts)) {
|
2008-05-31 10:43:51 +00:00
|
|
|
$mnethosts = $DB->get_records('mnet_host', null, 'id', 'id,wwwroot,name');
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
2003-09-26 08:04:48 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
foreach ($users as $key => $user) {
|
|
|
|
if (!empty($user->country)) {
|
|
|
|
$users[$key]->country = $countries[$user->country];
|
2003-05-29 03:06:10 +00:00
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
|
|
|
if ($sort == "country") { // Need to resort by full country name, not code
|
|
|
|
foreach ($users as $user) {
|
|
|
|
$susers[$user->id] = $user->country;
|
2002-11-11 07:58:11 +00:00
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
asort($susers);
|
|
|
|
foreach ($susers as $key => $value) {
|
|
|
|
$nusers[] = $users[$key];
|
2002-11-11 07:58:11 +00:00
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
$users = $nusers;
|
|
|
|
}
|
2004-03-20 06:58:52 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
$mainadmin = get_admin();
|
2007-01-26 21:45:50 +00:00
|
|
|
|
2008-07-10 08:36:44 +00:00
|
|
|
$override = new object();
|
2008-07-10 03:37:04 +00:00
|
|
|
$override->firstname = 'firstname';
|
|
|
|
$override->lastname = 'lastname';
|
|
|
|
$fullnamelanguage = get_string('fullnamedisplay', '', $override);
|
|
|
|
if (($CFG->fullnamedisplay == 'firstname lastname') or
|
|
|
|
($CFG->fullnamedisplay == 'firstname') or
|
|
|
|
($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'firstname lastname' )) {
|
|
|
|
$fullnamedisplay = "$firstname / $lastname";
|
2009-11-01 10:57:00 +00:00
|
|
|
} else { // ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'lastname firstname')
|
2008-07-10 03:37:04 +00:00
|
|
|
$fullnamedisplay = "$lastname / $firstname";
|
|
|
|
}
|
2009-08-20 08:39:07 +00:00
|
|
|
|
|
|
|
$table = new html_table();
|
2008-07-10 03:37:04 +00:00
|
|
|
$table->head = array ($fullnamedisplay, $email, $city, $country, $lastaccess, "", "", "");
|
2007-01-25 00:04:02 +00:00
|
|
|
$table->align = array ("left", "left", "left", "left", "left", "center", "center", "center");
|
|
|
|
$table->width = "95%";
|
|
|
|
foreach ($users as $user) {
|
2007-01-25 11:03:33 +00:00
|
|
|
if ($user->username == 'guest') {
|
2007-01-25 00:04:02 +00:00
|
|
|
continue; // do not dispaly dummy new user and guest here
|
2007-01-04 03:19:49 +00:00
|
|
|
}
|
2004-03-20 06:58:52 +00:00
|
|
|
|
2010-08-12 08:22:26 +00:00
|
|
|
if ($user->id == $USER->id or is_siteadmin($user)) {
|
2007-01-25 00:04:02 +00:00
|
|
|
$deletebutton = "";
|
|
|
|
} else {
|
|
|
|
if (has_capability('moodle/user:delete', $sitecontext)) {
|
2009-01-02 10:51:26 +00:00
|
|
|
$deletebutton = "<a href=\"user.php?delete=$user->id&sesskey=".sesskey()."\">$strdelete</a>";
|
2007-01-25 00:04:02 +00:00
|
|
|
} else {
|
|
|
|
$deletebutton ="";
|
2004-03-20 06:58:52 +00:00
|
|
|
}
|
2003-03-21 09:42:42 +00:00
|
|
|
}
|
2004-03-20 06:58:52 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
if (has_capability('moodle/user:update', $sitecontext) and ($user->id==$USER->id or $user->id != $mainadmin->id) and !is_mnet_remote_user($user)) {
|
2007-01-26 21:45:50 +00:00
|
|
|
$editbutton = "<a href=\"$securewwwroot/user/editadvanced.php?id=$user->id&course=$site->id\">$stredit</a>";
|
2007-01-25 00:04:02 +00:00
|
|
|
if ($user->confirmed == 0) {
|
2009-01-02 10:51:26 +00:00
|
|
|
$confirmbutton = "<a href=\"user.php?confirmuser=$user->id&sesskey=".sesskey()."\">" . get_string('confirm') . "</a>";
|
2004-03-20 06:58:52 +00:00
|
|
|
} else {
|
2007-01-25 00:04:02 +00:00
|
|
|
$confirmbutton = "";
|
2004-03-20 06:58:52 +00:00
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
} else {
|
|
|
|
$editbutton ="";
|
|
|
|
if ($user->confirmed == 0) {
|
|
|
|
$confirmbutton = "<span class=\"dimmed_text\">".get_string('confirm')."</span>";
|
2004-03-20 06:58:52 +00:00
|
|
|
} else {
|
2007-01-04 03:19:49 +00:00
|
|
|
$confirmbutton = "";
|
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
2007-01-04 03:19:49 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
// for remote users, shuffle columns around and display MNET stuff
|
|
|
|
if (is_mnet_remote_user($user)) {
|
|
|
|
$accessctrl = 'allow';
|
2009-07-22 01:09:55 +00:00
|
|
|
if ($acl = $DB->get_record('mnet_sso_access_control', array('username'=>$user->username, 'mnet_host_id'=>$user->mnethostid))) {
|
2007-01-25 00:04:02 +00:00
|
|
|
$accessctrl = $acl->accessctrl;
|
2004-03-20 06:58:52 +00:00
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
$changeaccessto = ($accessctrl == 'deny' ? 'allow' : 'deny');
|
|
|
|
// delete button in confirm column - remote users should already be confirmed
|
|
|
|
// TODO: no delete for remote users, for now. new userid, delete flag, unique on username/host...
|
|
|
|
$confirmbutton = "";
|
|
|
|
// ACL in delete column
|
|
|
|
$deletebutton = get_string($accessctrl, 'mnet');
|
|
|
|
if (has_capability('moodle/user:delete', $sitecontext)) {
|
|
|
|
// TODO: this should be under a separate capability
|
2009-01-02 10:43:12 +00:00
|
|
|
$deletebutton .= " (<a href=\"?acl={$user->id}&accessctrl=$changeaccessto&sesskey=".sesskey()."\">"
|
2007-01-25 00:04:02 +00:00
|
|
|
. get_string($changeaccessto, 'mnet') . " access</a>)";
|
|
|
|
}
|
|
|
|
// mnet info in edit column
|
2007-03-01 12:08:38 +00:00
|
|
|
if (isset($mnethosts[$user->mnethostid])) {
|
|
|
|
$editbutton = $mnethosts[$user->mnethostid]->name;
|
|
|
|
}
|
2004-03-09 21:43:09 +00:00
|
|
|
}
|
2002-08-09 09:09:36 +00:00
|
|
|
|
2007-01-25 00:04:02 +00:00
|
|
|
if ($user->lastaccess) {
|
|
|
|
$strlastaccess = format_time(time() - $user->lastaccess);
|
2007-01-12 01:10:36 +00:00
|
|
|
} else {
|
2007-01-25 00:04:02 +00:00
|
|
|
$strlastaccess = get_string('never');
|
2007-01-12 01:10:36 +00:00
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
$fullname = fullname($user, true);
|
|
|
|
|
|
|
|
$table->data[] = array ("<a href=\"../user/view.php?id=$user->id&course=$site->id\">$fullname</a>",
|
|
|
|
"$user->email",
|
|
|
|
"$user->city",
|
|
|
|
"$user->country",
|
|
|
|
$strlastaccess,
|
|
|
|
$editbutton,
|
|
|
|
$deletebutton,
|
|
|
|
$confirmbutton);
|
2007-01-04 03:19:49 +00:00
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
2007-01-04 03:19:49 +00:00
|
|
|
|
2007-11-13 08:43:20 +00:00
|
|
|
// add filters
|
|
|
|
$ufiltering->display_add();
|
|
|
|
$ufiltering->display_active();
|
2007-01-25 00:04:02 +00:00
|
|
|
|
|
|
|
if (has_capability('moodle/user:create', $sitecontext)) {
|
2009-08-06 08:17:12 +00:00
|
|
|
echo $OUTPUT->heading('<a href="'.$securewwwroot.'/user/editadvanced.php?id=-1">'.get_string('addnewuser').'</a>');
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
|
|
|
if (!empty($table)) {
|
2010-03-20 22:15:54 +00:00
|
|
|
echo html_writer::table($table);
|
2010-02-17 16:59:41 +00:00
|
|
|
echo $OUTPUT->paging_bar($usercount, $page, $perpage, $baseurl);
|
2006-09-24 11:55:11 +00:00
|
|
|
if (has_capability('moodle/user:create', $sitecontext)) {
|
2009-08-06 08:17:12 +00:00
|
|
|
echo $OUTPUT->heading('<a href="'.$securewwwroot.'/user/editadvanced.php?id=-1">'.get_string('addnewuser').'</a>');
|
2004-03-20 06:58:52 +00:00
|
|
|
}
|
2007-01-25 00:04:02 +00:00
|
|
|
}
|
2004-03-19 04:29:00 +00:00
|
|
|
|
2009-08-06 14:12:46 +00:00
|
|
|
echo $OUTPUT->footer();
|
2007-01-25 00:04:02 +00:00
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2009-11-01 10:55:31 +00:00
|
|
|
|