openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ceb81a0f6562232b82d669d4ddb7d94a4d81b503
parent 1b71d85660bd70be63e36facd4d7bd0f0c4ba389
Author: Jan Dankert <devnull@localhost>
Date:   Fri,  1 Mar 2013 23:20:38 +0100

Anzeige für verpflichtenden Kennwortwechsel.

Diffstat:
action/LoginAction.class.php | 26+++++++++++++++-----------
auth/InternalAuth.class.php | 6++++++
2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/action/LoginAction.class.php b/action/LoginAction.class.php @@ -29,8 +29,6 @@ class LoginAction extends Action { public $security = SECURITY_GUEST; - var $mustChangePassword = false; - function setDb( $dbid ) { global $conf; @@ -125,9 +123,9 @@ class LoginAction extends Action $ok = $user->checkPassword( $pw ); - $this->mustChangePassword = $user->mustChangePassword; + $mustChangePassword = $user->mustChangePassword; - if ( $this->mustChangePassword ) + if ( $mustChangePassword ) { // Der Benutzer hat zwar ein richtiges Kennwort eingegeben, aber dieses ist abgelaufen. // Wir versuchen hier, das neue zu setzen (sofern eingegeben). @@ -151,8 +149,8 @@ class LoginAction extends Action // Das neue Kennwort ist gesetzt, die Anmeldung ist also doch noch gelungen. $ok = true; - $this->mustChangePassword = false; - $user->mustChangePassword = false; + $mustChangePassword = false; + $mustChangePassword = false; } } @@ -830,17 +828,23 @@ class LoginAction extends Action setcookie('or_username',$loginName ,time()+$cookieLifetime ); setcookie('or_dbid' ,$this->getRequestVar('dbid'),time()+$cookieLifetime ); - // Authentifzierung. + // Authentifzierungs-Module. $modules = explode(',',$conf['security']['modules']['authenticate']); - $loginOk = false; - $groups = null; + $loginOk = false; + $mustChangePassword = false; + $groups = null; + + // Jedes Authentifizierungsmodul durchlaufen, bis ein Login erfolgreich ist. foreach( $modules as $module) { $moduleClass = $module.'Auth'; $auth = new $moduleClass; Logger::info('Trying to login with module '.$moduleClass); - $loginOk = $auth->login( $loginName,$loginPassword ); + $loginOk = $auth->login( $loginName,$loginPassword ); + + if ( @$auth->mustChangePassword ) + $mustChangePassword = true; if ( $loginOk ) { @@ -900,7 +904,7 @@ class LoginAction extends Action sleep(3); Logger::debug("Login failed for user '$loginName'"); - if ( $this->mustChangePassword ) + if ( $mustChangePassword ) { // Anmeldung gescheitert, Benutzer muss Kennwort ?ndern. $this->addNotice('user',$loginName,'LOGIN_FAILED_MUSTCHANGEPASSWORD','error' ); diff --git a/auth/InternalAuth.class.php b/auth/InternalAuth.class.php @@ -1,5 +1,11 @@ <?php +/** + * Authentifizierungsmodul für die interne Benutzerdatenbank. + * + * @author Jan Dankert + * + */ class InternalAuth implements Auth { var $mustChangePassword = false;