Permalink
Browse files

Use user API instead of direct ORM lookup.

  • Loading branch information...
1 parent b26e84d commit 416ffe8f1f2e33121af7378627bc2e896b6c6905 @bharat bharat committed Sep 29, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 modules/user/controllers/login.php
@@ -58,8 +58,8 @@ private function _auth($url) {
$form = user::get_login_form($url);
$valid = $form->validate();
if ($valid) {
- $user = ORM::factory("user")->where("name", $form->login->inputs["name"]->value)->find();
- if (!$user->loaded || !user::is_correct_password($user, $form->login->password->value)) {
+ $user = user::lookup_by_name($form->login->inputs["name"]->value);
+ if (!$user || !user::is_correct_password($user, $form->login->password->value)) {
log::warning(
"user",
t("Failed login for %name",

0 comments on commit 416ffe8

Please sign in to comment.