本文整理匯總了PHP中phpCAS::serviceWeb方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpCAS::serviceWeb方法的具體用法?PHP phpCAS::serviceWeb怎麽用?PHP phpCAS::serviceWeb使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phpCAS
的用法示例。
在下文中一共展示了phpCAS::serviceWeb方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getConnexionBar
function getConnexionBar()
{
if (CASUser::checkAuth()) {
$service = SITE_CAS_CONNEXIONBAR_URL;
phpCAS::serviceWeb($service, $err_code, $output);
$xml = simplexml_load_string($output);
$result = $xml->xpath('/reportoutput/reportdata');
return html_entity_decode($result[0]->asXML());
} else {
return "";
}
}
示例2: getConnexionBar
function getConnexionBar()
{
if (CASUser::checkAuth()) {
$service = SITE_CAS_CONNEXIONBAR_URL;
phpCAS::serviceWeb($service, $err_code, $output);
$xml = simplexml_load_string($output);
$result = $xml->xpath('/reportoutput/reportdata');
return str_replace("https://signin.mygcx.org/cas/logout", "https://intranet.campusforchrist.org/index.php?p_Mod=Logout", html_entity_decode($result[0]->asXML()));
} else {
return "";
}
}
示例3: example
<title>phpCAS proxied proxy example (with sessioning)</title>
<link rel="stylesheet" type='text/css' href='example.css'/>
</head>
<body>
<h1>phpCAS proxied proxy example (with sessioning)</h1>
<?php
include 'script_info.php';
?>
<p>the user's login is <b><?php
echo phpCAS::getUser();
?>
</b>.</p>
<h2>Response from service <?php
echo $serviceUrl;
?>
</h2>
<?php
flush();
// call a service and change the color depending on the result
if (phpCAS::serviceWeb($serviceUrl, $err_code, $output)) {
echo '<div class="success">';
} else {
echo '<div class="error">';
}
echo $output;
echo '</div>';
?>
</body>
</html>
示例4: array
$_SESSION['phpCAS']['service_cookies'] = array();
}
$sm = $_SESSION['ovd-client']['sessionmanager'];
foreach ($sm->get_cookies() as $k => $v) {
$cookie = array('domain' => parse_url($sm->get_base_url(), PHP_URL_HOST), 'path' => '/', 'secure' => false, 'name' => $k, 'value' => $v);
$_SESSION['phpCAS']['service_cookies'][] = $cookie;
}
}
$port = parse_url($CAS_server_url, PHP_URL_PORT);
if (is_null($port)) {
if (parse_url($CAS_server_url, PHP_URL_SCHEME) == 'https') {
$port = 443;
} else {
$port = 80;
}
}
$path = !parse_url($CAS_server_url, PHP_URL_PATH) ? '' : parse_url($CAS_server_url, PHP_URL_PATH);
phpCAS::proxy(CAS_VERSION_2_0, parse_url($CAS_server_url, PHP_URL_HOST), $port, $path, false);
phpCAS::setNoCasServerValidation();
phpCAS::setPGTStorageFile(CAS_PGT_STORAGE_FILE_FORMAT_PLAIN, session_save_path());
phpCAS::setFixedCallbackURL($CAS_callback_url);
//HTTPS required, and Apache's CRT must be added in Tomcat's keystore (CAS server)
phpCAS::forceAuthentication();
if (!phpCAS::serviceWeb($_SESSION['ovd-client']['sessionmanager_url'] . '/start', $errno, $output)) {
$_SESSION['ovd-client']['from_SM_start_XML'] = 'ERROR';
finish();
die;
}
$_SESSION['ovd-client']['from_SM_start_XML'] = $output;
finish();
die;