当前位置: 首页>>代码示例>>PHP>>正文


PHP CApi::IsValid方法代码示例

本文整理汇总了PHP中CApi::IsValid方法的典型用法代码示例。如果您正苦于以下问题:PHP CApi::IsValid方法的具体用法?PHP CApi::IsValid怎么用?PHP CApi::IsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CApi的用法示例。


在下文中一共展示了CApi::IsValid方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CheckApi

 public function CheckApi()
 {
     if (!class_exists('\\CApi') || !\CApi::IsValid()) {
         echo 'AfterLogic API';
         return '';
     }
 }
开发者ID:afterlogic,项目名称:aurora-core,代码行数:7,代码来源:Service.php

示例2: validateUserPass

 /**
  * Validates a username and password
  *
  * This method should return true or false depending on if login
  * succeeded.
  *
  * @return bool
  */
 protected function validateUserPass($sUserName, $sPassword)
 {
     if (class_exists('CApi') && \CApi::IsValid()) {
         /* @var $oApiCalendarManager \CApiCalendarManager */
         $oApiCalendarManager = \CApi::Manager('calendar');
         /* @var $oApiCapabilityManager \CApiCapabilityManager */
         $oApiCapabilityManager = \CApi::Manager('capability');
         if ($oApiCalendarManager && $oApiCapabilityManager) {
             $oAccount = \afterlogic\DAV\Utils::GetAccountByLogin($sUserName);
             if ($oAccount && $oAccount->IsDisabled) {
                 return false;
             }
             $bIsOutlookSyncClient = \afterlogic\DAV\Utils::ValidateClient('outlooksync');
             $bIsMobileSync = false;
             $bIsOutlookSync = false;
             $bIsDemo = false;
             if ($oAccount) {
                 $bIsMobileSync = $oApiCapabilityManager->IsMobileSyncSupported($oAccount);
                 $bIsOutlookSync = $oApiCapabilityManager->IsOutlookSyncSupported($oAccount);
                 \CApi::Plugin()->RunHook('plugin-is-demo-account', array(&$oAccount, &$bIsDemo));
             }
             if ($oAccount && $oAccount->IncomingMailPassword === $sPassword && ($bIsMobileSync && !$bIsOutlookSyncClient || $bIsOutlookSync && $bIsOutlookSyncClient) || $bIsDemo || $sUserName === $oApiCalendarManager->GetPublicUser()) {
                 \afterlogic\DAV\Utils::CheckPrincipals($sUserName);
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:37,代码来源:Basic.php

示例3: getDigestHash

 public function getDigestHash($sRealm, $sUserName)
 {
     if (class_exists('CApi') && \CApi::IsValid()) {
         /* @var $oApiCapabilityManager \CApiCapabilityManager */
         $oApiCapabilityManager = \CApi::GetSystemManager('capability');
         if ($oApiCapabilityManager) {
             $oAccount = \Afterlogic\DAV\Utils::GetAccountByLogin($sUserName);
             if ($oAccount && $oAccount->IsDisabled) {
                 return null;
             }
             $bIsOutlookSyncClient = \Afterlogic\DAV\Utils::ValidateClient('outlooksync');
             $bIsMobileSync = false;
             $bIsOutlookSync = false;
             $bIsDemo = false;
             if ($oAccount) {
                 $bIsMobileSync = $oApiCapabilityManager->isMobileSyncSupported($oAccount);
                 $bIsOutlookSync = $oApiCapabilityManager->isOutlookSyncSupported($oAccount);
                 \CApi::Plugin()->RunHook('plugin-is-demo-account', array(&$oAccount, &$bIsDemo));
             }
             if ($oAccount && ($bIsMobileSync && !$bIsOutlookSyncClient || $bIsOutlookSync && $bIsOutlookSyncClient) || $bIsDemo || $sUserName === \CApi::ExecuteMethod('Dav::GetPublicUser')) {
                 return md5($sUserName . ':' . $sRealm . ':' . ($bIsDemo ? 'demo' : $oAccount->IncomingMailPassword));
             }
         }
     }
     return null;
 }
开发者ID:afterlogic,项目名称:dav,代码行数:26,代码来源:Digest.php

示例4: validateUserPass

 /**
  * Validates a username and password
  *
  * This method should return true or false depending on if login
  * succeeded.
  *
  * @return bool
  */
 protected function validateUserPass($sUserName, $sPassword)
 {
     $mResult = false;
     if (class_exists('CApi') && \CApi::IsValid()) {
         /* @var $oApiCapabilityManager \CApiCapabilityManager */
         $oApiCapabilityManager = \CApi::GetSystemManager('capability');
         if ($oApiCapabilityManager) {
             $oDavDecorator = \CApi::GetModuleDecorator('Dav');
             if ($oDavDecorator) {
                 $mResult = $oDavDecorator->Login($sUserName, $sPassword);
             }
             $bIsOutlookSyncClient = \Afterlogic\DAV\Utils::ValidateClient('outlooksync');
             $bIsMobileSync = false;
             $bIsOutlookSync = false;
             $bIsDemo = false;
             //				if ($mResult !== false) {
             //					$iIdUser = isset($mResult['id']) ? $mResult['id'] : 0;
             //					return true;
             /*					
             					$bIsMobileSync = $oApiCapabilityManager->isMobileSyncSupported($iIdUser);
             					$bIsOutlookSync = $oApiCapabilityManager->isOutlookSyncSupported($iIdUser);
             					
             					\CApi::Plugin()->RunHook(
             							'plugin-is-demo-account', 
             							array(&$oAccount, &$bIsDemo)
             					);
             * 
             */
             //				}
             /*
             				if (($oAccount && $oAccount->IncomingMailPassword === $sPassword &&
             						(($bIsMobileSync && !$bIsOutlookSyncClient) || 
             						($bIsOutlookSync && $bIsOutlookSyncClient))) ||
             						$bIsDemo || $sUserName === \CApi::ExecuteMethod('Dav::GetPublicUser')) {
             					return true;
             				}
             * 
             */
         }
     }
     return $mResult;
 }
开发者ID:afterlogic,项目名称:dav,代码行数:50,代码来源:Basic.php

示例5: initAdminPanel

 /**
  * @return void
  */
 protected function initAdminPanel()
 {
     $this->RType = (bool) CApi::GetConf('tenant', false);
     $this->AType = !!CApi::Manager('collaboration');
     $this->aTabsSort = array(AP_TAB_COMMON, AP_TAB_DOMAINS, AP_TAB_USERS, AP_TAB_TENANTS, AP_TAB_CHANNELS, AP_TAB_SYSTEM);
     $GLOBALS[AP_START_TIME] = ap_Utils::Microtime();
     $GLOBALS[AP_DB_COUNT] = 0;
     if (isset($_GET['logout'])) {
         CSession::ClearAll();
         CApi::Location(AP_INDEX_FILE . '?login');
     }
     if (isset($_GET['tab']) && strlen($_GET['tab']) > 0) {
         CSession::Set(AP_SESS_TAB, $_GET['tab']);
     } else {
         CSession::Set(AP_SESS_TAB, CSession::Get(AP_SESS_TAB, AP_TAB_DEFAULT));
     }
     $this->sTab = CSession::Get(AP_SESS_TAB, AP_TAB_DEFAULT);
     try {
         $this->CssAddFile('static/styles/style.css');
         $this->JsAddFile('static/js/common.js');
         $this->JsAddFile('static/js/jquery.js');
         if (!CApi::IsValid()) {
             return false;
         }
         $this->initModules();
         $this->initType();
         $this->initAuth();
         $this->sHelpUrl = '';
         $sUrl = $this->IsTenantAuthType() ? (string) CApi::GetConf('labs.custom-tenant-help-url', '') : (string) CApi::GetConf('labs.custom-admin-help-url', '');
         if (0 < strlen($sUrl)) {
             $this->sHelpUrl = $sUrl;
         } else {
             if ($this->AType) {
                 $this->sHelpUrl = 'http://www.afterlogic.com/wiki/Aurora_documentation';
             } else {
                 if ($this->PType) {
                     $this->sHelpUrl = 'http://www.afterlogic.com/wiki/WebMail_Pro_documentation';
                 } else {
                     $this->sHelpUrl = 'http://www.afterlogic.com/wiki/WebMail_Lite_documentation';
                 }
             }
         }
         if (isset($_GET['help'])) {
             if (0 < strlen($this->sHelpUrl)) {
                 CApi::Location($this->sHelpUrl);
             } else {
                 CApi::Location('?root');
             }
         }
         $bResetToDefault = true;
         foreach ($this->aTabs as $aTab) {
             if (isset($aTab[1]) && (string) $aTab[1] === (string) $this->sTab) {
                 $bResetToDefault = false;
                 break;
             }
         }
         if ($bResetToDefault) {
             $this->sTab = $this->IsTenantAuthType() ? AP_TAB_TENANT_DEFAULT : AP_TAB_DEFAULT;
             CSession::Set(AP_SESS_TAB, $this->sTab);
         }
         if (isset($_GET['submit']) && isset($_POST) && 0 < count($_POST)) {
             $this->bShowScreen = false;
             $sReturnRef = $this->initPostActionModules($this->sTab);
             CApi::Location(AP_INDEX_FILE . $sReturnRef);
         } else {
             if (isset($_GET['pop'])) {
                 $this->bShowScreen = false;
                 $this->initPopActionModules($this->sTab);
             } else {
                 if (isset($_GET['blank'])) {
                     $this->bShowScreen = false;
                     $this->initBlankActionModules($this->sTab);
                 } else {
                     if (isset($_GET['ajax'])) {
                         $this->bShowScreen = false;
                         $this->initAjaxActionModules($this->sTab);
                     } else {
                         $this->oCurrentScreen = $this->initScreen($this->sTab);
                         if ($this->oCurrentScreen) {
                             $this->oCurrentScreen->PreModuleInit();
                             $this->initCurrentScreenByModules('first', $this->sTab, $this->oCurrentScreen);
                             $this->oCurrentScreen->MiddleModuleInit();
                             $this->initCurrentScreenByModules('second', $this->sTab, $this->oCurrentScreen);
                             $this->oCurrentScreen->EndModuleInit();
                             $this->initCurrentScreenByModules('third', $this->sTab, $this->oCurrentScreen);
                         }
                         if (CSession::Has(AP_SESS_ERROR)) {
                             $this->JsAddInitText('OnlineMsgError("' . ap_Utils::ReBuildStringToJavaScript(nl2br(CSession::Get(AP_SESS_ERROR, '')), '"') . '");');
                             CSession::Clear(AP_SESS_ERROR);
                         } else {
                             if (CSession::Has(AP_SESS_MESSAGE)) {
                                 $this->JsAddInitText('OnlineMsgInfo("' . ap_Utils::ReBuildStringToJavaScript(nl2br(CSession::Get(AP_SESS_MESSAGE, '')), '"') . '");');
                                 CSession::Clear(AP_SESS_MESSAGE);
                             }
                         }
                     }
                 }
//.........这里部分代码省略.........
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:101,代码来源:cadminpanel.php

示例6: Handle

 /**
  * @return void
  */
 public function Handle()
 {
     $sVersion = file_get_contents(PSEVEN_APP_ROOT_PATH . 'VERSION');
     define('PSEVEN_APP_VERSION', $sVersion);
     if (!class_exists('MailSo\\Version')) {
         echo 'MailSo';
         return '';
     } else {
         if (!class_exists('\\CApi') || !\CApi::IsValid()) {
             echo 'AfterLogic API';
             return '';
         }
     }
     $sPathInfo = \trim(\trim($this->oHttp->GetServer('PATH_INFO', '')), ' /');
     if (!empty($sPathInfo)) {
         if ('dav' === \substr($sPathInfo, 0, 3)) {
             $this->oActions->PathInfoDav();
             return '';
         }
     }
     /* @var $oApiIntegrator \CApiIntegratorManager */
     $oApiIntegrator = \CApi::Manager('integrator');
     // ------ Redirect to HTTPS
     $oSettings =& \CApi::GetSettings();
     $bRedirectToHttps = $oSettings->GetConf('Common/RedirectToHttps');
     $bHttps = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== "off" || isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == "443";
     if ($bRedirectToHttps && !$bHttps) {
         header("Location: https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
     }
     // ------
     /* @var $oApiCapability \CApiCapabilityManager */
     $oApiCapability = \CApi::Manager('capability');
     $sResult = '';
     $sQuery = \trim(\trim($this->oHttp->GetServer('QUERY_STRING', '')), ' /');
     \CApi::Plugin()->RunQueryHandle($sQuery);
     $iPos = \strpos($sQuery, '&');
     if (0 < $iPos) {
         $sQuery = \substr($sQuery, 0, $iPos);
     }
     $aPaths = explode('/', $sQuery);
     if (0 < count($aPaths) && !empty($aPaths[0])) {
         $sFirstPart = strtolower($aPaths[0]);
         if ('ping' === $sFirstPart) {
             @header('Content-Type: text/plain; charset=utf-8');
             $sResult = 'Pong';
         } else {
             if ('pull' === $sFirstPart) {
                 if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
                     pclose(popen("start /B git pull", "r"));
                 } else {
                     exec("git pull > /dev/null 2>&1 &");
                 }
                 \CApi::Location('./');
             } else {
                 if ('ajax' === $sFirstPart) {
                     @ob_start();
                     $aResponseItem = null;
                     $sAction = $this->oHttp->GetPost('Action', null);
                     try {
                         \CApi::Log('AJAX: Action: ' . $sAction);
                         if ('SystemGetAppData' !== $sAction && \CApi::GetConf('labs.webmail.csrftoken-protection', true) && !$this->validateToken()) {
                             throw new \ProjectCore\Exceptions\ClientException(\ProjectCore\Notifications::InvalidToken);
                         } else {
                             if (!empty($sAction)) {
                                 $sMethodName = 'Ajax' . $sAction;
                                 $this->oActions->SetActionParams($this->oHttp->GetPostAsArray());
                                 if (method_exists($this->oActions, $sMethodName) && is_callable(array($this->oActions, $sMethodName))) {
                                     $aResponseItem = call_user_func(array($this->oActions, $sMethodName));
                                 }
                                 if (\CApi::Plugin()->JsonHookExists($sMethodName)) {
                                     $aResponseItem = \CApi::Plugin()->RunJsonHook($this->oActions, $sMethodName, $aResponseItem);
                                 }
                             }
                         }
                         if (!is_array($aResponseItem)) {
                             throw new \ProjectCore\Exceptions\ClientException(\ProjectCore\Notifications::UnknownError);
                         }
                     } catch (\Exception $oException) {
                         //if ($oException instanceof \ProjectCore\Exceptions\ClientException &&
                         //	\ProjectCore\Notifications::AuthError === $oException->getCode())
                         //{
                         //	$oApiIntegrator = /* @var $oApiIntegrator \CApiIntegratorManager */ \CApi::Manager('integrator');
                         //	$oApiIntegrator->setLastErrorCode(\ProjectCore\Notifications::AuthError);
                         //	$oApiIntegrator->logoutAccount();
                         //}
                         \CApi::LogException($oException);
                         $sAction = empty($sAction) ? 'Unknown' : $sAction;
                         $aAdditionalParams = null;
                         if ($oException instanceof \ProjectCore\Exceptions\ClientException) {
                             $aAdditionalParams = $oException->GetObjectParams();
                         }
                         $aResponseItem = $this->oActions->ExceptionResponse(null, $sAction, $oException, $aAdditionalParams);
                     }
                     @header('Content-Type: application/json; charset=utf-8');
                     \CApi::Plugin()->RunHook('ajax.response-result', array($sAction, &$aResponseItem));
                     $sResult = \MailSo\Base\Utils::Php2js($aResponseItem, \CApi::MailSoLogger());
                     //				\CApi::Log('AJAX: Response: '.$sResult);
//.........这里部分代码省略.........
开发者ID:zhuomingliang,项目名称:webmail-lite,代码行数:101,代码来源:Service.php

示例7: GetByType1

 /**
  * @param string $sManagerType
  * @param string $sForcedStorage = ''
  */
 public function GetByType1($sManagerType, $sForcedStorage = '')
 {
     $oResult = null;
     if (CApi::IsValid()) {
         if (empty($sForcedStorage)) {
             if (isset($this->aManagers[$sManagerType])) {
                 $oResult =& $this->aManagers[$sManagerType];
             } else {
                 $sManagerType = strtolower($sManagerType);
                 if (CApi::Inc('common.managers.' . $sManagerType . '.manager', false)) {
                     $sClassName = 'CApi' . ucfirst($sManagerType) . 'Manager';
                     $this->aManagers[$sManagerType] = new $sClassName($this);
                     $oResult =& $this->aManagers[$sManagerType];
                 }
             }
         } else {
             if (CApi::Inc('common.managers.' . $sManagerType . '.manager', false)) {
                 $sClassName = 'CApi' . ucfirst($sManagerType) . 'Manager';
                 $oResult = new $sClassName($this, $sForcedStorage);
             }
         }
     }
     return $oResult;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:28,代码来源:manager.php

示例8:

<?php

include_once '/var/www/html/libraries/afterlogic/api.php';
if (CApi::IsValid()) {
    $settings =& CApi::GetSettings();
    if ($settings) {
        $settings->SetConf('Common/DBHost', 'localhost');
        $settings->SetConf('Common/DBName', 'afterlogic');
        $settings->SetConf('Common/DBLogin', 'root');
        $settings->SetConf('Common/DBPassword', 'webbundle');
        CDbCreator::ClearStatic();
        CDbCreator::CreateConnector($settings);
        $oApiDbManager = CApi::Manager('db');
        $oApiDbManager->SyncTables();
        $settings->SaveToXml();
    }
}
开发者ID:afterlogic,项目名称:docker-webmail-lite,代码行数:17,代码来源:afterlogic.php

示例9: exit

<?php

/*
 * Copyright 2004-2015, AfterLogic Corp.
 * Licensed under AGPLv3 license or AfterLogic license
 * if commercial version of the product was purchased.
 * See the LICENSE file for a full license statement.
 */
// remove the following line for real use
exit('remove this line');
// Example of logging into WebMail account using email and password for incorporating into another web application
// utilizing API
include_once __DIR__ . '/../libraries/afterlogic/api.php';
if (class_exists('CApi') && CApi::IsValid()) {
    // data for logging into account
    $sEmail = 'user@domain.com';
    $sPassword = '12345';
    try {
        // Getting required API class
        $oApiIntegratorManager = CApi::Manager('integrator');
        // attempting to obtain object for account we're trying to log into
        $oAccount = $oApiIntegratorManager->loginToAccount($sEmail, $sPassword);
        if ($oAccount) {
            // populating session data from the account
            $oApiIntegratorManager->setAccountAsLoggedIn($oAccount);
            // redirecting to WebMail
            CApi::Location('../');
        } else {
            // login error
            echo $oApiIntegratorManager->GetLastErrorMessage();
        }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:31,代码来源:login-to-account.php

示例10: Handle

 /**
  * @return void
  */
 public function Handle()
 {
     $sVersion = file_get_contents(PSEVEN_APP_ROOT_PATH . 'VERSION');
     define('PSEVEN_APP_VERSION', $sVersion);
     if (!class_exists('MailSo\\Version')) {
         echo 'MailSo';
         return '';
     } else {
         if (!class_exists('\\CApi') || !\CApi::IsValid()) {
             echo 'AfterLogic API';
             return '';
         }
     }
     $sPathInfo = \trim(\trim($this->oHttp->GetServer('PATH_INFO', '')), ' /');
     if (!empty($sPathInfo)) {
         if ('dav' === \substr($sPathInfo, 0, 3)) {
             $this->oActions->PathInfoDav();
             return '';
         }
     }
     /* @var $oApiIntegrator \CApiIntegratorManager */
     $oApiIntegrator = \CApi::Manager('integrator');
     /* @var $oApiCapability \CApiCapabilityManager */
     $oApiCapability = \CApi::Manager('capability');
     $sResult = '';
     $sQuery = \trim(\trim($this->oHttp->GetServer('QUERY_STRING', '')), ' /');
     $iPos = \strpos($sQuery, '&');
     if (0 < $iPos) {
         $sQuery = \substr($sQuery, 0, $iPos);
     }
     $aPaths = explode('/', $sQuery);
     if (0 < count($aPaths) && !empty($aPaths[0])) {
         $sFirstPart = strtolower($aPaths[0]);
         if ('ping' === $sFirstPart) {
             @header('Content-Type: text/plain; charset=utf-8');
             $sResult = 'Pong';
         } else {
             if ('ajax' === $sFirstPart) {
                 @ob_start();
                 $aResponseItem = null;
                 $sAction = $this->oHttp->GetPost('Action', null);
                 try {
                     \CApi::Log('AJAX: Action: ' . $sAction);
                     if ('AppData' !== $sAction && \CApi::GetConf('labs.webmail.csrftoken-protection', true) && !$this->validateToken()) {
                         throw new \ProjectSeven\Exceptions\ClientException(\ProjectSeven\Notifications::InvalidToken);
                     } else {
                         if (!empty($sAction)) {
                             $sMethodName = 'Ajax' . $sAction;
                             if (method_exists($this->oActions, $sMethodName) && is_callable(array($this->oActions, $sMethodName))) {
                                 $this->oActions->SetActionParams($this->oHttp->GetPostAsArray());
                                 $aResponseItem = call_user_func(array($this->oActions, $sMethodName));
                             } else {
                                 if (\CApi::Plugin()->JsonHookExists($sMethodName)) {
                                     $this->oActions->SetActionParams($this->oHttp->GetPostAsArray());
                                     $aResponseItem = \CApi::Plugin()->RunJsonHook($this->oActions, $sMethodName);
                                 }
                             }
                         }
                     }
                     if (!is_array($aResponseItem)) {
                         throw new \ProjectSeven\Exceptions\ClientException(\ProjectSeven\Notifications::UnknownError);
                     }
                 } catch (\Exception $oException) {
                     //					if ($oException instanceof \ProjectSeven\Exceptions\ClientException &&
                     //						\ProjectSeven\Notifications::AuthError === $oException->getCode())
                     //					{
                     //						$oApiIntegrator = /* @var $oApiIntegrator \CApiIntegratorManager */ \CApi::Manager('integrator');
                     //						$oApiIntegrator->SetLastErrorCode(\ProjectSeven\Notifications::AuthError);
                     //						$oApiIntegrator->LogoutAccount();
                     //					}
                     \CApi::LogException($oException);
                     $sAction = empty($sAction) ? 'Unknown' : $sAction;
                     $aResponseItem = $this->oActions->ExceptionResponse(null, $sAction, $oException);
                 }
                 @header('Content-Type: application/json; charset=utf-8');
                 \CApi::Plugin()->RunHook('ajax.response-result', array($sAction, &$aResponseItem));
                 $sResult = \MailSo\Base\Utils::Php2js($aResponseItem, \CApi::MailSoLogger());
                 //				\CApi::Log('AJAX: Response: '.$sResult);
             } else {
                 if ('upload' === $sFirstPart) {
                     @ob_start();
                     $aResponseItem = null;
                     $sAction = empty($aPaths[1]) ? '' : $aPaths[1];
                     try {
                         $sMethodName = 'Upload' . $sAction;
                         if (method_exists($this->oActions, $sMethodName) && is_callable(array($this->oActions, $sMethodName))) {
                             $sError = '';
                             $sInputName = 'jua-uploader';
                             $iError = UPLOAD_ERR_OK;
                             $_FILES = isset($_FILES) ? $_FILES : null;
                             if (isset($_FILES, $_FILES[$sInputName], $_FILES[$sInputName]['name'], $_FILES[$sInputName]['tmp_name'], $_FILES[$sInputName]['size'], $_FILES[$sInputName]['type'])) {
                                 $iError = isset($_FILES[$sInputName]['error']) ? (int) $_FILES[$sInputName]['error'] : UPLOAD_ERR_OK;
                                 if (UPLOAD_ERR_OK === $iError) {
                                     $this->oActions->SetActionParams(array('AccountID' => $this->oHttp->GetPost('AccountID', ''), 'FileData' => $_FILES[$sInputName], 'AdditionalData' => $this->oHttp->GetPost('AdditionalData', null), 'IsExt' => '1' === (string) $this->oHttp->GetPost('IsExt', '0') ? '1' : '0', 'TenantHash' => (string) $this->oHttp->GetPost('TenantHash', ''), 'Token' => $this->oHttp->GetPost('Token', '')));
                                     \CApi::LogObject($this->oActions->GetActionParams());
                                     $aResponseItem = call_user_func(array($this->oActions, $sMethodName));
                                 } else {
//.........这里部分代码省略.........
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:101,代码来源:Service.php

示例11: parse_str

    parse_str($sContents, $aInputData);
} else {
    $aInputData = isset($_REQUEST) && is_array($_REQUEST) ? $_REQUEST : array();
}
//$sMethod = isset($aInputData['method']) ? $aInputData['method'] : '';
$sMethod = strlen($_SERVER['PATH_INFO']) > 0 ? $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['PATH_INFO'] : '';
$sToken = isset($aInputData['token']) ? $aInputData['token'] : '';
$aSecret = CApi::DecodeKeyValues($sToken);
$bMethod = in_array($sMethod, array('GET /token', 'POST /account', 'PUT /account/update', 'DELETE /account', 'PUT /account/enable', 'PUT /account/disable', 'PUT /account/password', 'GET /account/list', 'GET /account/exists', 'GET /account', 'POST /domain', 'PUT /domain/update', 'DELETE /domain', 'GET /domain/list', 'GET /domain/exists', 'GET /domain'));
$aResult = array('method' => $sMethod);
if (!CApi::GetConf('labs.rest', true)) {
    $aResult['message'] = 'rest api disabled';
    $aResult['errorCode'] = \ProjectSeven\Notifications::RestApiDisabled;
    $aResult['result'] = false;
} else {
    if (class_exists('CApi') && CApi::IsValid() && $bMethod) {
        /* @var $oApiDomainsManager CApiDomainsManager */
        $oApiDomainsManager = CApi::Manager('domains');
        /* @var $oApiTenantsManager CApiTenantsManager */
        $oApiTenantsManager = CApi::Manager('tenants');
        /* @var $oApiUsersManager CApiUsersManager */
        $oApiUsersManager = CApi::Manager('users');
        /* @var $oApiIntegratorManager CApiIntegratorManager */
        $oApiIntegratorManager = CApi::Manager('integrator');
        if ($sMethod === 'GET /token') {
            $oSettings = CApi::GetSettings();
            $sLogin = isset($aInputData['login']) ? $aInputData['login'] : '';
            $sPassword = isset($aInputData['password']) ? $aInputData['password'] : '';
            if (0 < strlen($sLogin) && 0 < strlen($sPassword) && $oApiTenantsManager && $oSettings) {
                $sSettingsLogin = $oSettings->GetConf('Common/AdminLogin');
                $sSettingsPassword = $oSettings->GetConf('Common/AdminPassword');
开发者ID:BertLasker,项目名称:Catch-design,代码行数:31,代码来源:rest.php

示例12: GetByType

 /**
  * @param string $sManagerType
  * @param string $sForcedStorage = ''
  */
 public function GetByType($sManagerType, $sForcedStorage = '')
 {
     $oResult = null;
     if (CApi::IsValid()) {
         $sManagerKey = empty($sForcedStorage) ? $sManagerType : $sManagerType . '/' . $sForcedStorage;
         if (isset($this->aManagers[$sManagerKey])) {
             $oResult =& $this->aManagers[$sManagerKey];
         } else {
             $sManagerType = strtolower($sManagerType);
             $sClassName = 'CApi' . ucfirst($sManagerType) . 'Manager';
             if (!class_exists($sClassName)) {
                 CApi::Inc('managers.' . $sManagerType . '.manager', false);
             }
             if (class_exists($sClassName)) {
                 $oMan = new $sClassName($this, $sForcedStorage);
                 $sCurrentStorageName = $oMan->GetStorageName();
                 $sManagerKey = empty($sCurrentStorageName) ? $sManagerType : $sManagerType . '/' . $sCurrentStorageName;
                 $this->aManagers[$sManagerKey] = $oMan;
                 $oResult =& $this->aManagers[$sManagerKey];
             }
         }
     }
     return $oResult;
 }
开发者ID:afterlogic,项目名称:aurora-core,代码行数:28,代码来源:manager.php


注:本文中的CApi::IsValid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。