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


PHP phpCAS::isSessionAuthenticated方法代码示例

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


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

示例1: authCAS

function authCAS($config)
{
    require_once dirname(__FILE__) . '/CAS/CAS.php';
    // get module configuration
    $cas_validate = true;
    $cas_version = CAS_VERSION_2_0;
    $cas_language = 'english';
    //    phpCAS::setDebug();
    phpCAS::client($cas_version, $config->cashostname, (int) $config->casport, $config->casbaseuri, false);
    phpCAS::setLang($cas_language);
    error_log("CAS: Entering");
    $check = phpCAS::isSessionAuthenticated();
    phpCAS::forceAuthentication();
    $NetUsername = phpCAS::getUser();
    //this stores their network user id
    error_log("CAS: Exiting {$NetUsername}");
    return $NetUsername;
}
开发者ID:duanhv,项目名称:mdg-social,代码行数:18,代码来源:lib.php

示例2: RWSPLICas

function RWSPLICas($r_usrn, $r_pw, $r_csf)
{
    global $RWSESL3;
    global $RWSSRURL;
    global $RWSCRURL;
    global $RWSECMUL;
    if ($r_csf) {
        return;
    }
    $r_aus = get_enabled_auth_plugins();
    foreach ($r_aus as $r_aun) {
        $r_aup = get_auth_plugin($r_aun);
        if (strcasecmp($r_aup->authtype, RWSCAS) == 0) {
            $r_csp = $r_aup;
            break;
        }
    }
    if (!isset($r_csp)) {
        return;
    }
    if (empty($r_csp->config->hostname)) {
        return;
    }
    if ($r_csp->config->multiauth) {
        $r_auc = RWSGSOpt("authCAS", PARAM_ALPHANUMEXT);
        if ($r_auc === false || strlen($r_auc) == 0) {
            $r_auc = "CAS";
        }
        if (strcasecmp($r_auc, "CAS") != 0) {
            return;
        }
    }
    list($r_v1, $r_v2, $r_v3) = explode(".", phpCAS::getVersion());
    $r_csp->connectCAS();
    if (phpCAS::isSessionAuthenticated()) {
        return;
    }
    $r_rv = RWSGSOpt("version", PARAM_ALPHANUMEXT);
    if ($r_rv === false || strlen($r_rv) == 0) {
        unset($r_bv);
    } else {
        $r_bv = intval($r_rv);
    }
    if (strlen($RWSCRURL) > 0) {
        $r_svu = $RWSCRURL;
    } else {
        $r_svu = RWSGSUrl(false, false);
    }
    $r_svu .= "?rwscas=1";
    if (isset($r_bv)) {
        $r_svu .= "&version=";
        $r_svu .= urlencode($r_bv);
    }
    if ($RWSECMUL || $r_csp->config->multiauth) {
        if (isset($r_usrn)) {
            $r_svu .= "&rwsuser=";
            $r_svu .= urlencode($r_usrn);
        }
        if (isset($r_pw)) {
            $r_svu .= "&rwspass=";
            $r_svu .= urlencode($r_pw);
        }
    }
    phpCAS::setFixedServiceURL($r_svu);
    if ($r_csp->config->proxycas) {
        if (strlen($RWSCRURL) > 0) {
            $r_cbu = $RWSCRURL;
        } else {
            $r_cbu = RWSGSUrl(true, false);
        }
        $r_cbu .= "?rwscas=2";
        if (isset($r_bv)) {
            $r_cbu .= "&version=";
            $r_cbu .= urlencode($r_bv);
        }
        if ($RWSECMUL || $r_csp->config->multiauth) {
            if (isset($r_usrn)) {
                $r_cbu .= "&rwsuser=";
                $r_cbu .= urlencode($r_usrn);
            }
            if (isset($r_pw)) {
                $r_cbu .= "&rwspass=";
                $r_cbu .= urlencode($r_pw);
            }
        }
        phpCAS::setFixedCallbackURL($r_cbu);
    }
    $r_tpp = RWSGTPath();
    if ($r_tpp !== false) {
        $r_ckf = tempnam($r_tpp, "rws");
        if ($r_ckf !== false) {
            $_SESSION['rwscas']['cookiejar'] = $r_ckf;
        }
    }
    $r_liu = phpCAS::getServerLoginURL();
    $r_ch = curl_init();
    curl_setopt($r_ch, CURLOPT_URL, $r_liu);
    curl_setopt($r_ch, CURLOPT_HTTPGET, true);
    curl_setopt($r_ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($r_ch, CURLOPT_HEADER, true);
//.........这里部分代码省略.........
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:101,代码来源:servicelib.php

示例3: logout

 public function logout()
 {
     if (phpCAS::isSessionAuthenticated()) {
         if (isset($_SESSION['phpCAS'])) {
             $serialized = serialize($_SESSION['phpCAS']);
         }
         phpCAS::log('Logout requested, but no session data found for user:' . PHP_EOL . $serialized);
     }
     phpCAS::logout();
 }
开发者ID:nvanh1983,项目名称:zf1-cas-client,代码行数:10,代码来源:Cas.php

示例4: ob_start

 * Include the Entrada init code.
 */
require_once "init.inc.php";
ob_start("on_checkout");
$PROCEED_TO = isset($_GET["url"]) ? clean_input($_GET["url"], "trim") : (isset($_SERVER["REQUEST_URI"]) ? clean_input($_SERVER["REQUEST_URI"], "trim") : false);
$PATH_INFO = isset($_SERVER["PATH_INFO"]) ? clean_input($_SERVER["PATH_INFO"], array("url", "lowercase")) : "";
$PATH_SEPARATED = explode("/", $PATH_INFO);
/**
 * Process CAS authentication
 */
if (defined("AUTH_ALLOW_CAS") && AUTH_ALLOW_CAS == true) {
    if (!isset($_SESSION["isAuthorized"]) || !(bool) $_SESSION["isAuthorized"]) {
        if ($ACTION == "cas" || isset($_COOKIE[AUTH_CAS_COOKIE])) {
            phpCAS::forceAuthentication();
        }
        if (phpCAS::isSessionAuthenticated()) {
            if (isset($_SESSION[AUTH_CAS_SESSION][AUTH_CAS_ID])) {
                $result = cas_credentials($_SESSION[AUTH_CAS_SESSION][AUTH_CAS_ID]);
                if ($result) {
                    $CAS_AUTHENTICATED = true;
                    $username = $result["username"];
                    $password = $result["password"];
                    $ACTION = "login";
                }
            } else {
                phpCAS::logout(ENTRADA_URL . "?action=cas&state=failed");
            }
        }
        if ($ACTION == "cas" && isset($_GET["state"]) && $_GET["state"] == "failed") {
            add_error("Your login credentials are not recognized.<br /><br />Please contact a system administrator for further information.");
            $ACTION = "login";
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:index.php

示例5: isLoggedIn

 public static function isLoggedIn()
 {
     return class_exists("phpCAS") && phpCAS::isSessionAuthenticated();
 }
开发者ID:nerdydrew,项目名称:Poo-at-CWRU,代码行数:4,代码来源:helper.php


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