From: vinkmar Date: Fri, 18 Aug 2006 07:52:56 +0000 (+0000) Subject: Reverting changes to file from admin page cleanup... whoops! Accidentally broke the... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4cd174bfceb299a253f2c73591ba8f963f14eaf3;p=moodle.git Reverting changes to file from admin page cleanup... whoops! Accidentally broke the install. --- diff --git a/admin/user.php b/admin/user.php index 32f03bde6a..0714fdec8f 100644 --- a/admin/user.php +++ b/admin/user.php @@ -1,11 +1,6 @@ dirroot . '/admin/adminlib.php'); - -admin_externalpage_setup('editusers'); -admin_externalpage_print_header(); - + require_once('../config.php'); $newuser = optional_param('newuser', 0, PARAM_BOOL); $delete = optional_param('delete', 0, PARAM_INT); @@ -111,7 +106,7 @@ admin_externalpage_print_header(); if ($newuser && confirm_sesskey()) { // Create a new user - if (!has_capability('moodle/user:create', $context->id)) { + if (!has_capability('moodle/user:create', $context)) { error('You do not have the required permission to create new users.'); } @@ -135,7 +130,7 @@ admin_externalpage_print_header(); } else { // List all users for editing - if (!has_capability('moodle/user:update', $context->id)) { + if (!has_capability('moodle/user:update', $context)) { error('You do not have the required permission to edit users.'); } @@ -148,6 +143,16 @@ admin_externalpage_print_header(); $strsearch = get_string("search"); $strshowallusers = get_string("showallusers"); + if ($firstinitial or $lastinitial or $search or $page) { + print_header("$site->shortname: $stredituser", $site->fullname, + "$stradministration -> ". + "$strusers -> ". + "$stredituser"); + } else { + print_header("$site->shortname: $stredituser", $site->fullname, + "$stradministration -> ". + "$strusers -> $stredituser"); + } if ($confirmuser and confirm_sesskey()) { if (!$user = get_record("user", "id", "$confirmuser")) { @@ -167,7 +172,7 @@ admin_externalpage_print_header(); } else if ($delete and confirm_sesskey()) { // Delete a selected user, after confirmation - if (!has_capability('moodle/user:delete', $context->id)) { + if (!has_capability('moodle/user:delete', $context)) { error('You do not have the required permission to delete a user.'); } @@ -339,7 +344,7 @@ admin_externalpage_print_header(); if ($user->id == $USER->id or $user->username == "changeme") { $deletebutton = ""; } else { - if (has_capability('moodle/user:delete', $context->id)) { + if (has_capability('moodle/user:delete', $context)) { $deletebutton = "id&sesskey=$USER->sesskey\">$strdelete"; } else { $deletebutton =""; } @@ -356,7 +361,7 @@ admin_externalpage_print_header(); } $fullname = fullname($user, true); - if (has_capability('moodle/user:edit', $context->id)) { + if (has_capability('moodle/user:edit', $context)) { $table->data[] = array ("id&course=$site->id\">$fullname", "$user->email", @@ -389,7 +394,7 @@ admin_externalpage_print_header(); echo ""; echo ""; - if (has_capability('moodle/user:create', $context->id)) { + if (has_capability('moodle/user:create', $context)) { print_heading("sesskey\">".get_string("addnewuser").""); } if (!empty($table)) { @@ -397,13 +402,13 @@ admin_externalpage_print_header(); print_paging_bar($usercount, $page, $perpage, "user.php?sort=$sort&dir=$dir&perpage=$perpage". "&firstinitial=$firstinitial&lastinitial=$lastinitial&search=".urlencode(stripslashes($search))."&"); - if (has_capability('moodle/user:create', $context->id)) { + if (has_capability('moodle/user:create', $context)) { print_heading("sesskey\">".get_string("addnewuser").""); } } - admin_externalpage_print_footer(); + print_footer(); } -?> \ No newline at end of file +?>