openrat-cms

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

commit e0b431484d6b4a6c93edf4e06c6e93f2ee592304
parent b5c7310336cf593541cbb137fa27e6528195c6fe
Author: Jan Dankert <devnull@localhost>
Date:   Fri,  1 Mar 2013 00:49:45 +0100

Merken des Benutzer-Logins im Cookie über einen Login-Cookie: Fix, DB-Verbindung bereitstellen.

Diffstat:
auth/RememberAuth.class.php | 8+++++++-
auth/include.inc.php | 1+
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/auth/RememberAuth.class.php b/auth/RememberAuth.class.php @@ -5,7 +5,7 @@ * * @author dankert */ -class CookieAuth implements Auth +class RememberAuth implements Auth { public function username() { @@ -14,6 +14,12 @@ class CookieAuth implements Auth $name = $_COOKIE['or_username']; try { + global $conf; + $db = new DB( $conf['database'][$_COOKIE['or_dbid']] ); + $db->id = $dbid; + $db->start(); + Session::setDatabase($db); + $user = User::loadWithName($name); $token = $user->loginToken(); diff --git a/auth/include.inc.php b/auth/include.inc.php @@ -10,6 +10,7 @@ require_once( OR_AUTHCLASSES_DIR."LdapAuth.class.".PHP_EXT ); require_once( OR_AUTHCLASSES_DIR."LdapUserDNAuth.class.".PHP_EXT ); require_once( OR_AUTHCLASSES_DIR."OpenIdAuth.class.".PHP_EXT ); require_once( OR_AUTHCLASSES_DIR."PersonasAuth.class.".PHP_EXT ); +require_once( OR_AUTHCLASSES_DIR."RememberAuth.class.".PHP_EXT ); require_once( OR_AUTHCLASSES_DIR."SingleSignonAuth.class.".PHP_EXT ); require_once( OR_AUTHCLASSES_DIR."SSLAuth.class.".PHP_EXT ); ?> \ No newline at end of file