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


PHP CApi::Inc方法代码示例

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


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

示例1: 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);
         }
     }
 }
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:29,代码来源:index.php

示例2: Ldap

 /**
  * @staticvar CLdapConnector|null $oLdap
  * @param CAccount $oAccount
  * @return CLdapConnector|bool
  */
 private function Ldap($oAccount)
 {
     //		if ($oAccount)
     //		{
     //			// TODO
     //			$aCustomFields = $oAccount->CustomFields;
     //			$aCustomFields['LdapPabUrl'] = 'ldap://192.168.0.197:389/ou=TestUser2,ou=PAB,dc=example,dc=com';
     //			$aCustomFields['LdapPabUrl'] = 'ldap://jes7dir.netvision.net.il:389/ou=24606995,ou=People,o=netvision.net.il,o=NVxSP,o=pab';
     //			$oAccount->CustomFields = $aCustomFields;
     //		}
     static $aLdap = array();
     if (!$oAccount || !isset($oAccount->CustomFields) || empty($oAccount->CustomFields['LdapPabUrl'])) {
         return false;
     }
     $sPabUrl = $oAccount->CustomFields['LdapPabUrl'];
     $aPabUrl = api_Utils::LdapUriParse($sPabUrl);
     if (isset($aLdap[$sPabUrl]) && $aLdap[$sPabUrl]) {
         return $aLdap[$sPabUrl];
     }
     if (!extension_loaded('ldap')) {
         CApi::Log('LDAP: Can\'t load LDAP extension.', ELogLevel::Error);
         return false;
     }
     if (!class_exists('CLdapConnector')) {
         CApi::Inc('common.ldap');
     }
     $oLdap = new CLdapConnector($aPabUrl['search_dn']);
     $oLdap = $oLdap->Connect((string) $aPabUrl['host'], (int) $aPabUrl['port'], (string) CApi::GetConf('contacts.ldap.bind-dn', ''), (string) CApi::GetConf('contacts.ldap.bind-password', '')) ? $oLdap : false;
     if ($oLdap) {
         if (!$oLdap->Search('(objectClass=*)')) {
             CApi::Log('LDAP: Init PabUrl Entry');
             $sNewDn = $oLdap->GetSearchDN();
             $aDnExplode = ldap_explode_dn($sNewDn, 1);
             $sOu = isset($aDnExplode[0]) ? trim($aDnExplode[0]) : '';
             $aPabUrlEntry = CApi::GetConf('contacts.ldap.pab-url-entry', array('objectClass' => array('top', 'organizationalUnit')));
             if (isset($aPabUrlEntry['objectClass'])) {
                 $aPabUrlEntry['ou'] = $sOu;
                 if (0 < strlen($sOu)) {
                     if (!$oLdap->Add('', $aPabUrlEntry)) {
                         $oLdap = false;
                     }
                 } else {
                     CApi::Log('LDAP: empty Ou in SearchDn = ' . $sNewDn);
                     $oLdap = false;
                 }
             } else {
                 CApi::Log('LDAP: pab-url-entry format error');
                 CApi::Log(print_r($aPabUrlEntry, true));
                 $oLdap = false;
             }
         }
     }
     $aLdap[$sPabUrl] = $oLdap;
     return $oLdap;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:60,代码来源:storage.php

示例3: CommandCreatorHelperFabric

 /**
  * @param int $iDbType = EDbType::MySQL
  * @return IDbHelper
  */
 public static function CommandCreatorHelperFabric($iDbType = EDbType::MySQL)
 {
     $oHelper = null;
     if (EDbType::PostgreSQL === $iDbType) {
         CApi::Inc('common.db.pdo.postgres_helper');
         $oHelper = new CPdoPostgresHelper();
     } else {
         CApi::Inc('common.db.pdo.mysql_helper');
         $oHelper = new CPdoMySqlHelper();
     }
     return $oHelper;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:16,代码来源:storage.php

示例4: __construct

 /**
  * @param CApiGlobalManager &$oManager
  */
 public function __construct(CApiGlobalManager &$oManager, $sForcedStorage = '')
 {
     parent::__construct('sieve', $oManager);
     CApi::Inc('common.net.protocols.sieve');
     $this->inc('classes.enum');
     $this->inc('classes.filter');
     $this->aSieves = array();
     $this->sGeneralPassword = '';
     $this->sSieveFileName = CApi::GetConf('sieve.config.file', 'sieve');
     $this->sSieveFolderCharset = CApi::GetConf('sieve.config.filters-folder-charset', 'utf-8');
     $this->bSectionsParsed = false;
     $this->aSectionsData = array();
     $this->aSectionsOrders = array('forward', 'autoresponder', 'filters');
 }
开发者ID:Git-Host,项目名称:email,代码行数:17,代码来源:manager.php

示例5: __construct

 /**
  * @param CApiGlobalManager &$oManager
  */
 public function __construct(CApiGlobalManager &$oManager)
 {
     parent::__construct('carddav', $oManager);
     CApi::Inc('common.dav.client');
     $this->Dav = null;
     $this->Settings = CApi::GetSettings();
     $this->Pdo = CApi::GetPDO();
     $this->User = null;
     $this->Account = null;
     $this->Connected = false;
     $this->aAddressBooksCache = array();
     $this->aGroupItemsCache = array();
     $this->ContactsCache = array();
     $this->GroupsCache = array();
     $this->DbPrefix = $this->Settings->GetConf('Common/DBPrefix');
     $this->ApiUsersManager = CApi::Manager('users');
     $this->ApiDavManager = CApi::Manager('dav');
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:21,代码来源:storage.php

示例6: prefix

<?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.
 */
CApi::Inc('common.db.table');
/**
 * @package Db
 * @subpackage Classes
 */
class CDbSchemaHelper
{
    /**
     * @staticvar string $sPrefix
     *
     * @return string
     */
    public static function prefix()
    {
        static $sPrefix = null;
        if (null === $sPrefix) {
            $oSettings = null;
            $oSettings =& CApi::GetSettings();
            $sPrefix = $oSettings->GetConf('Common/DBPrefix');
        }
        return $sPrefix;
    }
    /**
开发者ID:nsine,项目名称:webmail-lite,代码行数:31,代码来源:sql.php

示例7:

<?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.
 */
CApi::Inc('common.db.sql');
/**
 * @package Api
 * @subpackage Db
 */
class CDbPdoPostgres extends CDbSql
{
    /**
     * @var bool
     */
    protected $bUseExplain;
    /**
     * @var bool
     */
    protected $bUseExplainExtended;
    /**
     * @var PDO database object
     */
    protected $oPDO;
    /**
     * @var PDO resource
     */
    protected $rResultId;
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:31,代码来源:postgres.php

示例8: EscapeString

<?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.
 */
CApi::Inc('common.db.helper');
/**
 * @package Api
 * @subpackage Db
 */
class CPdoPostgresHelper implements IDbHelper
{
    /**
     * @param string $sValue
     * @param bool $bWithOutQuote = false
     * @param bool $bSearch = false
     * @return string
     */
    public function EscapeString($sValue, $bWithOutQuote = false, $bSearch = false)
    {
        $sResult = '';
        if ($bWithOutQuote) {
            $sResult = str_replace('\'', '\'\'', $sValue);
        } else {
            $sResult = 0 === strlen($sValue) ? '\'\'' : '\'' . str_replace('\'', '\'\'', $sValue) . '\'';
        }
        if ($bSearch) {
            $sResult = str_replace(array("%", "_"), array("\\%", "\\_"), $sResult);
开发者ID:BertLasker,项目名称:Catch-design,代码行数:31,代码来源:postgres_helper.php

示例9: EscapeString

 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 * 
 */
CApi::Inc('db.helper');
/**
 * @package Api
 * @subpackage Db
 */
class CPdoMySqlHelper implements IDbHelper
{
    /**
     * @param string $sValue
     * @param bool $bWithOutQuote = false
     * @param bool $bSearch = false
     * @return string
     */
    public function EscapeString($sValue, $bWithOutQuote = false, $bSearch = false)
    {
        $sResult = '';
开发者ID:afterlogic,项目名称:aurora-core,代码行数:31,代码来源:mysql_helper.php

示例10:

 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 * 
 */
CApi::Inc('db.sql');
/**
 * @package Api
 * @subpackage Db
 */
class CDbPdoPostgres extends CDbSql
{
    /**
     * @var bool
     */
    protected $bUseExplain;
    /**
     * @var bool
     */
    protected $bUseExplainExtended;
    /**
开发者ID:afterlogic,项目名称:aurora-core,代码行数:31,代码来源:postgres.php

示例11: class_exists

<?php

class_exists('CApi') or die;
CApi::Inc('common.plugins.change-password');
class CCustomChangePasswordPlugin extends AApiChangePasswordPlugin
{
    /**
     * @param CApiPluginManager $oPluginManager
     */
    public function __construct(CApiPluginManager $oPluginManager)
    {
        parent::__construct('1.0', $oPluginManager);
    }
    private function crypt_password($cleartext_password)
    {
        $salt = "\$1\$";
        $base64_alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
        for ($n = 0; $n < 8; $n++) {
            $salt .= $base64_alphabet[mt_rand(0, 63)];
        }
        $salt .= "\$";
        return crypt($cleartext_password, $salt);
    }
    /**
     * @param CAccount $oAccount
     * @return bool
     */
    public function validateIfAccountCanChangePassword($oAccount)
    {
        $bResult = false;
        if ($oAccount instanceof CAccount) {
开发者ID:afterlogic,项目名称:plugin-ispconfig-change-password,代码行数:31,代码来源:index.php

示例12: StorageInc

 /**
  * @return bool
  */
 public static function StorageInc($sManagerName, $sStorageName, $sFileName)
 {
     $sManagerName = preg_replace('/[^a-z]/', '', strtolower($sManagerName));
     $sStorageName = preg_replace('/[^a-z]/', '', strtolower($sStorageName));
     return CApi::Inc('Managers.' . $sManagerName . '.storages.' . $sStorageName . '.' . $sFileName);
 }
开发者ID:afterlogic,项目名称:aurora-core,代码行数:9,代码来源:api.php

示例13: __construct

 /**
  * @param CApiGlobalManager &$oManager
  */
 public function __construct(CApiGlobalManager &$oManager, $sForcedStorage = '')
 {
     parent::__construct('dav', $oManager);
     CApi::Inc('common.dav.client');
     $this->aDavClients = array();
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:9,代码来源:manager.php

示例14: prefix

 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 * 
 */
CApi::Inc('db.table');
/**
 * @package Db
 * @subpackage Classes
 */
class CDbSchemaHelper
{
    /**
     * @staticvar string $sPrefix
     *
     * @return string
     */
    public static function prefix()
    {
        static $sPrefix = null;
        if (null === $sPrefix) {
开发者ID:afterlogic,项目名称:aurora-core,代码行数:31,代码来源:sql.php

示例15: class_exists

<?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.
 */
class_exists('CApi') or die;
CApi::Inc('common.plugins.two-factor-auth');
include_once CApi::LibrariesPath() . 'PHPGangsta/GoogleAuthenticator.php';
class TwoFactorAuthenticationPlugin extends AApiTwoFactorAuthPlugin
{
    protected $logs = false;
    protected $discrepancy = 2;
    public static $setAccountIsLoggedIn = false;
    /**
     * @param string $sText
     */
    private function _writeLogs($sText)
    {
        if ($this->logs === true) {
            $this->Log($sText);
        }
    }
    /**
     * @param CApiPluginManager $oPluginManager
     */
    public function __construct(CApiPluginManager $oPluginManager)
    {
        parent::__construct('1.0', $oPluginManager);
开发者ID:nsine,项目名称:webmail-lite,代码行数:31,代码来源:index.php


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