summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-04-17 12:33:18 -0700
committerBharat Mediratta <bharat@menalto.com>2010-04-17 12:33:18 -0700
commit10f849cd0a8824a8f853a55e49859de30a291f01 (patch)
tree79c12131b2c4910fef866cc995365a9fa2b77a09
parentb4d1a5686c69d598efa5d387021912a0e31260ca (diff)
parent6d81feacae8329cd0c65abe920ecd3fa2e8f2537 (diff)
Merge branch 'master' into bharat_dev
-rw-r--r--modules/gallery/controllers/reauthenticate.php2
-rw-r--r--modules/user/controllers/users.php2
-rw-r--r--modules/user/helpers/user.php8
3 files changed, 9 insertions, 3 deletions
diff --git a/modules/gallery/controllers/reauthenticate.php b/modules/gallery/controllers/reauthenticate.php
index b2a67f01..3503d80a 100644
--- a/modules/gallery/controllers/reauthenticate.php
+++ b/modules/gallery/controllers/reauthenticate.php
@@ -63,7 +63,7 @@ class Reauthenticate_Controller extends Controller {
$group->password("password")->label(t("Password"))->id("g-password")->class(null)
->callback("auth::validate_too_many_failed_auth_attempts")
->callback("user::valid_password")
- ->error_messages("invalid", t("Incorrect password"))
+ ->error_messages("invalid_password", t("Incorrect password"))
->error_messages(
"too_many_failed_auth_attempts",
t("Too many incorrect passwords. Try again later"));
diff --git a/modules/user/controllers/users.php b/modules/user/controllers/users.php
index e1f1fa2b..7f3f6b1f 100644
--- a/modules/user/controllers/users.php
+++ b/modules/user/controllers/users.php
@@ -167,7 +167,7 @@ class Users_Controller extends Controller {
$group->password("old_password")->label(t("Old password"))->id("g-password")
->callback("auth::validate_too_many_failed_auth_attempts")
->callback("user::valid_password")
- ->error_messages("invalid", t("Incorrect password"))
+ ->error_messages("invalid_password", t("Incorrect password"))
->error_messages(
"too_many_failed_auth_attempts",
t("Too many incorrect passwords. Try again later"));
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php
index 650dcf6a..55153263 100644
--- a/modules/user/helpers/user.php
+++ b/modules/user/helpers/user.php
@@ -72,7 +72,13 @@ class user_Core {
static function valid_password($password_input) {
if (!user::is_correct_password(identity::active_user(), $password_input->value)) {
- $password_input->add_error("invalid", 1);
+ $password_input->add_error("invalid_password", 1);
+ }
+ }
+
+ static function valid_username($text_input) {
+ if (!self::lookup_by_name($text_input->value)) {
+ $text_input->add_error("invalid_username", 1);
}
}