diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-05 14:04:27 -0700 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-05 16:28:16 -0700 |
| commit | 194cc3b27a73afe5119da9f09407c1e068dc6fa3 (patch) | |
| tree | 08d4830e7491ba6206d231858766f5d713ce971d /modules/user/controllers/password.php | |
| parent | 08c01fec6cc590eb578522164de81114b889c4b5 (diff) | |
First pass on converting calls to the Identity interface. Will worry about writes and saves later.
Convert the Admin_User controller
Convert the login and password change controller
Change the item model to call user::lookup to get the owner.
On the log model, delete the relationship between the log and user table, and replace with a
call to user::lookup
Diffstat (limited to 'modules/user/controllers/password.php')
| -rw-r--r-- | modules/user/controllers/password.php | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/modules/user/controllers/password.php b/modules/user/controllers/password.php index 4629bbf2..817ff01c 100644 --- a/modules/user/controllers/password.php +++ b/modules/user/controllers/password.php @@ -32,10 +32,8 @@ class Password_Controller extends Controller { if (request::method() == "post") { $this->_change_password(); } else { - $user = ORM::factory("user") - ->where("hash", Input::instance()->get("key")) - ->find(); - if ($user->loaded) { + $user = user::lookyp_by_hash(Input::instance()->get("key")); + if (!empty($user)) { print $this->_new_password_form($user->hash); } else { throw new Exception("@todo FORBIDDEN", 503); @@ -48,7 +46,7 @@ class Password_Controller extends Controller { $valid = $form->validate(); if ($valid) { - $user = ORM::factory("user")->where("name", $form->reset->inputs["name"]->value)->find(); + $user = user::lockup_by_name($form->reset->inputs["name"]->value); if (!$user->loaded || empty($user->email)) { $form->reset->inputs["name"]->add_error("no_email", 1); $valid = false; @@ -118,11 +116,8 @@ class Password_Controller extends Controller { private function _change_password() { $view = $this->_new_password_form(); if ($view->content->validate()) { - $user = ORM::factory("user") - ->where("hash", $view->content->reset->hash->value) - ->find(); - - if (!$user->loaded) { + $user = user::lookyp_by_hash(Input::instance()->get("key")); + if (empty($user)) { throw new Exception("@todo FORBIDDEN", 503); } |
