<?php
include_once('CAS.php');//
// phpCAS::setExtraCurlOption(CURLOPT_SSLVERSION,3);
phpCAS::setDebug();
phpCAS::client(CAS_VERSION_2_0,'cas域名',8443,'cas');
// no SSL validation for the CAS server
phpCAS::setNoCasServerValidation();
// force CAS authentication
phpCAS::forceAuthentication();
// at this step, the user has been authenticated by the CAS server
// and the user's login name can be read with phpCAS::getUser().
// logout if desired
if (isset($_REQUEST['logout'])) {
phpCAS::logout();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xm
<head>
<me
<li
<ti
</head>
<body>
<div id="panel">
<h3>会员面板</h3>
<div>
<h4>欢迎 橘汁 的到来</h4>
<ul class="quickli
<li>
<a href='#' target="_blank">我的邮箱</a>
</li>
<li>
<a href="#" target="_blank">管理我的空间</a>
</li>
<li>
<a href="#" target="_blank">站点管理平台</a>
</li>
<li>
<a href="#">安全退出</a>
</li>
<li>
<a href="#" target="_blank">站点首页</a>
</li>
<li>
<a href="#" target="_blank">交流论坛</a>
</li>
</ul>
<h1>Successfull Authentication!</h1>
<p>
the user's login is <b><?php echo phpCAS::getUser(); ?></b>
.
</p>
<p>
phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>
</p>
<p>
<a href="?logout=">Logout</a>
</p>
</div>
<div class="panelbot">
All Rights Reserved: ©2008
<a href="http://www.ojpal.com">
<span>橘汁仙剑网</span>
</a>
</div>
</div>
</body>
</html>
但是放入到thinkphp里就有问题了
我是放在index.php文件里:
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
if(version_compare(PHP_VERSION,'5.3.0','<')) die('require PHP > 5.3.0 !');
/**
* 系统调试设置
* 项目正式部署后请设置为false
*/
define('APP_DEBUG', true );
/**
* 应用目录设置
* 安全期间,建议安装调试完成后移动到非WEB目录
*/
define ( 'APP_PATH', './Application/' );
if(!is_file(APP_PATH . 'User/Conf/config.php')){
header('Location: ./install.php');
exit;
}
/**
* 缓存目录设置
* 此目录必须可写,建议移动到非WEB目录
*/
define ( 'RUNTIME_PATH', './Runtime/' );
include_once('CAS.php');//
// phpCAS::setExtraCurlOption(CURLOPT_SSLVERSION,3);
phpCAS::setDebug();
phpCAS::client(CAS_VERSION_2_0,'cas域名,8443,'cas');
// no SSL validation for the CAS server
phpCAS::setNoCasServerValidation();
// force CAS authentication
phpCAS::forceAuthentication();
// at this step, the user has been authenticated by the CAS server
// and the user's login name can be read with phpCAS::getUser().
// logout if desired
if (isset($_REQUEST['logout'])) {
phpCAS::logout();
}
/**
* 引入核心入口
* ThinkPHP亦可移动到WEB以外的目录
*/
require './ThinkPHP/ThinkPHP.php';
最佳答案