本文整理汇总了PHP中CApi::GetConf方法的典型用法代码示例。如果您正苦于以下问题:PHP CApi::GetConf方法的具体用法?PHP CApi::GetConf怎么用?PHP CApi::GetConf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApi
的用法示例。
在下文中一共展示了CApi::GetConf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ChangePasswordProcess
/**
* @param CAccount $oAccount
*/
public function ChangePasswordProcess($oAccount)
{
if (0 < strlen($oAccount->PreviousMailPassword) && $oAccount->PreviousMailPassword !== $oAccount->IncomingMailPassword) {
$cpanel_hostname = CApi::GetConf('plugins.cpanel-change-password.config.hostname', 'localhost');
$cpanel_username = CApi::GetConf('plugins.cpanel-change-password.config.username', 'local');
$cpanel_password = CApi::GetConf('plugins.cpanel-change-password.config.password', '');
$email_user = urlencode($oAccount->Email);
$email_password = urlencode($oAccount->IncomingMailPassword);
$email_domain = urlencode($oAccount->Domain->Name);
$query = "https://" . $cpanel_hostname . ":2083/execute/Email/passwd_pop?email=" . $email_user . "&password=" . $email_password . "&domain=" . $email_domain;
$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$header[0] = "Authorization: Basic " . base64_encode($cpanel_username . ":" . $cpanel_password) . "\n\r";
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_URL, $query);
$result = curl_exec($curl);
if ($result == false) {
CApi::Log("curl_exec threw error \"" . curl_error($curl) . "\" for {$query}");
curl_close($curl);
throw new CApiManagerException(Errs::UserManager_AccountNewPasswordUpdateError);
} else {
curl_close($curl);
$json_res = json_decode($result);
if (!$json_res->status) {
throw new CApiManagerException(Errs::UserManager_AccountNewPasswordUpdateError);
}
}
}
}
示例2: getChildren
/**
* Returns a list of calendars
*
* @return array
*/
public function getChildren()
{
$aCalendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']);
$aObjs = array();
foreach ($aCalendars as $aCalendarInfo) {
if ($this->caldavBackend instanceof \Sabre\CalDAV\Backend\SharingSupport) {
if (isset($aCalendarInfo['{http://calendarserver.org/ns/}shared-url'])) {
$aObjs[] = new SharedCalendar($this->caldavBackend, $aCalendarInfo, $this->principalInfo);
} else {
$aObjs[] = new ShareableCalendar($this->caldavBackend, $aCalendarInfo);
}
} else {
$aObjs[] = new Calendar($this->caldavBackend, $aCalendarInfo);
}
}
$aObjs[] = new \Sabre\CalDAV\Schedule\Outbox($this->principalInfo['uri']);
if ($this->caldavBackend instanceof \Sabre\CalDAV\Backend\SchedulingSupport) {
$aObjs[] = new \Sabre\CalDAV\Schedule\Inbox($this->caldavBackend, $this->principalInfo['uri']);
$aObjs[] = new \Sabre\CalDAV\Schedule\Outbox($this->principalInfo['uri']);
}
// If the backend supports subscriptions, we'll add those as well,
if ($this->caldavBackend instanceof \Sabre\CalDAV\Backend\SubscriptionSupport) {
foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) {
$aObjs[] = new \Sabre\CalDAV\Subscriptions\Subscription($this->caldavBackend, $subscription);
}
}
// We're adding a notifications node, if it's supported by the backend.
if ($this->caldavBackend instanceof \Sabre\CalDAV\Backend\NotificationSupport && \CApi::GetConf('labs.dav.caldav.notification', false)) {
$aObjs[] = new \Sabre\CalDAV\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']);
}
return $aObjs;
}
示例3: getInstance
public static function getInstance()
{
if (null === self::$instance) {
self::$instance = \CApi::GetConf('labs.dav.use-digest-auth', false) ? new Backend\Digest() : new Backend\Basic();
}
return self::$instance;
}
示例4: __construct
/**
* @param CAdminPanel $oAdminPanel
* @return ap_Login_Screen
*/
public function __construct(CAdminPanel &$oAdminPanel)
{
parent::__construct($oAdminPanel, 'login.php');
$sError = '';
if (isset($_GET['auth_error'])) {
$sError = AP_LANG_LOGIN_AUTH_ERROR;
} else {
if (isset($_GET['sess_error'])) {
$sError = AP_LANG_LOGIN_SESS_ERROR;
} else {
if (isset($_GET['access_error'])) {
$sError = AP_LANG_LOGIN_ACCESS_ERROR;
}
}
}
if (0 < strlen($sError)) {
$this->Data->SetValue('LoginErrorDesc', '<div class="wm_login_error"><div class="wm_login_error_icon"></div><div class="wm_login_error_message" id="login_error_message">' . $sError . '</div></div>');
}
$this->JsAddInitText('$(\'#loginId\').focus();');
$this->CssAddFile('static/styles/screens/login.css');
$this->Data->SetValue('AdminLogin', CApi::GetConf('demo.adminpanel.login', ''));
$this->Data->SetValue('AdminPassword', CApi::GetConf('demo.adminpanel.password', ''));
if (CApi::GetConf('demo.adminpanel.enable', false)) {
$this->Data->SetValue('LoginDemoFooter', '<div class="info" id="demo_info" dir="ltr">
<div class="demo_note">
This is a demo version of administrative interface. <br />For WebMail demo interface, click <a href="..">here</a>.
</div>
</div>');
}
}
示例5: __construct
public function __construct(CApiGlobalManager $oApiGlobalManager)
{
$this->_aHooks = array();
$this->_aServiceHooks = array();
$this->_aJsFiles = array();
$this->_aJsonHooks = array();
$this->_aCssFiles = array();
$this->_aPlugins = array();
$this->_aTemplates = array();
$this->_aAddTemplates = array();
$this->_mState = null;
$this->_oApiGlobalManager = $oApiGlobalManager;
$this->_oActions = null;
$this->bIsEnabled = (bool) CApi::GetConf('plugins', false);
if ($this->bIsEnabled) {
$sPluginsPath = CApi::DataPath() . '/plugins/';
if (@is_dir($sPluginsPath)) {
if (false !== ($rDirHandle = @opendir($sPluginsPath))) {
while (false !== ($sFile = @readdir($rDirHandle))) {
if (0 < strlen($sFile) && '.' !== $sFile[0] && preg_match('/^[a-z0-9\\-]+$/', $sFile) && (CApi::GetConf('plugins.config.include-all', false) || CApi::GetConf('plugins.' . $sFile, false)) && @file_exists($sPluginsPath . $sFile . '/index.php')) {
$oPlugin = (include $sPluginsPath . $sFile . '/index.php');
if ($oPlugin instanceof AApiPlugin) {
$oPlugin->SetName($sFile);
$oPlugin->SetPath($sPluginsPath . $sFile);
$oPlugin->Init();
// $oPlugin->Log('INIT > '.get_class($oPlugin));
$this->_aPlugins[] = $oPlugin;
}
}
}
@closedir($rDirHandle);
}
}
}
}
示例6: ChangePasswordProcess
/**
* @param CAccount $oAccount
*/
public function ChangePasswordProcess($oAccount)
{
if (0 < strlen($oAccount->PreviousMailPassword) && $oAccount->PreviousMailPassword !== $oAccount->IncomingMailPassword) {
if (null === $this->oPopPassD) {
CApi::Inc('common.net.protocols.poppassd');
$this->oPopPassD = new CApiPoppassdProtocol(CApi::GetConf('plugins.poppassd-change-password.config.host', '127.0.0.1'), CApi::GetConf('plugins.poppassd-change-password.config.port', 106));
}
if ($this->oPopPassD && $this->oPopPassD->Connect()) {
try {
// if ($this->oPopPassD->Login(api_Utils::GetAccountNameFromEmail($oAccount->IncomingMailLogin), $oAccount->PreviousMailPassword))
if ($this->oPopPassD->Login($oAccount->IncomingMailLogin, $oAccount->PreviousMailPassword)) {
if (!$this->oPopPassD->NewPass($oAccount->IncomingMailPassword)) {
throw new CApiManagerException(Errs::UserManager_AccountNewPasswordRejected);
}
} else {
throw new CApiManagerException(Errs::UserManager_AccountOldPasswordNotCorrect);
}
} catch (Exception $oException) {
$this->oPopPassD->Disconnect();
throw $oException;
}
} else {
throw new CApiManagerException(Errs::UserManager_AccountNewPasswordUpdateError);
}
}
}
示例7: __construct
public function __construct()
{
parent::__construct(get_class($this), 'IdContact');
$this->__USE_TRIM_IN_STRINGS__ = true;
$this->SetDefaults(array('IdContact' => '', 'IdContactStr' => '', 'IdUser' => 0, 'IdDomain' => 0, 'IdTenant' => 0, 'GroupsIds' => array(), 'Type' => EContactType::Personal, 'IdTypeLink' => '', 'FullName' => '', 'UseFriendlyName' => true, 'ViewEmail' => '', 'PrimaryEmail' => CApi::GetConf('contacts.default-primary-email', EPrimaryEmailType::Home), 'DateCreated' => time(), 'DateModified' => time(), 'Title' => '', 'FirstName' => '', 'LastName' => '', 'NickName' => '', 'Skype' => '', 'Facebook' => '', 'HomeEmail' => '', 'HomeStreet' => '', 'HomeCity' => '', 'HomeState' => '', 'HomeZip' => '', 'HomeCountry' => '', 'HomePhone' => '', 'HomeFax' => '', 'HomeMobile' => '', 'HomeWeb' => '', 'BusinessEmail' => '', 'BusinessCompany' => '', 'BusinessStreet' => '', 'BusinessCity' => '', 'BusinessState' => '', 'BusinessZip' => '', 'BusinessCountry' => '', 'BusinessJobTitle' => '', 'BusinessDepartment' => '', 'BusinessOffice' => '', 'BusinessPhone' => '', 'BusinessMobile' => '', 'BusinessFax' => '', 'BusinessWeb' => '', 'OtherEmail' => '', 'Notes' => '', 'BirthdayDay' => 0, 'BirthdayMonth' => 0, 'BirthdayYear' => 0, 'ReadOnly' => false, 'Global' => false, 'ItsMe' => false, 'ETag' => '', 'SharedToAll' => false, 'HideInGAB' => false));
$this->__LOCK_DATE_MODIFIED__ = false;
$this->__SKIP_VALIDATE__ = false;
CApi::Plugin()->RunHook('api-contact-construct', array(&$this));
}
示例8: Init
public function Init()
{
parent::Init();
$this->AddJsFile('js/iframeAppScreen.js');
$this->AddJsFile('js/include.js');
$this->AddTemplate('IframeAppScreen', 'templates/iframeAppScreen.html', 'Layout', 'Screens-Middle');
$this->AddJsonHook('AjaxAccountSettingsGet', 'AjaxAccountSettingsGet');
$this->mAllowOrigin = \CApi::GetConf('plugins.iframe-app.allow-origin', false);
}
示例9: __construct
/**
* @param CApiGlobalManager &$oManager
*/
public function __construct(CApiGlobalManager &$oManager, $sForcedStorage = '')
{
parent::__construct('logger', $oManager);
$sS = CApi::GetConf('log.custom-full-path', '');
$sPrePath = empty($sS) ? CApi::DataPath() . '/logs/' : rtrim(trim($sS), '\\/') . '/';
$this->sLogFileName = CApi::GetConf('log.log-file', 'log.txt');
$this->sLogFile = $sPrePath . $this->sLogFileName;
$this->sCurrentUserLogFileName = CApi::GetConf('log.event-file', 'event.txt');
$this->sCurrentUserLogFile = $sPrePath . $this->sCurrentUserLogFileName;
}
示例10: __construct
/**
* @param string $sHost
* @param int $iPort
* @param bool $bUseSsl = false
* @param int $iConnectTimeOut = null
* @param int $iSocketTimeOut = null
*/
public function __construct($sHost, $iPort, $bUseSsl = false, $iConnectTimeOut = null, $iSocketTimeOut = null)
{
$iConnectTimeOut = null === $iConnectTimeOut ? CApi::GetConf('socket.connect-timeout', 5) : $iConnectTimeOut;
$iSocketTimeOut = null === $iSocketTimeOut ? CApi::GetConf('socket.get-timeout', 5) : $iSocketTimeOut;
$this->sHost = $sHost;
$this->iPort = $iPort;
$this->bUseSsl = $bUseSsl;
$this->iConnectTimeOut = $iConnectTimeOut;
$this->iSocketTimeOut = $iSocketTimeOut;
}
示例11: __construct
/**
* @param string $sHost
* @param string $sUser
* @param string $sPassword
* @param string $sDbName
* @param string $sDbTablePrefix = ''
*/
public function __construct($sHost, $sUser, $sPassword, $sDbName, $sDbTablePrefix = '')
{
$this->sHost = trim($sHost);
$this->sUser = trim($sUser);
$this->sPassword = trim($sPassword);
$this->sDbName = trim($sDbName);
$this->sDbTablePrefix = trim($sDbTablePrefix);
$this->oPDO = null;
$this->rResultId = null;
$this->iExecuteCount = 0;
$this->bUseExplain = CApi::GetConf('labs.db.use-explain', false);
$this->bUseExplainExtended = CApi::GetConf('labs.db.use-explain-extended', false);
}
示例12: System
public function System()
{
$sType = isset($_GET['type']) ? $_GET['type'] : '';
$sAction = isset($_GET['action']) ? $_GET['action'] : '';
$iLimit = CApi::GetConf('log.max-view-size', 100) * 1024;
if ('log' === $sType && 'view' === $sAction || 'useractivity' === $sType && 'view' === $sAction) {
/* @var $oApiLoggerManager CApiLoggerManager */
$oApiLoggerManager = CApi::Manager('logger');
$iSize = 0;
$rLog = 'log' === $sType ? $oApiLoggerManager->GetCurrentLogStream($iSize) : $oApiLoggerManager->GetCurrentUserActivityLogStream($iSize);
@header('Content-type: text/plain; charset=utf-8');
if ($rLog && false !== $iSize) {
if (0 === $iSize) {
echo 'Log file empty';
} else {
if ($iLimit < $iSize) {
@fseek($rLog, $iSize - $iLimit);
}
@fpassthru($rLog);
}
} else {
echo 'Log file can\'t be read';
}
if ($rLog) {
@fclose($rLog);
}
} else {
if ('dllog' === $sType || 'dluseractivity' === $sType) {
/* @var $oApiLoggerManager CApiLoggerManager */
$oApiLoggerManager = CApi::Manager('logger');
$iSize = 0;
$rLog = 'dllog' === $sType ? $oApiLoggerManager->GetCurrentLogStream($iSize) : $oApiLoggerManager->GetCurrentUserActivityLogStream($iSize);
// IE
@header('Expires: 0', true);
@header('Cache-Control: must-revalidate, post-check=0, pre-check=0', true);
@header('Pragma: public', true);
$sName = 'dllog' === $sType ? $oApiLoggerManager->LogName() : $oApiLoggerManager->CurrentUserActivityLogName();
@header('Accept-Ranges: bytes', true);
@header('Content-Disposition: attachment; filename="' . urlencode($sName) . '"; charset=utf-8');
@header('Content-Transfer-Encoding: binary', true);
@header('Content-Length: ' . $iSize);
@header('Content-type: text/plain; charset=utf-8', true);
if ($rLog && false !== $iSize) {
@fpassthru($rLog);
}
if ($rLog) {
@fclose($rLog);
}
}
}
}
示例13: __construct
public function __construct()
{
$this->oSettings = null;
$this->oConnection = null;
$this->oSqlHelper = null;
$this->aManagers = array();
$this->aStorageMap = array('mailsuite' => 'db', 'min' => 'db', 'fetchers' => 'db', 'helpdesk' => 'db', 'subscriptions' => 'db', 'db' => 'db', 'domains' => 'db', 'tenants' => 'db', 'channels' => 'db', 'users' => 'db', 'webmail' => 'db', 'mail' => 'db', 'gcontacts' => 'db', 'contactsmain' => 'db', 'filecache' => 'file', 'calendar' => 'sabredav', 'filestorage' => 'sabredav', 'social' => 'db', 'twofactorauth' => 'db');
if (CApi::GetConf('gcontacts.ldap', false)) {
$this->aStorageMap['gcontacts'] = 'ldap';
}
if (CApi::GetConf('contacts.ldap', false)) {
$this->aStorageMap['contactsmain'] = 'ldap';
}
}
示例14: beforeMethod
/**
* This method is called before any HTTP method, but after authentication.
*
* @param string $sMethod
* @param string $path
* @throws \Sabre\DAV\Exception\NotAuthenticated
* @return bool
*/
public function beforeMethod($sMethod, $path)
{
$aHeaders = $this->server->httpRequest->getHeaders();
\CApi::Log($sMethod . ' ' . $path, \ELogLevel::Full, 'sabredav-');
\CApi::LogObject($aHeaders, \ELogLevel::Full, 'sabredav-');
$bLogBody = (bool) \CApi::GetConf('labs.dav.log-body', false);
if ($bLogBody) {
$body = $this->server->httpRequest->getBodyAsString();
$this->server->httpRequest->setBody($body);
\CApi::LogObject($body, \ELogLevel::Full, 'sabredav-');
}
\CApi::Log('', \ELogLevel::Full, 'sabredav-');
return;
}
示例15: __construct
public function __construct()
{
$this->oSettings = null;
$this->oConnection = null;
$this->oSqlHelper = null;
$this->aManagers = array();
$this->aStorageMap = array('db' => 'db', 'filecache' => 'file');
if (CApi::GetConf('gcontacts.ldap', false)) {
$this->aStorageMap['gcontacts'] = 'ldap';
}
if (CApi::GetConf('contacts.ldap', false)) {
$this->aStorageMap['contactsmain'] = 'ldap';
}
}