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:
Tim Almdal
2009-10-16 10:06:58 -07:00
parent bc241e44c2
commit 78ee4193b7
41 changed files with 194 additions and 176 deletions

View File

@@ -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;