firstname . ' ' . $this->lastname; } public function generateRandomPassword() { return substr(md5($this->getFullName() . time()), 0, 6); } /** * Password is stored using md5($this->openid.$password) because * that's what's used in Zend_OpenId */ public function setClearPassword($password) { $this->password = md5($this->openid.$password); $this->password_changed = date('Y-m-d'); } public function isAllowed($resource, $privilege) { $acl = Zend_Registry::get('acl'); return $acl->isAllowed($this->role, $resource, $privilege); } public static function generateToken() { $token = ''; for ($i = 0; $i < 50; $i++) { $token .= chr(rand(48, 122)); } return md5($token.time()); } }