本文整理汇总了PHP中CApi::Manager方法的典型用法代码示例。如果您正苦于以下问题:PHP CApi::Manager方法的具体用法?PHP CApi::Manager怎么用?PHP CApi::Manager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApi
的用法示例。
在下文中一共展示了CApi::Manager方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CommonSocial
public function CommonSocial(ap_Standard_Screen &$oScreen)
{
$oApiCapa = CApi::Manager('capability');
/* @var $oApiCapa CApiCapabilityManager */
if ($oApiCapa && !$this->oAdminPanel->IsOnlyReadAuthType()) {
$oTenant = $this->oModule->GetTenantAdminObject();
if ($oTenant) {
$aConnectors = array();
$oPlugin = \CApi::Plugin()->GetPluginByName('external-services');
if ($oPlugin) {
$aEnableConnectors = $oPlugin->GetEnabledConnectors();
$aSocials = $oTenant->getSocials();
foreach ($aSocials as $sKey => $oSocial) {
if (in_array($sKey, $aEnableConnectors)) {
$oSocial->SupportedScopes = $oPlugin->GetSupportedScopes($sKey);
$oSocial->TranslatedScopes = $oPlugin->GetTranslatedScopes($oSocial->SupportedScopes);
$oSocial->HasApiKey = $oPlugin->HasApiKey($sKey);
$aConnectors[$sKey] = $oSocial;
}
}
}
$oScreen->Data->SetValue('Socials', $aConnectors);
}
}
}
示例2: CommonSocial
public function CommonSocial()
{
$oApiCapa = CApi::Manager('capability');
/* @var $oApiCapa CApiCapabilityManager */
if ($oApiCapa) {
$oTenant = $this->oModule->GetTenantAdminObject();
if ($oTenant) {
$aSocials = $oTenant->GetDefaultSocials();
$aTenentSocials = array();
foreach ($aSocials as $sKey => $oSocial) {
$oTenentSocial = new CTenantSocials();
$oTenentSocial->IdTenant = $oTenant->IdTenant;
$oTenentSocial->SocialAllow = CPost::GetCheckBox($sKey . '_chSocialAllow');
$oTenentSocial->SocialName = ucfirst($sKey);
$oTenentSocial->SocialId = CPost::Get($sKey . '_txtSocialId');
$oTenentSocial->SocialSecret = CPost::Get($sKey . '_txtSocialSecret');
$oTenentSocial->SocialApiKey = CPost::Get($sKey . '_txtSocialApiKey');
$oTenentSocial->SocialScopes = CPost::Get($sKey . '_txtSocialScopes');
$aTenentSocials[$sKey] = $oTenentSocial;
}
$oTenant->SetSocials($aTenentSocials);
}
if ($oTenant && $this->oModule->UpdateTenantAdminObject($oTenant)) {
$this->LastMessage = AP_LANG_SAVESUCCESSFUL;
$this->LastError = '';
} else {
$this->LastMessage = '';
$this->LastError = AP_LANG_SAVEUNSUCCESSFUL;
}
}
}
示例3: BeforeValidateLicenseKey
/**
* @param CAccount $oAccount
*/
public function BeforeValidateLicenseKey()
{
$oLicensingApi = CApi::Manager('licensing');
if ($oLicensingApi && 0 === strlen($oLicensingApi->GetLicenseKey())) {
$oLicensingApi->UpdateLicenseKey($oLicensingApi->GetT());
}
}
示例4: CommonSocial
public function CommonSocial()
{
$oApiCapa = CApi::Manager('capability');
/* @var $oApiCapa CApiCapabilityManager */
if ($oApiCapa) {
$oTenant = $this->oModule->GetTenantAdminObject();
if ($oTenant) {
$oTenant->SocialFacebookAllow = CPost::Get('chSocialFacebookAllow');
$oTenant->SocialFacebookId = CPost::Get('txtSocialFacebookId');
$oTenant->SocialFacebookSecret = CPost::Get('txtSocialFacebookSecret');
$oTenant->SocialGoogleAllow = CPost::Get('chSocialGoogleAllow');
$oTenant->SocialGoogleId = CPost::Get('txtSocialGoogleId');
$oTenant->SocialGoogleSecret = CPost::Get('txtSocialGoogleSecret');
$oTenant->SocialGoogleApiKey = CPost::Get('txtSocialGoogleApiKey');
$oTenant->SocialTwitterAllow = CPost::Get('chSocialTwitterAllow');
$oTenant->SocialTwitterId = CPost::Get('txtSocialTwitterId');
$oTenant->SocialTwitterSecret = CPost::Get('txtSocialTwitterSecret');
$oTenant->SocialDropboxAllow = CPost::Get('chSocialDropboxAllow');
$oTenant->SocialDropboxKey = CPost::Get('txtSocialDropboxKey');
$oTenant->SocialDropboxSecret = CPost::Get('txtSocialDropboxSecret');
}
if ($oTenant && $this->oModule->UpdateTenantAdminObject($oTenant)) {
$this->LastMessage = AP_LANG_SAVESUCCESSFUL;
$this->LastError = '';
} else {
$this->LastMessage = '';
$this->LastError = AP_LANG_SAVEUNSUCCESSFUL;
}
}
}
示例5: 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;
}
示例6: getMinMan
public function getMinMan()
{
if ($this->oApiMin == null) {
$this->oApiMin = \CApi::Manager('min');
}
return $this->oApiMin;
}
示例7: ApiGContacts
/**
* @return \CApiGcontactsManager
*/
public function ApiGContacts()
{
if (null === $this->oApiGcontacts) {
$this->oApiGcontacts = \CApi::Manager('gcontacts');
}
return $this->oApiGcontacts;
}
示例8: GetTwofactorauthManager
protected function GetTwofactorauthManager()
{
if (null === $this->oApiTwofactorauth) {
$this->oApiTwofactorauth = \CApi::Manager('twofactorauth');
}
return $this->oApiTwofactorauth;
}
示例9: __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);
}
示例10: getUsersMan
public function getUsersMan()
{
if ($this->oApiUsers == null) {
$this->oApiUsers = \CApi::Manager('users');
}
return $this->oApiUsers;
}
示例11: getContactsManager
public function getContactsManager()
{
if (!isset($this->oApiContactsManager)) {
$this->oApiContactsManager = \CApi::Manager('contacts');
}
return $this->oApiContactsManager;
}
示例12: __construct
/**
* @param CAdminPanel $oAdminPanel
* @param string $sPath
* @return CCommonModule
*/
public function __construct(CAdminPanel &$oAdminPanel, $sPath)
{
parent::__construct($oAdminPanel, $sPath);
$this->oDomainsApi = CApi::Manager('domains');
$this->oUsersApi = CApi::Manager('users');
$this->oCapabilityApi = CApi::Manager('capability');
$this->oWebmailApi = CApi::Manager('webmail');
$this->oIntegratorApi = CApi::Manager('integrator');
$this->oTenantsApi = CApi::Manager('tenants');
if (\CApi::GetConf('labs.allow-social-integration', true)) {
$this->aTabs[] = AP_TAB_COMMON;
}
$this->aTabs[] = AP_TAB_DOMAINS;
$this->aTabs[] = AP_TAB_SYSTEM;
$this->aQueryActions[] = 'edit';
$this->aQueryActions[] = 'list';
$this->oPopulateData = new CCommonPopulateData($this);
$this->oStandardPostAction = new CCommonPostAction($this);
$this->oStandardPopAction = new CCommonPopAction($this);
$this->oTableAjaxAction = new CCommonAjaxAction($this);
$aTabs =& $oAdminPanel->GetTabs();
if (\CApi::GetConf('labs.allow-social-integration', true)) {
array_push($aTabs, array(CApi::I18N('ADMIN_PANEL/TABNAME_COMMON'), AP_TAB_COMMON));
}
array_push($aTabs, array(CApi::I18N('ADMIN_PANEL/TABNAME_DOMAINS'), AP_TAB_DOMAINS), array(CApi::I18N('ADMIN_PANEL/TABNAME_SYSTEM'), AP_TAB_SYSTEM));
}
示例13: _getApiTenantsManager
/**
* @return CApiTenantsManager|null
*/
private function _getApiTenantsManager()
{
if (null === $this->oApiTenantsManager) {
$this->oApiTenantsManager = CApi::Manager('tenants');
}
return $this->oApiTenantsManager;
}
示例14: SystemLogging
public function SystemLogging()
{
if (isset($_POST['btnClearLog']) || isset($_POST['btnUserActivityClearLog'])) {
/* @var $oApiLoggerManager CApiLoggerManager */
$oApiLoggerManager = CApi::Manager('logger');
$bResult = false;
if (isset($_POST['btnClearLog'])) {
$bResult = $oApiLoggerManager->DeleteCurrentLog();
} else {
$bResult = $oApiLoggerManager->DeleteCurrentUserActivityLog();
}
if ($bResult) {
$this->LastMessage = WM_INFO_LOGCLEARSUCCESSFUL;
} else {
$this->LastError = AP_LANG_ERROR;
}
} else {
if ($this->isStandartSubmit()) {
$this->oSettings->SetConf('Common/EnableLogging', CPost::GetCheckBox('ch_EnableDebugLogging'));
$this->oSettings->SetConf('Common/EnableEventLogging', CPost::GetCheckBox('ch_EnableUserActivityLogging'));
$this->oSettings->SetConf('Common/LoggingLevel', EnumConvert::FromPost(CPost::Get('selVerbosity', ''), 'ELogLevel'));
$this->checkBolleanWithMessage($this->oSettings->SaveToXml());
}
}
}
示例15: Import
/**
* @param int $iUserId
* @param string $sTempFileName
* @param int $iParsedCount
* @param int $iGroupId
* @param bool $bIsShared
* @return int
*/
public function Import($iUserId, $sTempFileName, &$iParsedCount, $iGroupId, $bIsShared)
{
$iCount = -1;
$iParsedCount = 0;
if (file_exists($sTempFileName)) {
$aCsv = api_Utils::CsvToArray($sTempFileName);
if (is_array($aCsv)) {
$oApiUsersManager = CApi::Manager('users');
$oAccount = $oApiUsersManager->GetDefaultAccount($iUserId);
$iCount = 0;
foreach ($aCsv as $aCsvItem) {
set_time_limit(30);
$this->oParser->Reset();
$oContact = new CContact();
$oContact->IdUser = $iUserId;
$this->oParser->SetContainer($aCsvItem);
$aParameters = $this->oParser->GetParameters();
foreach ($aParameters as $sPropertyName => $mValue) {
if ($oContact->IsProperty($sPropertyName)) {
$oContact->{$sPropertyName} = $mValue;
}
}
if (0 === strlen($oContact->FullName)) {
$oContact->FullName = trim($oContact->FirstName . ' ' . $oContact->LastName);
}
if (0 !== strlen($oContact->HomeEmail)) {
$oContact->PrimaryEmail = \EPrimaryEmailType::Home;
$oContact->ViewEmail = $oContact->HomeEmail;
} else {
if (0 !== strlen($oContact->BusinessEmail)) {
$oContact->PrimaryEmail = \EPrimaryEmailType::Business;
$oContact->ViewEmail = $oContact->BusinessEmail;
} else {
if (0 !== strlen($oContact->OtherEmail)) {
$oContact->PrimaryEmail = \EPrimaryEmailType::Other;
$oContact->ViewEmail = $oContact->OtherEmail;
}
}
}
if (strlen($oContact->BirthdayYear) === 2) {
$oDt = DateTime::createFromFormat('y', $oContact->BirthdayYear);
$oContact->BirthdayYear = $oDt->format('Y');
}
$iParsedCount++;
$oContact->__SKIP_VALIDATE__ = true;
if ($oAccount) {
$oContact->IdDomain = $oAccount->IdDomain;
$oContact->IdTenant = $oAccount->IdTenant;
}
$oContact->SharedToAll = $bIsShared;
$oContact->GroupsIds = array($iGroupId);
if ($this->oApiContactsManager->CreateContact($oContact)) {
$iCount++;
}
unset($oContact, $aParameters, $aCsvItem);
}
}
}
return $iCount;
}