/**
  * @return void
  */
 private function __construct()
 {
     $this->oHttp = \MailSo\Base\Http::SingletonInstance();
     $this->oActions = \RainLoop\Api::Actions();
     $this->oServiceActions = new \RainLoop\ServiceActions($this->oHttp, $this->oActions);
     if ($this->oActions->Config()->Get('debug', 'enable', false)) {
         \error_reporting(E_ALL);
         \ini_set('display_errors', 1);
     }
     \RainLoop\Api::SetupDefaultMailSoConfig();
     $sServer = \trim($this->oActions->Config()->Get('security', 'custom_server_signature', ''));
     if (0 < \strlen($sServer)) {
         @\header('Server: ' . $sServer, true);
     }
     if ($this->oActions->Config()->Get('labs', 'force_https', false) && !$this->oHttp->IsSecure()) {
         @\header('Location: https://' . $this->oHttp->GetHost(false, false) . $this->oHttp->GetUrl(), true);
         exit;
     }
 }
Ejemplo n.º 2
0
 /**
  * @param string $sEmail
  *
  * @return bool
  */
 public static function ClearUserData($sEmail)
 {
     if (0 < \strlen($sEmail)) {
         $sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail);
         $oStorageProvider = \RainLoop\Api::Actions()->StorageProvider();
         if ($oStorageProvider && $oStorageProvider->IsActive()) {
             $oStorageProvider->DeleteStorage($sEmail);
         }
         if (\RainLoop\Api::Actions()->AddressBookProvider() && \RainLoop\Api::Actions()->AddressBookProvider()->IsActive()) {
             \RainLoop\Api::Actions()->AddressBookProvider()->DeleteAllContacts($sEmail);
         }
         return true;
     }
     return false;
 }
Ejemplo n.º 3
0
                return include RAINLOOP_APP_LIBRARIES_PATH . \strtr($sClassName, '\\', '/') . '.php';
            }
        }
        return false;
    }
    \spl_autoload_register('rainLoopSplAutoloadRegisterFunction', false);
}
if (\class_exists('RainLoop\\Api')) {
    if (!\class_exists('MailSo\\Version', false)) {
        include APP_VERSION_ROOT_PATH . 'app/libraries/MailSo/MailSo.php';
    }
    if (\class_exists('MailSo\\Version')) {
        if (RAINLOOP_INCLUDE_AS_API_DEF) {
            if (!\defined('APP_API_STARTED')) {
                \define('APP_API_STARTED', true);
                \RainLoop\Api::Handle();
            }
        } else {
            if (!\defined('APP_STARTED')) {
                \define('APP_STARTED', true);
                \RainLoop\Api::Handle();
                \RainLoop\Api::Actions()->DoLogout();
                \RainLoop\Api::ExitOnEnd();
            }
        }
    }
} else {
    if (\function_exists('rainLoopSplAutoloadRegisterFunction')) {
        \spl_autoload_unregister('rainLoopSplAutoloadRegisterFunction');
    }
}
 /**
  * @param string $sEmail
  *
  * @return bool
  */
 public static function ClearUserData($sEmail)
 {
     if (0 < \strlen($sEmail)) {
         $sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail);
         $oStorageProvider = \RainLoop\Api::Actions()->StorageProvider();
         if ($oStorageProvider && $oStorageProvider->IsActive()) {
             // TwoFactor Auth User Data
             $oStorageProvider->Clear(null, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\KeyPathHelper::TwoFactorAuthUserData($sEmail));
             // Accounts list
             $oStorageProvider->Clear(null, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\KeyPathHelper::WebmailAccounts($sEmail));
             // Contact sync data
             $oStorageProvider->Clear($sEmail, \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, 'contacts_sync');
         }
         \RainLoop\Api::Actions()->SettingsProvider()->ClearByEmail($sEmail);
         if (\RainLoop\Api::Actions()->AddressBookProvider() && \RainLoop\Api::Actions()->AddressBookProvider()->IsActive()) {
             \RainLoop\Api::Actions()->AddressBookProvider()->DeleteAllContactsAndTags($sEmail);
         }
         return true;
     }
     return false;
 }