summaryrefslogtreecommitdiff
path: root/protected/components/UserIdentity.php
diff options
context:
space:
mode:
authorTristan Zur <tzur@ccwn.org>2012-05-20 15:11:36 +0200
committerTristan Zur <tzur@ccwn.org>2012-05-20 15:11:36 +0200
commite9e241011e2c390b0e2d88e330ed5fa770369a8d (patch)
tree4e53218aa7c7019e0b66df9d7f3452a024c0e122 /protected/components/UserIdentity.php
parent9aad228e1af661b9b39df83700d27e71697dc66f (diff)
Benutzer: Basisimplementierung um neues Passwort zu generieren
aktuell ohne eMail-Versand und direkte Anzeige des Passworts in der Oberfläche
Diffstat (limited to 'protected/components/UserIdentity.php')
-rw-r--r--protected/components/UserIdentity.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/protected/components/UserIdentity.php b/protected/components/UserIdentity.php
index e506ef8..280515c 100644
--- a/protected/components/UserIdentity.php
+++ b/protected/components/UserIdentity.php
@@ -5,17 +5,14 @@
* It contains the authentication method that checks if the provided
* data can identity the user.
*/
-class UserIdentity extends CUserIdentity
-{
+class UserIdentity extends CUserIdentity {
public $id;
- public $isAdmin;
/**
* Authenticates a user.
*
* @return boolean whether authentication succeeds.
*/
- public function authenticate()
- {
+ public function authenticate() {
$user = User::model()->find('LOWER(username)=?', array(strtolower($this->username)));
if ($user === null){
$this->errorCode = self::ERROR_USERNAME_INVALID;
@@ -28,9 +25,15 @@ class UserIdentity extends CUserIdentity
$verein = Verein::model()->find('LOWER(slug)=?', array(strtolower($this->username)));
if (null !== $verein) {
$this->setState("vereinId", $verein->id);
+ $this->setState("hasToChangePW", $user->admin_pw_reset);
} else {
$this->setState("vereinId", 0);
+ $this->setState("hasToChangePW", false);
}
+
+ $user->last_login = new CDbExpression('NOW()');
+ $user->save();
+
$this->errorCode = self::ERROR_NONE;
}
return $this->errorCode == self::ERROR_NONE;