diff options
| author | Andy Staudacher <andy.st@gmail.com> | 2010-02-06 11:32:53 -0800 |
|---|---|---|
| committer | Andy Staudacher <andy.st@gmail.com> | 2010-02-06 11:32:53 -0800 |
| commit | 4977c00db1b812abad5ad2d530e1dd44171b6d85 (patch) | |
| tree | 4abab0ff9bb6951f8a53b49ea8d2f494a48140d0 /modules/user/models | |
| parent | 31aaf7555f51dd80cf1e97fd3c20a1c245cbf61b (diff) | |
| parent | 15e22076552929bf1f45888945f65de621aa2aac (diff) | |
Merge commit 'upstream/master'
Diffstat (limited to 'modules/user/models')
| -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"); |
