Пример #1
0
 /**
  * @return string
  */
 public function ServiceChange()
 {
     $oAccount = $this->oActions->GetAccount();
     if ($oAccount && $this->oActions->GetCapa(false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount)) {
         $oAccountToLogin = null;
         $sEmail = empty($this->aPaths[2]) ? '' : \urldecode(\trim($this->aPaths[2]));
         if (!empty($sEmail)) {
             $sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail);
             $aAccounts = $this->oActions->GetAccounts($oAccount);
             if (isset($aAccounts[$sEmail])) {
                 $oAccountToLogin = $this->oActions->GetAccountFromCustomToken($aAccounts[$sEmail], false, false);
             }
         }
         if ($oAccountToLogin) {
             $this->oActions->AuthToken($oAccountToLogin);
         }
     }
     $this->oActions->Location('./');
     return '';
 }