コード例 #1
0
 /**
  * @return string
  */
 public function ServiceRemoteAutoLogin()
 {
     $oException = null;
     $oAccount = null;
     $bLogout = true;
     $sEmail = $this->oHttp->GetEnv('REMOTE_USER', '');
     $sPassword = $this->oHttp->GetEnv('REMOTE_PASSWORD', '');
     if (0 < \strlen($sEmail) && 0 < \strlen(\trim($sPassword))) {
         try {
             $oAccount = $this->oActions->LoginProcess($sEmail, $sPassword);
             $this->oActions->AuthToken($oAccount);
             $bLogout = !$oAccount instanceof \RainLoop\Model\Account;
         } catch (\Exception $oException) {
             $this->oActions->Logger()->WriteException($oException);
         }
     }
     if ($bLogout) {
         $this->oActions->SetAuthLogoutToken();
     }
     $this->oActions->Location('./');
     return '';
 }