Changeset 1534 for trunk/modules/auth/models/user.php
- Timestamp:
- 12/14/2007 12:52:49 PM (13 months ago)
- Files:
-
- 1 modified
-
trunk/modules/auth/models/user.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/auth/models/user.php
r1431 r1534 76 76 77 77 /** 78 * Removes all roles for this user when the object is deleted.78 * Allows a model to be loaded by username or email address. 79 79 */ 80 public function delete()81 {82 $where = array($this->class.'_id' => $this->object->id);83 $table = $this->related_table('roles');84 85 if ($return = parent::delete())86 {87 // Remove users<>roles relationships88 self::$db89 ->where($where)90 ->delete($table);91 }92 93 return $return;94 }95 96 80 protected function where_key($id = NULL) 97 81 { 98 if ( is_string($id) AND ! is_numeric($id))82 if ( ! empty($id) AND is_string($id) AND ! ctype_digit($id)) 99 83 { 100 84 return valid::email($id) ? 'email' : 'username';
