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


PHP phpCAS::setDebug方法代码示例

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


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

示例1: initialized_php_cas

 public static function initialized_php_cas()
 {
     if (!self::$_initialized_php_cas) {
         $casVersion = OCP\Config::getAppValue('user_cas', 'cas_server_version', '2.0');
         $casHostname = OCP\Config::getAppValue('user_cas', 'cas_server_hostname', $_SERVER['SERVER_NAME']);
         $casPort = OCP\Config::getAppValue('user_cas', 'cas_server_port', 443);
         $casPath = OCP\Config::getAppValue('user_cas', 'cas_server_path', '/cas');
         $casDebugFile = OCP\Config::getAppValue('user_cas', 'cas_debug_file', '');
         $casCertPath = OCP\Config::getAppValue('user_cas', 'cas_cert_path', '');
         $php_cas_path = OCP\Config::getAppValue('user_cas', 'cas_php_cas_path', 'CAS.php');
         if (!class_exists('phpCAS')) {
             if (empty($php_cas_path)) {
                 $php_cas_path = 'CAS.php';
             }
             OC_Log::write('cas', "Try to load phpCAS library ({$php_cas_path})", OC_Log::DEBUG);
             include_once $php_cas_path;
             if (!class_exists('phpCAS')) {
                 OC_Log::write('cas', 'Fail to load phpCAS library !', OC_Log::ERROR);
                 return false;
             }
         }
         if ($casDebugFile !== '') {
             phpCAS::setDebug($casDebugFile);
         }
         phpCAS::client($casVersion, $casHostname, (int) $casPort, $casPath, false);
         if (!empty($casCertPath)) {
             phpCAS::setCasServerCACert($casCertPath);
         } else {
             phpCAS::setNoCasServerValidation();
         }
         self::$_initialized_php_cas = true;
     }
     return self::$_initialized_php_cas;
 }
开发者ID:GIP-RECIA,项目名称:user_cas,代码行数:34,代码来源:user_cas.php

示例2: init

 /**
  * Initialize the class, this must be called before anything else
  * @param $config
  * @param bool $changeSessionID Allow phpCAS to change the session_id (Single Sign Out/handleLogoutRequests is based on that change)
  * @param $debugLog Set to a path to enable debug log
  */
 public static function init($config, $changeSessionID = true, $debugLog = null)
 {
     if ($debugLog != null) {
         phpCAS::setDebug($debugLog);
     }
     phpCAS::client(CAS_VERSION_2_0, $config['site'], $config['port'], "cas", $changeSessionID);
     self::$config = $config;
     $private_key = null;
     if (isset($config['private_key'])) {
         $key = static::resolve_filename($config['private_key']);
         $private_key = openssl_get_privatekey("file:///{$key}");
         if ($private_key === false) {
             throw new NXAuthError("Failed to open private key {$key}");
         }
     }
     if (isset($config['ca_cert']) && $config['ca_cert'] != null) {
         self::$ca_cert = static::resolve_filename($config['ca_cert']);
         phpCAS::setCasServerCACert(self::$ca_cert);
     } else {
         phpCAS::setNoCasServerValidation();
         // Disable curl ssl verification
         phpCAS::setExtraCurlOption(CURLOPT_SSL_VERIFYHOST, 0);
         phpCAS::setExtraCurlOption(CURLOPT_SSL_VERIFYPEER, 0);
     }
     NXAPI::init(array('private_key' => $private_key, 'key_id' => $config['key_id'], 'url' => "https://" . $config['site'], 'ca_cert' => self::$ca_cert));
 }
开发者ID:nitroxy,项目名称:nxauth,代码行数:32,代码来源:NXAuth.php

示例3: execute

 public function execute($filterChain)
 {
     $user = $this->getContext()->getUser();
     // We put an LDAP object in the context in order to reuse it later
     $this->getContext()->set('ldap', new uapvLdap());
     // Filters can be called several times (because of internal forwards)
     // Authentication is only done the first time
     if ($this->isFirstCall() && (sfConfig::get('app_cas_server_force_authentication', false) || !$user->isAuthenticated())) {
         // phpCAS is not php5-compliant, we remove php warnings and strict errors
         $errorReporting = ini_get('error_reporting');
         error_reporting($errorReporting & ~E_STRICT & ~E_NOTICE);
         if (sfConfig::get('app_cas_server_debug', false)) {
             phpCAS::setDebug();
         }
         // see /tmp/phpCAS.log
         phpCAS::client(sfConfig::get('app_cas_server_version', CAS_VERSION_2_0), sfConfig::get('app_cas_server_host', 'localhost'), sfConfig::get('app_cas_server_port', 443), sfConfig::get('app_cas_server_path', ''), false);
         // Don't call session_start again,
         // symfony already did it
         //phpCAS::handleLogoutRequests ();
         phpCAS::setNoCasServerValidation();
         phpCAS::forceAuthentication();
         // if necessary the user will be
         // redirected to the cas server
         // At this point the user is authenticated, we log him in
         $user->signIn(phpCAS::getUser());
         // Previous settings can now be restored
         error_reporting($errorReporting);
     }
     // "credential" verification
     parent::execute($filterChain);
 }
开发者ID:ArnaudD,项目名称:RdvZ,代码行数:31,代码来源:uapvSecurityFilterCas.class.php

示例4: init_cas_client

 private function init_cas_client()
 {
     if (class_exists('phpCAS')) {
         return true;
     }
     require getConfig('casldap_phpcas_path');
     $cas_debug_file = getConfig('cas_debug_file_path');
     if (!empty($cas_debug_file)) {
         phpCAS::setDebug($cas_debug_file);
     }
     $cas_host = getConfig('cas_host');
     $cas_port = getConfig('cas_port') or 443;
     $cas_context = getConfig('cas_context');
     switch (getConfig('cas_version')) {
         case 1:
             $cas_version = CAS_VERSION_1_0;
             break;
         case 2:
             $cas_version = CAS_VERSION_2_0;
             break;
         case 3:
             $cas_version = CAS_VERSION_3_0;
             break;
         default:
             $cas_version = CAS_VERSION_2_0;
             break;
     }
     phpCAS::client($cas_version, $cas_host, intval($cas_port), $cas_context);
     $cas_server_ca_cert_path = getConfig('cas_server_ca_cert_path');
     if ($cas_server_ca_cert_path) {
         phpCAS::setCasServerCACert($cas_server_ca_cert_path);
     } else {
         phpCAS::setNoCasServerValidation();
     }
 }
开发者ID:brenard,项目名称:phplist-casldap-plugin,代码行数:35,代码来源:CASLdapPlugin.php

示例5: main

 /**
  * [Put your description here]
  */
 function main($content, $conf)
 {
     $this->conf = $conf;
     $this->pi_setPiVarDefaults();
     $this->pi_USER_INT_obj = 1;
     // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
     $this->pi_loadLL();
     $this->typeExecution = "prod";
     $urlCas = "none";
     $portCas = "none";
     if ($this->typeExecution == "dev") {
         $urlCas = "xinf-devlinux.intranet.haras-nationaux.fr";
         $portCas = 7777;
     } else {
         if ($this->typeExecution == "prod") {
             $urlCas = "cerbere.haras-nationaux.fr";
             $portCas = 443;
         }
     }
     session_start();
     if (isset($_GET["action"]) && $_GET["action"] == "disconnect") {
         phpCAS::setDebug();
         phpCAS::client(CAS_VERSION_2_0, $urlCas, $portCas, 'cas', 'true');
         $ur = phpCAS::getServerLogoutURL();
         phpCAS::killSession();
         //Suppression de la sesssion de harasire
         setcookie("netid", "", time() - 3600, "/", ".haras-nationaux.fr");
         //$urCid = "http://www4.haras-nationaux.fr/cid-internet-web/InvalidateSessionServlet?service=".$ur;
         $content .= '<IFRAME src="' . $ur . '" frameborder="no" height="600" width="670"></IFRAME>';
         return $this->pi_wrapInBaseClass($content);
     }
 }
开发者ID:BackupTheBerlios,项目名称:stypo3dext,代码行数:35,代码来源:class.tx_dlcube04CAS_pi7.php

示例6: __construct

 public function __construct()
 {
     \phpCAS::setDebug();
     \phpCAS::client(CAS_VERSION_2_0, "itebeta.baidu.com", 443, "");
     \phpCAS::setNoCasServerValidation();
     \phpCAS::forceAuthentication();
     $this->username = \phpCAS::getUser();
 }
开发者ID:sayi21cn,项目名称:Atomu,代码行数:8,代码来源:Uuap.class.php

示例7: __construct

 public function __construct(array $options = array())
 {
     $this->options = $options;
     \phpCAS::getVersion();
     \phpCAS::setDebug('/tmp/cas-log.log');
     \phpCAS::setVerbose(true);
     $this->client = new \CAS_Client(SAML_VERSION_1_1, false, $this->options['webnet.sso_auth.client.option.cas_host.value'], $this->options['webnet.sso_auth.client.option.cas_port.value'], $this->options['webnet.sso_auth.client.option.cas_context.value']);
     $this->client->setNoCasServerValidation();
     $this->client->handleLogoutRequests(false, false);
 }
开发者ID:webnet-fr,项目名称:WebnetSsoAuthBundle,代码行数:10,代码来源:CasClient.php

示例8: initCasClient

 private function initCasClient()
 {
     if (!$this->_casInitialized) {
         require_once 'CAS.php';
         phpCAS::setDebug();
         phpCAS::client(CAS_VERSION_2_0, $this->getOption('cas_server_host', 'localhost'), (int) $this->getOption('cas_server_port', 443), $this->getOption('cas_server_path', ''), false);
         // Don't call session_start again
         $this->_casInitialized = true;
     }
 }
开发者ID:kvenkat971,项目名称:FileZ,代码行数:10,代码来源:Cas.php

示例9: check_auth

function check_auth()
{
    if (!isset($GLOBALS['PHPCAS_CLIENT'])) {
        phpCAS::client(CAS_VERSION_2_0, 'cas.byu.edu', 443, 'cas');
        //phpCAS::setCasServerCACert("../CAS/cas_ca.pem");
        phpCAS::setNoCasServerValidation();
        phpCAS::setDebug("cas_error.txt");
        phpCAS::handleLogoutRequests(true, array('cas.byu.edu', 'cas1.byu.edu', 'cas2.byu.edu', 'cas3.byu.edu'));
    }
    return phpCAS::isAuthenticated();
}
开发者ID:niclush2009,项目名称:DBLS,代码行数:11,代码来源:core_functions.php

示例10: assignConfiguration

 /**
  * Stores the configuration. Calls the parent configuration first,
  * then does additional operations.
  *
  * @param object Properties $configuration
  * @return object
  * @access public
  * @since 3/24/05
  */
 function assignConfiguration(Properties $configuration)
 {
     parent::assignConfiguration($configuration);
     $format = $configuration->getProperty('DISPLAY_NAME_FORMAT');
     ArgumentValidator::validate($format, RegexValidatorRule::getRule('/\\[\\[([^]]+)\\]\\]/'));
     $this->displayNameFormat = $format;
     if ($debug = $configuration->getProperty('CAS_DEBUG_PATH')) {
         ArgumentValidator::validate($debug, StringValidatorRule::getRule());
         phpCAS::setDebug($debug);
     }
     $host = $configuration->getProperty('CAS_HOST');
     ArgumentValidator::validate($host, RegexValidatorRule::getRule('/^[a-z0-9]+\\.[a-z0-9]+.[a-z]+$/'));
     $port = $configuration->getProperty('CAS_PORT');
     ArgumentValidator::validate($port, RegexValidatorRule::getRule('/^[0-9]+$/'));
     $path = $configuration->getProperty('CAS_PATH');
     ArgumentValidator::validate($path, RegexValidatorRule::getRule('/^\\/.*$/'));
     phpCAS::client(CAS_VERSION_2_0, $host, intval($port), $path, false);
     if ($cert = $configuration->getProperty('CAS_CERT')) {
         phpCAS::setCasServerCACert($cert);
     } else {
         phpCAS::setNoCasServerValidation();
     }
     // Allow group lookup via a CASDirectory:
     // https://mediawiki.middlebury.edu/wiki/LIS/CAS_Directory
     $dirUrl = $configuration->getProperty('CASDIRECTORY_BASE_URL');
     ArgumentValidator::validate($dirUrl, StringValidatorRule::getRule());
     $this->directoryUrl = $dirUrl;
     // set the callback URL for the PGT to be sent to. This must be an https url
     // whose certificate is trusted by CAS.
     // 		$callbackUrl = $configuration->getProperty('CALLBACK_URL');
     // 		ArgumentValidator::validate($callbackUrl, RegexValidatorRule::getRule('/^https:\/\/.*$/'));
     // 		phpCAS::setFixedCallbackURL($callbackUrl);
     $adminAccess = $configuration->getProperty('CASDIRECTORY_ADMIN_ACCESS');
     ArgumentValidator::validate($adminAccess, StringValidatorRule::getRule());
     $this->adminAccess = $adminAccess;
     $classRoot = $configuration->getProperty('CASDIRECTORY_CLASS_ROOT');
     if ($classRoot) {
         ArgumentValidator::validate($classRoot, StringValidatorRule::getRule());
         $this->classRoot = $classRoot;
     } else {
         $this->classRoot = null;
     }
     $groupIdRegex = $configuration->getProperty('CASDIRECTORY_GROUP_ID_REGEX');
     if ($groupIdRegex) {
         ArgumentValidator::validate($groupIdRegex, StringValidatorRule::getRule());
         $this->groupIdRegex = $groupIdRegex;
     } else {
         $this->groupIdRegex = null;
     }
     // Root Groups to expose
     ArgumentValidator::validate($configuration->getProperty('ROOT_GROUPS'), ArrayValidatorRuleWithRule::getRule(StringValidatorRule::getRule()));
     $this->rootGroups = array_unique($configuration->getProperty('ROOT_GROUPS'));
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:62,代码来源:CASAuthNMethod.class.php

示例11: init

 public static function init()
 {
     if (self::$_init) {
         return true;
     }
     $config = new \Yaf\Config\Ini(APPLICATION_CONFIG_PATH . '/phpcas.ini', \Yaf\ENVIRON);
     phpCAS::setDebug('');
     phpCAS::client($config->cas_version, $config->cas_host, intval($config->cas_port), $config->cas_context);
     phpCAS::setNoCasServerValidation();
     phpCAS::handleLogoutRequests(false);
     self::$_init = true;
     return true;
 }
开发者ID:JohnnyChenS,项目名称:mock-server,代码行数:13,代码来源:Phpcas.php

示例12: initializeCASClient

 protected function initializeCASClient()
 {
     if (!phpCAS::isInitialized()) {
         // Set debug mode
         phpCAS::setDebug(false);
         //Initialize phpCAS
         phpCAS::client(CAS_VERSION_2_0, Configure::read('user_config.cas.hostname'), Configure::read('user_config.cas.port'), Configure::read('user_config.cas.uri'), true);
         phpCAS::setFixedServiceURL($this->loginRedirectURL());
         // No SSL validation for the CAS server
         phpCAS::setNoCasServerValidation();
     }
     return true;
 }
开发者ID:asadaqain,项目名称:Guide-on-the-Side,代码行数:13,代码来源:CasAuthenticate.php

示例13: setCASSettings

 private function setCASSettings()
 {
     if ($this->options->IsCasDebugOn()) {
         phpCAS::setDebug($this->options->DebugFile());
     }
     phpCAS::client($this->options->CasVersion(), $this->options->HostName(), $this->options->Port(), $this->options->ServerUri(), $this->options->ChangeSessionId());
     if ($this->options->CasHandlesLogouts()) {
         phpCAS::handleLogoutRequests(true, $this->options->LogoutServers());
     }
     if ($this->options->HasCertificate()) {
         phpCAS::setCasServerCACert($this->options->Certificate());
     }
     phpCAS::setNoCasServerValidation();
 }
开发者ID:hugutux,项目名称:booked,代码行数:14,代码来源:CAS.php

示例14: __construct

 function __construct($collection, $settings)
 {
     $this->_Collection = $collection;
     if (Configure::read('CAS.debug_log_enabled')) {
         phpCAS::setDebug(TMP . 'phpCas.log.txt');
     }
     phpCAS::client(CAS_VERSION_2_0, Configure::read('CAS.hostname'), Configure::read('CAS.port'), Configure::read('CAS.uri'));
     $certServer = Configure::read('CAS.cert_path');
     if (empty($certServer)) {
         phpCAS::setNoCasServerValidation();
     } else {
         phpCAS::setCasServerCACert($certServer);
     }
 }
开发者ID:byu-oit-appdev,项目名称:eamWS,代码行数:14,代码来源:CasAuthenticate.php

示例15: logout

 /** 
  * Logout execution method.  Initializes CAS client and force logout if required before returning to parent logout method.
  * 
  * @param mixed $url Optional URL to redirect the user to after logout 
  * @return string AuthComponent::$loginAction 
  * @see AuthComponent::$loginAction 
  * @access public 
  */
 function logout()
 {
     // Set debug mode
     phpCAS::setDebug(false);
     //Initialize phpCAS
     phpCAS::client(CAS_VERSION_2_0, Configure::read('CAS.hostname'), Configure::read('CAS.port'), Configure::read('CAS.uri'), true);
     // No SSL validation for the CAS server
     phpCAS::setNoCasServerValidation();
     // Force CAS logout if required
     if (phpCAS::isAuthenticated()) {
         phpCAS::logout(array('url' => 'http://www.cakephp.org'));
         // Provide login url for your application
     }
     return parent::logout();
 }
开发者ID:rajankz,项目名称:webspace,代码行数:23,代码来源:CasAuthComponent+copy.php


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