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


PHP phpCAS::isAuthenticated方法代码示例

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


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

示例1: logout

 public static function logout($parameters)
 {
     if (phpCAS::isAuthenticated()) {
         phpCAS::logoutWithRedirectService(OC::$server->getURLGenerator()->getAbsoluteURL(""));
     }
     return true;
 }
开发者ID:Karamaz0V1,项目名称:user_minimalcas,代码行数:7,代码来源:hooks.php

示例2: metodillo

 function metodillo()
 {
     $sSQL = "SELECT * FROM PM_PARAMETERS WHERE PRM_ID = 'CAS_URL' ";
     $aResSQL = executeQuery($sSQL);
     if (count($aResSQL)) {
         $sURL = $aResSQL[1]['PRM_VALUE'];
         $sURI = $aResSQL[1]['PRM_VALUE_2'];
         $res = false;
         $RBAC = RBAC::getSingleton();
         $RBAC->initRBAC();
         require_once 'CAS-1.2.2/CAS.php';
         phpCAS::client(CAS_VERSION_2_0, $sURL, 443, $sURI, false);
         phpCAS::setNoCasServerValidation();
         phpCAS::forceAuthentication();
         if (phpCAS::isAuthenticated() == true) {
             $sCasUser = phpCAS::getUser();
             $sSQL = "SELECT USR_UID FROM USERS WHERE USR_USERNAME = '{$sCasUser}' ";
             $aResSQL = executeQuery($sSQL);
             if (count($aResSQL)) {
                 $nUserId = $aResSQL[1]['USR_UID'];
                 $RBAC->singleSignOn = true;
                 $RBAC->userObj->fields['USR_UID'] = $nUserId;
                 $RBAC->userObj->fields['USR_USERNAME'] = $sCasUser;
                 $res = true;
             } else {
                 $res = false;
             }
         } else {
             $res = false;
         }
     } else {
         $res = false;
     }
     return $res;
 }
开发者ID:juantroche,项目名称:pmos-cas,代码行数:35,代码来源:class.cas2.php

示例3: getAttributes

 function getAttributes()
 {
     if (phpCAS::isAuthenticated()) {
         return phpCAS::getAttributes();
     }
     return null;
 }
开发者ID:hharchani,项目名称:felicity16-website,代码行数:7,代码来源:cas_lib.php

示例4: forceAuth

function forceAuth()
{
    if (!phpCAS::isAuthenticated()) {
        // If they're not currently logged in, take them to the RPI CAS page
        phpCAS::forceAuthentication();
    }
}
开发者ID:justetz,项目名称:SlateCrate,代码行数:7,代码来源:functions.php

示例5: get_login

 public function get_login()
 {
     Logger::debug('main', 'AuthMethod_CAS::get_login()');
     if (!isset($_SESSION['backup_sso']) || !is_array($_SESSION['backup_sso'])) {
         $_SESSION['backup_sso'] = array();
     }
     foreach ($_REQUEST as $k => $v) {
         $_SESSION['backup_sso'][$k] = $v;
     }
     $buf = $this->prefs->get('AuthMethod', 'CAS');
     $CAS_server_url = $buf['user_authenticate_cas_server_url'];
     if (!isset($CAS_server_url) || $CAS_server_url == '') {
         Logger::error('main', 'AuthMethod_CAS::get_login() - Unable to find CAS server url in Preferences');
         return NULL;
     }
     phpCAS::client(CAS_VERSION_2_0, parse_url($CAS_server_url, PHP_URL_HOST), parse_url($CAS_server_url, PHP_URL_PORT), parse_url($CAS_server_url, PHP_URL_PATH));
     Logger::debug('main', 'AuthMethod_CAS::get_login() - Parsing URL - Host:"' . parse_url($CAS_server_url, PHP_URL_HOST) . '" Port:"' . parse_url($CAS_server_url, PHP_URL_PORT) . '" Path:"' . parse_url($CAS_server_url, PHP_URL_PATH) . '"');
     phpCAS::setNoCasServerValidation();
     if (!phpCAS::forceAuthentication()) {
         Logger::error('main', 'AuthMethod_CAS::get_login() - phpCAS::forceAuthentication failed');
         return NULL;
     }
     if (!phpCAS::isAuthenticated()) {
         Logger::error('main', 'AuthMethod_CAS::get_login() - phpCAS::isAuthenticated failed');
         return NULL;
     }
     $this->login = phpCAS::getUser();
     foreach ($_SESSION['backup_sso'] as $k => $v) {
         if (isset($_REQUEST[$k])) {
             continue;
         }
         $_REQUEST[$k] = $v;
     }
     return $this->login;
 }
开发者ID:skdong,项目名称:nfs-ovd,代码行数:35,代码来源:CAS.php

示例6: getUser

 function getUser()
 {
     if (phpCAS::isAuthenticated()) {
         return phpCAS::getUser();
     }
     return null;
 }
开发者ID:rahulnht,项目名称:felicity16-website,代码行数:7,代码来源:cas_lib.php

示例7: checkAuthentication

 public function checkAuthentication()
 {
     if (phpCAS::isAuthenticated() && !AuthCookie::hasAuthCookie()) {
         $this->loginCallback();
     }
     // force CAS authentication
     phpCAS::forceAuthentication();
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:8,代码来源:class.cas_auth_backend.php

示例8: checkAuthentication

 public function checkAuthentication()
 {
     if (phpCAS::isAuthenticated() && !Auth::isValidCookie(Auth::getCookieInfo(APP_COOKIE))) {
         $this->loginCallback();
     }
     // force CAS authentication
     $auth = phpCAS::forceAuthentication();
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:8,代码来源:class.cas_auth_backend.php

示例9: collect

 /**
  * Collect any tokens that the user may have supplied. Reply NULL if none
  * are found.
  * 
  * @return mixed
  * @access public
  * @since 3/16/05
  */
 function collect()
 {
     if (phpCAS::isAuthenticated()) {
         return phpCAS::getUser();
     } else {
         return null;
     }
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:16,代码来源:CasTokenCollector.class.php

示例10: checkPassword

 public function checkPassword($uid, $password)
 {
     if (!phpCAS::isAuthenticated()) {
         return false;
     }
     $uid = phpCAS::getUser();
     return $uid;
 }
开发者ID:anolisti,项目名称:apps,代码行数:8,代码来源:user_cas.php

示例11: logout

 function logout($user)
 {
     $this->initializeCASClient();
     // Force CAS logout if required
     if (phpCAS::isAuthenticated()) {
         phpCAS::logout();
     }
     return parent::logout();
 }
开发者ID:asadaqain,项目名称:Guide-on-the-Side,代码行数:9,代码来源:CasAuthenticate.php

示例12: Login

 public function Login($username, $loginContext)
 {
     Log::Debug('Attempting CAS login for username: %s', $username);
     $isAuth = phpCAS::isAuthenticated();
     Log::Debug('CAS is auth ok: %s', $isAuth);
     $username = phpCAS::getUser();
     $this->Synchronize($username);
     return $this->authToDecorate->Login($username, $loginContext);
 }
开发者ID:hugutux,项目名称:booked,代码行数:9,代码来源:CAS.php

示例13: 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

示例14: isAuthenticated

 public static function isAuthenticated()
 {
     if (self::$_user) {
         return self::$_user;
     }
     self::init();
     if (true === ($result = phpCAS::isAuthenticated())) {
         $result = phpCAS::getUser();
     }
     session_write_close();
     return $result;
 }
开发者ID:JohnnyChenS,项目名称:mock-server,代码行数:12,代码来源:Phpcas.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::isAuthenticated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。