用cas实现mantis单点登录和登出.doc

  1. 1、本文档共3页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
用cas实现mantis单点登录和登出: 在论坛根目录下添加casphp目录,目录下包含cas的php客户端验证等相关文件; (内容见后面的附录) 2. 修改根目录下的login_page.php (备份修改前文件为login_page.php.bak): 27行开始(在require_once( core.php )前添加): require_once casphp/login_cas.php; $staffid = phpCAS::getUser(); //获取cas登录的用户名(工号) 44行开始(在$f_username = gpc_get_string( username, )后添加): if ($f_username == ){ $f_username = $staffid; } if( user_is_name_unique( $f_username ) ) { //如果用户不存在,则创建用户 user_create( $f_username,,$f_username.@ ) ; } 107行(在!-- Login Form BEGIN --前添加): div align=center style=display:none; !--隐藏页面内容 -- 260行(在!-- Autofocus JS --前添加): /div 265行(在// --/script前添加): window.document.login_form.submit();//自动提交登录FORM 3.取消密码校验,注释掉mantisbt/core/authentication_api.php文件中的以下内容: /*if( Y!=$f_discuzflag !auth_does_password_match( $t_user_id, $p_password ) ) { user_increment_failed_login_count( $t_user_id ); return false; }*/ 4.修改根目录下的logout_page.php (备份修改前文件为logout_page.php.bak): 23行开始(在require_once( core.php )前添加): require_once casphp/login_cas.php; 30行(在auth_logout()之后添加): phpCAS::logout(); 附:casphp目录: 该目录下的文件除了login_cas.php以后,其余都是来自phpCAS-1.3.0RC1包中,可以从 /cas-clients/php/中下载, Login_cas.php源码: ?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: logging.php 20592 2009-10-10 06:37:56Z monkey $ */ define(CAS_ENABLE, true); // Full Hostname of your CAS Server //$cas_host = 54; $cas_host = localhost; // Context of the CAS Server $cas_context = /cas; // Port of your CAS server. Normally for a https server its 443 $cas_port = 8443; // Path to the ca chain that issued the cas server certificate //$cas_server_ca_cert_path = /usr/local/share/ca-certificates/3some-cacert.crt; $cas_server_ca_cert_path = server.cer; /*The real hosts of clustered cas server that send SAML logout messages * Assumes the cas server is load balanced across multiple hosts */ $cas_real_hosts = array ( localhost ); /*$cas_real_hosts = array ( 54 );*/ // Load the CAS lib require_o

文档评论(0)

yuguanyin2015 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档