get the user to change their pass
git-svn-id: file:///home/shish/svn/shimmie2/trunk@726 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
c5349db306
commit
d0483bcc2a
@ -263,7 +263,9 @@ class UserPage extends Extension {
|
|||||||
$pass1 = $_POST['pass1'];
|
$pass1 = $_POST['pass1'];
|
||||||
$pass2 = $_POST['pass2'];
|
$pass2 = $_POST['pass2'];
|
||||||
|
|
||||||
if((!$user->is_admin()) && ($name != $user->name)) {
|
$duser = $database->get_user_by_id($id);
|
||||||
|
|
||||||
|
if((!$user->is_admin()) && ($duser->name != $user->name)) {
|
||||||
$page->add_block(new Block("Error",
|
$page->add_block(new Block("Error",
|
||||||
"You need to be an admin to change other people's passwords"));
|
"You need to be an admin to change other people's passwords"));
|
||||||
}
|
}
|
||||||
@ -278,7 +280,7 @@ class UserPage extends Extension {
|
|||||||
$duser->set_password($pass1);
|
$duser->set_password($pass1);
|
||||||
|
|
||||||
if($id == $user->id) {
|
if($id == $user->id) {
|
||||||
$this->set_login_cookie($name, $pass1);
|
$this->set_login_cookie($duser->name, $pass1);
|
||||||
$page->set_mode("redirect");
|
$page->set_mode("redirect");
|
||||||
$page->set_redirect(make_link("user"));
|
$page->set_redirect(make_link("user"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user