Commit 344d0a89 authored by skummer's avatar skummer

ZP-232 #comment keep the authentication user cases but use them lowercase for...

ZP-232 #comment keep the authentication user cases but use them lowercase for internal operations like opening the mapi store or checking permissions (so auth user is equal get user) #time 30m

git-svn-id: https://z-push.org/svn/z-push/trunk@1460 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 3ae31a03
...@@ -152,7 +152,7 @@ class BackendZarafa implements IBackend, ISearchProvider { ...@@ -152,7 +152,7 @@ class BackendZarafa implements IBackend, ISearchProvider {
*/ */
public function Logon($user, $domain, $pass) { public function Logon($user, $domain, $pass) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("ZarafaBackend->Logon(): Trying to authenticate user '%s'..", $user)); ZLog::Write(LOGLEVEL_DEBUG, sprintf("ZarafaBackend->Logon(): Trying to authenticate user '%s'..", $user));
$this->mainUser = $user; $this->mainUser = strtolower($user);
try { try {
// check if notifications are available in php-mapi // check if notifications are available in php-mapi
...@@ -183,7 +183,7 @@ class BackendZarafa implements IBackend, ISearchProvider { ...@@ -183,7 +183,7 @@ class BackendZarafa implements IBackend, ISearchProvider {
} }
// Get/open default store // Get/open default store
$this->defaultstore = $this->openMessageStore($user); $this->defaultstore = $this->openMessageStore($this->mainUser);
if (mapi_last_hresult() == MAPI_E_FAILONEPROVIDER) if (mapi_last_hresult() == MAPI_E_FAILONEPROVIDER)
throw new HTTPReturnCodeException("Error connecting to ZCP (open store)", 503, null, LOGLEVEL_INFO); throw new HTTPReturnCodeException("Error connecting to ZCP (open store)", 503, null, LOGLEVEL_INFO);
...@@ -192,7 +192,7 @@ class BackendZarafa implements IBackend, ISearchProvider { ...@@ -192,7 +192,7 @@ class BackendZarafa implements IBackend, ISearchProvider {
throw new AuthenticationRequiredException(sprintf("ZarafaBackend->Logon(): User '%s' has no default store", $user)); throw new AuthenticationRequiredException(sprintf("ZarafaBackend->Logon(): User '%s' has no default store", $user));
$this->store = $this->defaultstore; $this->store = $this->defaultstore;
$this->storeName = $user; $this->storeName = $this->mainUser;
ZLog::Write(LOGLEVEL_DEBUG, sprintf("ZarafaBackend->Logon(): User '%s' is authenticated",$user)); ZLog::Write(LOGLEVEL_DEBUG, sprintf("ZarafaBackend->Logon(): User '%s' is authenticated",$user));
......
...@@ -223,7 +223,6 @@ class Request { ...@@ -223,7 +223,6 @@ class Request {
// split username & domain if received as one // split username & domain if received as one
if (isset($_SERVER['PHP_AUTH_USER'])) { if (isset($_SERVER['PHP_AUTH_USER'])) {
list(self::$authUser, self::$authDomain) = Utils::SplitDomainUser($_SERVER['PHP_AUTH_USER']); list(self::$authUser, self::$authDomain) = Utils::SplitDomainUser($_SERVER['PHP_AUTH_USER']);
self::$authUser = strtolower(self::$authUser);
self::$authPassword = (isset($_SERVER['PHP_AUTH_PW']))?$_SERVER['PHP_AUTH_PW'] : ""; self::$authPassword = (isset($_SERVER['PHP_AUTH_PW']))?$_SERVER['PHP_AUTH_PW'] : "";
} }
// authUser & authPassword are unfiltered! // authUser & authPassword are unfiltered!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment