diff options
author | Nathan Kinkade <nkinkade@nkinka.de> | 2010-02-03 13:48:34 +0000 |
---|---|---|
committer | Nathan Kinkade <nkinkade@nkinka.de> | 2010-02-03 13:48:34 +0000 |
commit | 052476ef44ca801766cbd6bdbfe42d5a0a362e52 (patch) | |
tree | f7a1d39fe4aae154e916e2cd4c02a798aef6c67f /modules/user/models/user.php | |
parent | 92d211bae653b6c94e0038b1a47734a1acaa149e (diff) | |
parent | 99a7f470b93d35717f8d5979d05da6cf05a1dd20 (diff) |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/user/models/user.php')
-rw-r--r-- | modules/user/models/user.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/user/models/user.php b/modules/user/models/user.php index baac9315..4404ee63 100644 --- a/modules/user/models/user.php +++ b/modules/user/models/user.php @@ -122,7 +122,7 @@ class User_Model extends ORM implements User_Definition { public function valid_name(Validation $v, $field) { if (db::build()->from("users") ->where("name", "=", $this->name) - ->where("id", "<>", $this->id) + ->merge_where($this->id ? array(array("id", "<>", $this->id)) : null) ->count_records() == 1) { $v->add_error("name", "conflict"); } @@ -136,7 +136,7 @@ class User_Model extends ORM implements User_Definition { return; } - if (!$this->loaded() || $this->password_length) { + if (!$this->loaded() || isset($this->password_length)) { $minimum_length = module::get_var("user", "mininum_password_length", 5); if ($this->password_length < $minimum_length) { $v->add_error("password", "min_length"); |