mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-19 19:09:13 -04:00
Remove all non Identity API methods from Identity.php. Created an MY_Session class to provide the user state changes in the session and a login.php helper that has the login form.
This commit is contained in:
@@ -69,7 +69,7 @@ class Admin_Users_Controller extends Admin_Controller {
|
||||
public function delete_user($id) {
|
||||
access::verify_csrf();
|
||||
|
||||
if ($id == Identity::active()->id || $id == user::guest()->id) {
|
||||
if ($id == Session::active_user()->id || $id == user::guest()->id) {
|
||||
access::forbidden();
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ class Admin_Users_Controller extends Admin_Controller {
|
||||
}
|
||||
|
||||
// An admin can change the admin status for any user but themselves
|
||||
if ($user->id != Identity::active()->id) {
|
||||
if ($user->id != Session::active_user()->id) {
|
||||
$user->admin = $form->edit_user->admin->checked;
|
||||
}
|
||||
$user->save();
|
||||
@@ -158,7 +158,7 @@ class Admin_Users_Controller extends Admin_Controller {
|
||||
|
||||
$form = $this->_get_user_edit_form_admin($user);
|
||||
// Don't allow the user to control their own admin bit, else you can lock yourself out
|
||||
if ($user->id == Identity::active()->id) {
|
||||
if ($user->id == Session::active_user()->id) {
|
||||
$form->edit_user->admin->disabled(1);
|
||||
}
|
||||
print $form;
|
||||
|
||||
Reference in New Issue
Block a user