summaryrefslogtreecommitdiff
path: root/modules/user
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-05-13 01:49:54 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-05-13 01:49:54 +0000
commita0b0b415515bff5f9edd43d373e8e78f3b3f8e4d (patch)
treea101f7a71a33f75c21d4ac828f442d902f5d8af9 /modules/user
parent104430e9e1e8dacd5e4320e29e59fc59aa5c6ee9 (diff)
parent9affa8ebbd539396d71f19003b91af577a8a183e (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/user')
-rw-r--r--modules/user/controllers/admin_users.php1
-rw-r--r--modules/user/controllers/users.php2
-rw-r--r--modules/user/helpers/user.php8
3 files changed, 9 insertions, 2 deletions
diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php
index 3e36fd67..e14be393 100644
--- a/modules/user/controllers/admin_users.php
+++ b/modules/user/controllers/admin_users.php
@@ -20,6 +20,7 @@
class Admin_Users_Controller extends Admin_Controller {
public function index() {
$view = new Admin_View("admin.html");
+ $view->page_title = t("Users and groups");
$view->content = new View("admin_users.html");
$view->content->users = ORM::factory("user")->order_by("name", "ASC")->find_all();
$view->content->groups = ORM::factory("group")->order_by("name", "ASC")->find_all();
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);
}
}