Merge branch 'master' of https://gerrit.tine20.org/tine20/p/tine20
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 29 Aug 2014 18:53:16 +0000 (20:53 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 29 Aug 2014 18:53:16 +0000 (20:53 +0200)
Conflicts:
tine20/Tinebase/Controller.php

Change-Id: Ie864176f73a3f33865d34813e3b8ca9b5a427689

1  2 
tine20/Tinebase/Controller.php
tine20/Tinebase/Frontend/Json.php

@@@ -96,27 -123,31 +123,37 @@@ class Tinebase_Controller extends Tineb
          
          if ($accessLog->result === Tinebase_Auth::SUCCESS && $user !== NULL && $user->accountStatus === Tinebase_User::STATUS_ENABLED) {
              if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(
 -                    __METHOD__ . '::' . __LINE__ . " Login with username $_loginname from $_ipAddress succeeded.");
 -        
 -            $this->_initUser($user, $accessLog, $_password);
 -        
 -            $result = TRUE;
 +                __METHOD__ . '::' . __LINE__ . " Login with username $_loginname from $_ipAddress succeeded.");
++            
 +            $this->_initUserAfterLogin($user, $accessLog, $_password);
 +            
 +            $result = true;
++            
          } else {
 +            if ($user !== NULL && $user->accountStatus === Tinebase_User::STATUS_DISABLED) {
 +                // TODO send this for blocked/expired, too? allow to configure this?
 +                Tinebase_User::getInstance()->sendDeactivationNotification($user);
 +            }
 +            
              if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) Tinebase_Core::getLogger()->warn(
-                 __METHOD__ . '::' . __LINE__ . " Login with username $_loginname from $_ipAddress failed ($authResultCode)!");
+                     __METHOD__ . '::' . __LINE__ . " Login with username $_loginname from $_ipAddress failed ({$authResult->getCode()})!");
              if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(
-                 __METHOD__ . '::' . __LINE__ . ' Failure messages: ' . print_r($authResult->getMessages(), TRUE));
-             $this->_loginFailed($_loginname ? $_loginname : $authResultIdentity, $accessLog);
-             
-             $result = false;
-         } 
+                     __METHOD__ . '::' . __LINE__ . ' Failure messages: ' . print_r($authResult->getMessages(), TRUE));
+         
+             $this->_loginFailed($_loginname ? $_loginname : $authResult->getIdentity(), $accessLog);
+         
+             $result = FALSE;
+         }
+         return $result;
+     }
+     
+     
+     /**
+      *
+      * @param Tinebase_Model_AccessLog $accessLog
+      */
+     protected function _updateAccessLogInstance(Tinebase_Model_AccessLog $accessLog)
+     {
          if (Tinebase_Core::get('serverclassname') !== 'ActiveSync_Server_Http' || !(ActiveSync_Config::getInstance()->get(ActiveSync_Config::DISABLE_ACCESS_LOG))) {
              Tinebase_AccessLog::getInstance()->create($accessLog);
          }
Simple merge