Removed some old calls to isadmin
This commit is contained in:
+2
-3
@@ -339,9 +339,8 @@
|
||||
|
||||
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
|
||||
|
||||
if (!isadmin()) {
|
||||
//if (!has_capability('moodle/site:config', $context->id)) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
if (!has_capability('moodle/site:config', $context->id)) {
|
||||
print_error("permissionconfig", '', "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
/// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
|
||||
|
||||
@@ -39,7 +39,7 @@ class block_admin extends block_list {
|
||||
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/admin.gif" alt="" />';
|
||||
}
|
||||
|
||||
if (isadmin()) {
|
||||
if (has_capability('moodle/site:config', $context->id)) {
|
||||
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/users.php">'.get_string('users').'</a>';
|
||||
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/users.gif" alt="" />';
|
||||
}
|
||||
@@ -54,12 +54,12 @@ class block_admin extends block_list {
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/restore.gif" alt="" />';
|
||||
}
|
||||
|
||||
if (iscreator()) {
|
||||
if (has_capability('moodle/course:create', $context->id)) {
|
||||
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/course/index.php?edit=on&sesskey='.sesskey().'">'.get_string('courses').'</a>';
|
||||
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/course.gif" alt="" />';
|
||||
}
|
||||
|
||||
if (isadmin()) {
|
||||
if (has_capability('moodle/site:config', $context->id)) {
|
||||
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/course/report/log/index.php?id='.SITEID.'">'.get_string('logs').'</a>';
|
||||
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/log.gif" alt="" />';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user