本文整理汇总了PHP中CApi::GetSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP CApi::GetSettings方法的具体用法?PHP CApi::GetSettings怎么用?PHP CApi::GetSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApi
的用法示例。
在下文中一共展示了CApi::GetSettings方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Sets up the backend.
*/
public function __construct()
{
$oPdo = \CApi::GetPDO();
$dbPrefix = \CApi::GetSettings()->GetConf('Common/DBPrefix');
$this->oApiUsersManager = \CApi::Manager('users');
parent::__construct($oPdo, $dbPrefix . Constants::T_PRINCIPALS, $dbPrefix . Constants::T_GROUPMEMBERS);
}
示例2: _generateEmailDict
/**
*
* @param type $oXmlDocument
* @param string $sPayloadId
* @param \CAccount $oAccount
* @param bool $bIsDemo Default false
*
* @return boolean
*/
private function _generateEmailDict($oXmlDocument, $sPayloadId, $oAccount, $bIsDemo = false)
{
$oSettings = CApi::GetSettings();
$sIncMailServer = $oAccount->IncomingMailServer;
$iIncMailPort = $oAccount->IncomingMailPort;
if ($sIncMailServer == 'localhost' || $sIncMailServer == '127.0.0.1') {
$sIncMailServer = $oSettings->GetConf('WebMail/ExternalHostNameOfLocalImap');
$aParsedUrl = parse_url($sIncMailServer);
if (isset($aParsedUrl['host'])) {
$sIncMailServer = $aParsedUrl['host'];
}
if (isset($aParsedUrl['port'])) {
$iIncMailPort = $aParsedUrl['port'];
}
}
$sOutMailServer = $oAccount->OutgoingMailServer;
$iOutMailPort = $oAccount->OutgoingMailPort;
if ($sOutMailServer == 'localhost' || $sOutMailServer == '127.0.0.1') {
$sOutMailServer = $oSettings->GetConf('WebMail/ExternalHostNameOfLocalSmtp');
$aParsedUrl = parse_url($sOutMailServer);
if (isset($aParsedUrl['host'])) {
$sOutMailServer = $aParsedUrl['host'];
}
if (isset($aParsedUrl['port'])) {
$iOutMailPort = $aParsedUrl['port'];
}
}
if (empty($sIncMailServer) || empty($sOutMailServer)) {
return false;
}
$aEmail = array('PayloadVersion' => 1, 'PayloadUUID' => \Sabre\DAV\UUIDUtil::getUUID(), 'PayloadType' => 'com.apple.mail.managed', 'PayloadIdentifier' => $sPayloadId . '.email', 'PayloadDisplayName' => 'Email Account', 'PayloadOrganization' => $oAccount->Domain->SiteName, 'PayloadDescription' => 'Configures email account', 'EmailAddress' => $oAccount->Email, 'EmailAccountType' => EMailProtocol::IMAP4 === $oAccount->IncomingMailProtocol ? 'EmailTypeIMAP' : 'EmailTypePOP', 'EmailAccountDescription' => $oAccount->Email, 'EmailAccountName' => 0 === strlen($oAccount->FriendlyName) ? $oAccount->Email : $oAccount->FriendlyName, 'IncomingMailServerHostName' => $sIncMailServer, 'IncomingMailServerPortNumber' => $iIncMailPort, 'IncomingMailServerUseSSL' => 993 === $iIncMailPort, 'IncomingMailServerUsername' => $oAccount->IncomingMailLogin, 'IncomingPassword' => $bIsDemo ? 'demo' : (CApi::GetConf('labs.ios-profile.include-password', true) ? $oAccount->IncomingMailPassword : ''), 'IncomingMailServerAuthentication' => 'EmailAuthPassword', 'OutgoingMailServerHostName' => $sOutMailServer, 'OutgoingMailServerPortNumber' => $iOutMailPort, 'OutgoingMailServerUseSSL' => 465 === $iIncMailPort, 'OutgoingMailServerUsername' => 0 === strlen($oAccount->OutgoingMailLogin) ? $oAccount->IncomingMailLogin : $oAccount->OutgoingMailLogin, 'OutgoingPassword' => $bIsDemo ? 'demo' : (CApi::GetConf('labs.ios-profile.include-password', true) ? 0 === strlen($oAccount->OutgoingMailPassword) ? $oAccount->IncomingMailPassword : $oAccount->OutgoingMailPassword : ''), 'OutgoingMailServerAuthentication' => ESMTPAuthType::NoAuth === $oAccount->OutgoingMailAuth ? 'EmailAuthNone' : 'EmailAuthPassword');
return $this->_generateDict($oXmlDocument, $aEmail);
}
示例3: __construct
public function __construct()
{
parent::__construct(get_class($this));
$this->SetTrimer(array('Name', 'Email', 'PasswordHash'));
$this->SetLower(array('Email'));
$oSettings =& CApi::GetSettings();
$this->SetDefaults(array(
'IdHelpdeskUser' => 0,
'IdSystemUser' => 0,
'IdTenant' => 0,
'Activated' => false,
'Blocked' => false,
'IsAgent' => false,
// 'IsSocial' => false,
'Name' => '',
'Email' => '',
'NotificationEmail' => '',
'SocialId' => '',
'SocialType' => '',
'ActivateHash' => md5(microtime(true).rand(1000, 9999)),
'Language' => $oSettings->GetConf('Common/DefaultLanguage'),
'DateFormat' => $oSettings->GetConf('Common/DefaultDateFormat'),
'TimeFormat' => $oSettings->GetConf('Common/DefaultTimeFormat'),
'NotificationPassword' => '',
'PasswordHash' => '',
'PasswordSalt' => md5(microtime(true).rand(10000, 99999)),
'MailNotifications' => false,
'Created' => time()
));
}
示例4: __construct
/**
* Creates the backend object.
*
* @return void
*/
public function __construct()
{
$dBPrefix = \CApi::GetSettings()->GetConf('Common/DBPrefix');
$this->pdo = \CApi::GetPDO();
$this->table = $dBPrefix . Constants::T_REMINDERS;
$this->calendarTbl = $dBPrefix . Constants::T_CALENDARS;
$this->principalsTbl = $dBPrefix . Constants::T_PRINCIPALS;
}
示例5: __construct
/**
* Constructor
*/
public function __construct() {
$oPdo = \CApi::GetPDO();
$dbPrefix = \CApi::GetSettings()->GetConf('Common/DBPrefix');
parent::__construct($oPdo, $dbPrefix.Constants::T_LOCKS);
}
示例6: __construct
/**
* Sets up the object
*/
public function __construct() {
$oPdo = \CApi::GetPDO();
$sDbPrefix = \CApi::GetSettings()->GetConf('Common/DBPrefix');
parent::__construct($oPdo, $sDbPrefix.Constants::T_ADDRESSBOOKS, $sDbPrefix.Constants::T_CARDS);
}
示例7: __construct
/**
* Sets up the object
*/
public function __construct()
{
parent::__construct(\CApi::GetPDO());
$sDbPrefix = \CApi::GetSettings()->GetConf('Common/DBPrefix');
$this->cardsTableName = $sDbPrefix . Constants::T_CARDS;
$this->addressBooksTableName = $sDbPrefix . Constants::T_ADDRESSBOOKS;
$this->addressBookChangesTableName = $sDbPrefix . Constants::T_ADDRESSBOOKCHANGES;
}
示例8: __construct
public function __construct($sLogin = '', $Description = '')
{
parent::__construct(get_class($this), 'IdTenant');
$this->__USE_TRIM_IN_STRINGS__ = true;
$oSettings =& CApi::GetSettings();
$this->SetDefaults(array('IdTenant' => 0, 'IdChannel' => 0, 'IsDisabled' => false, 'IsDefault' => false, 'Login' => $sLogin, 'Email' => '', 'PasswordHash' => '', 'Description' => $Description, 'IsEnableAdminPanelLogin' => false, 'QuotaInMB' => 0, 'AllocatedSpaceInMB' => 0, 'FilesUsageInBytes' => '0', 'FilesUsageInMB' => 0, 'FilesUsageDynamicQuotaInMB' => 0, 'UserCountLimit' => 0, 'DomainCountLimit' => 0, 'Capa' => (string) $oSettings->GetConf('Common/TenantGlobalCapa'), 'AllowChangeAdminEmail' => true, 'AllowChangeAdminPassword' => true, 'Expared' => 0, 'PayUrl' => '', 'IsTrial' => false, 'HelpdeskAdminEmailAccount' => '', 'HelpdeskClientIframeUrl' => '', 'HelpdeskAgentIframeUrl' => '', 'HelpdeskSiteName' => '', 'HelpdeskStyleAllow' => false, 'HelpdeskStyleImage' => '', 'HelpdeskStyleText' => '', 'LoginStyleImage' => '', 'AppStyleImage' => '', 'HelpdeskFacebookAllow' => !!$oSettings->GetConf('Helpdesk/FacebookAllow'), 'HelpdeskFacebookId' => (string) $oSettings->GetConf('Helpdesk/FacebookId'), 'HelpdeskFacebookSecret' => (string) $oSettings->GetConf('Helpdesk/FacebookSecret'), 'HelpdeskGoogleAllow' => !!$oSettings->GetConf('Helpdesk/GoogleAllow'), 'HelpdeskGoogleId' => (string) $oSettings->GetConf('Helpdesk/GoogleId'), 'HelpdeskGoogleSecret' => (string) $oSettings->GetConf('Helpdesk/GoogleSecret'), 'HelpdeskTwitterAllow' => !!$oSettings->GetConf('Helpdesk/TwitterAllow'), 'HelpdeskTwitterId' => (string) $oSettings->GetConf('Helpdesk/TwitterId'), 'HelpdeskTwitterSecret' => (string) $oSettings->GetConf('Helpdesk/TwitterSecret'), 'HelpdeskFetcherType' => EHelpdeskFetcherType::NONE, 'HelpdeskAllowFetcher' => false, 'HelpdeskFetcherTimer' => 0, 'SocialFacebookAllow' => !!$oSettings->GetConf('Social/FacebookAllow'), 'SocialFacebookId' => (string) $oSettings->GetConf('Social/FacebookId'), 'SocialFacebookSecret' => (string) $oSettings->GetConf('Social/FacebookSecret'), 'SocialGoogleAllow' => !!$oSettings->GetConf('Social/GoogleAllow'), 'SocialGoogleId' => (string) $oSettings->GetConf('Social/GoogleId'), 'SocialGoogleSecret' => (string) $oSettings->GetConf('Social/GoogleSecret'), 'SocialGoogleApiKey' => (string) $oSettings->GetConf('Social/GoogleApiKey'), 'SocialTwitterAllow' => !!$oSettings->GetConf('Social/TwitterAllow'), 'SocialTwitterId' => (string) $oSettings->GetConf('Social/TwitterId'), 'SocialTwitterSecret' => (string) $oSettings->GetConf('Social/TwitterSecret'), 'SocialDropboxAllow' => !!$oSettings->GetConf('Social/DropboxAllow'), 'SocialDropboxKey' => (string) $oSettings->GetConf('Social/DropboxKey'), 'SocialDropboxSecret' => (string) $oSettings->GetConf('Social/DropboxSecret'), 'SipAllow' => !!$oSettings->GetConf('Sip/AllowSip'), 'SipAllowConfiguration' => false, 'SipRealm' => (string) $oSettings->GetConf('Sip/Realm'), 'SipWebsocketProxyUrl' => (string) $oSettings->GetConf('Sip/WebsocketProxyUrl'), 'SipOutboundProxyUrl' => (string) $oSettings->GetConf('Sip/OutboundProxyUrl'), 'SipCallerID' => (string) $oSettings->GetConf('Sip/CallerID'), 'TwilioAllow' => !!$oSettings->GetConf('Twilio/AllowTwilio'), 'TwilioAllowConfiguration' => false, 'TwilioPhoneNumber' => (string) $oSettings->GetConf('Twilio/PhoneNumber'), 'TwilioAccountSID' => (string) $oSettings->GetConf('Twilio/AccountSID'), 'TwilioAuthToken' => (string) $oSettings->GetConf('Twilio/AuthToken'), 'TwilioAppSID' => (string) $oSettings->GetConf('Twilio/AppSID')));
$this->SetLower(array('Login', 'Email', 'HelpdeskAdminEmailAccount'));
$this->SetUpper(array('Capa'));
}
示例9: RedirectToHttps
public function RedirectToHttps()
{
$oSettings =& \CApi::GetSettings();
$bRedirectToHttps = $oSettings->GetConf('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']);
}
}
示例10: prefix
/**
* @staticvar string $sPrefix
*
* @return string
*/
public static function prefix()
{
static $sPrefix = null;
if (null === $sPrefix) {
$oSettings =& CApi::GetSettings();
$sPrefix = $oSettings->GetConf('DBPrefix');
}
return $sPrefix;
}
示例11: __construct
/**
* Creates the backend
*/
public function __construct()
{
$oPdo = \CApi::GetPDO();
$sDbPrefix = \CApi::GetSettings()->GetConf('Common/DBPrefix');
$this->dBPrefix = $sDbPrefix;
parent::__construct($oPdo, $sDbPrefix . Constants::T_CALENDARS, $sDbPrefix . Constants::T_CALENDAROBJECTS);
$this->calendarSharesTableName = $sDbPrefix . Constants::T_CALENDARSHARES;
$this->principalsTableName = $sDbPrefix . Constants::T_PRINCIPALS;
$this->notificationsTableName = $sDbPrefix . Constants::T_NOTIFICATIONS;
}
示例12: __construct
/**
* Creates the backend
*/
public function __construct()
{
parent::__construct(\CApi::GetPDO());
$this->dBPrefix = \CApi::GetSettings()->GetConf('Common/DBPrefix');
$this->calendarTableName = $this->dBPrefix . Constants::T_CALENDARS;
$this->calendarChangesTableName = $this->dBPrefix . Constants::T_CALENDARCHANGES;
$this->calendarObjectTableName = $this->dBPrefix . Constants::T_CALENDAROBJECTS;
$this->calendarSharesTableName = $this->dBPrefix . Constants::T_CALENDARSHARES;
$this->schedulingObjectTableName = $this->dBPrefix . Constants::T_SCHEDULINGOBJECTS;
$this->calendarSubscriptionsTableName = $this->dBPrefix . Constants::T_CALENDARSUBSCRIPTIONS;
}
示例13: __construct
public function __construct()
{
$oSettings =& CApi::GetSettings();
$this->aAccounts = array();
$this->aCalendars = array();
$this->sCurRunFilePath = CApi::DataPath() . '/reminder-run';
$this->sLang = $oSettings->GetConf('Common/DefaultLanguage');
$this->oApiUsersManager = CApi::Manager('users');
$this->oApiCalendarManager = CApi::Manager('calendar');
$this->oApiMailManager = CApi::Manager('mail');
}
示例14: __construct
/**
* @return void
*/
public function __construct(CDomain $oDomain)
{
parent::__construct(get_class($this), 'IdUser');
$oSettings =& CApi::GetSettings();
$iSaveMail = $oSettings->GetConf('WebMail/SaveMail');
$iSaveMail = ESaveMail::Always !== $iSaveMail ? $oSettings->GetConf('WebMail/SaveMail') : ESaveMail::DefaultOn;
$this->oSubCache = null;
$this->__USE_TRIM_IN_STRINGS__ = true;
$this->SetUpper(array('Capa'));
$this->SetDefaults(array('IdUser' => 0, 'IdSubscription' => 0, 'IdHelpdeskUser' => 0, 'MailsPerPage' => $oDomain->MailsPerPage, 'ContactsPerPage' => $oDomain->ContactsPerPage, 'AutoCheckMailInterval' => $oDomain->AutoCheckMailInterval, 'CreatedTime' => 0, 'LastLogin' => 0, 'LastLoginNow' => 0, 'LoginsCount' => 0, 'DefaultSkin' => $oDomain->DefaultSkin, 'DefaultLanguage' => $oDomain->DefaultLanguage, 'DefaultEditor' => EUserHtmlEditor::Html, 'SaveMail' => $iSaveMail, 'Layout' => $oDomain->Layout, 'DefaultTimeZone' => 0, 'DefaultTimeFormat' => $oDomain->DefaultTimeFormat, 'DefaultDateFormat' => $oDomain->DefaultDateFormat, 'DefaultIncomingCharset' => CApi::GetConf('webmail.default-inc-charset', 'iso-8859-1'), 'Question1' => '', 'Question2' => '', 'Answer1' => '', 'Answer2' => '', 'TwilioNumber' => '', 'TwilioEnable' => true, 'TwilioDefaultNumber' => false, 'SipEnable' => true, 'SipImpi' => '', 'SipPassword' => '', 'Capa' => '', 'ClientTimeZone' => '', 'UseThreads' => $oDomain->UseThreads, 'SaveRepliedMessagesToCurrentFolder' => false, 'DesktopNotifications' => false, 'AllowChangeInputDirection' => false, 'EnableOpenPgp' => false, 'AllowAutosaveInDrafts' => true, 'AutosignOutgoingEmails' => false, 'AllowHelpdeskNotifications' => false, 'CustomFields' => '', 'FilesEnable' => true));
CApi::Plugin()->RunHook('api-user-construct', array(&$this));
}
示例15: BeforeGetLicenseKey
/**
* @param CAccount $oAccount
*/
public function BeforeGetLicenseKey()
{
$oSettings =& CApi::GetSettings();
$sLicenseKey = $oSettings->GetConf('Common/LicenseKey');
if (empty($sLicenseKey)) {
$oLicensingApi = CApi::Manager('licensing');
if ($oLicensingApi) {
$oSettings->SetConf('Common/LicenseKey', $oLicensingApi->GetT());
$oSettings->SaveToXml();
}
}
}