Merging from STABLE:

Fix for bug 4627:

Hide "change password" link in admin block if the user is restricted.
Not a security issue, as the script doesn't allow you to change your
password even if you go there by typing in the URL.

Credits for report & patch go to Joseph Rezeau.
This commit is contained in:
defacer
2006-01-28 19:49:16 +00:00
parent 6844571580
commit e68cf1b3e9
+2 -2
View File
@@ -194,10 +194,10 @@ class block_admin extends block_list {
}
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="" />';
if (is_internal_auth()) {
if (is_internal_auth() && !is_restricted_user($USER->username)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/login/change_password.php?id='.$this->instance->pageid.'">'.get_string('changepassword').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="" />';
} else if ($CFG->changepassword) {
} else if ($CFG->changepassword && !is_restricted_user($USER->username)) {
$this->content->items[]='<a href="'.$CFG->changepassword.'">'.get_string('changepassword').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="" />';
}