您好,欢迎访问一九零五行业门户网

PHPBB结合CAS在linux下配置时候出现有关问题,

phpbb结合cas在linux下配置时候出现问题,急急急。。
在linux下结合cas时候出现问题,安装好mysql php apache tomcat ssl环境之后
按照在phpbb中加入casclient 的代码配置了下
in function.php
php codeadd require($phpbb_root_path . 'includes/cas.' . $phpex);find (isset($_post['login']))replace it with:if(!$admin && cas_enable){ // initialize phpcas phpcas::client(cas_version_2_0, cas_server_hostname, cas_server_port, cas_server_app_name); phpcas::setnocasservervalidation(); // force cas authentication phpcas::forceauthentication(); } if (isset($_post['login']) || (!$admin && cas_enable) )find $result = $auth->login($username, $password, $autologin, $viewonline, $admin);add the following code before it:if(!$admin && cas_enable){ $username = phpcas::getuser(); $password = ''; }
在in auth.php
php codeadd the following function:function login_cas($username){ global $db; $sql = 'select user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts from ' . users_table . where username_clean = ' . $username . '; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); if (!$row) { return array( 'status' => login_error_username, 'error_msg' => 'login_error_username', 'user_row' => array('user_id' => anonymous), ); } if ($row['user_type'] == user_inactive || $row['user_type'] == user_ignore) { return array( 'status' => login_error_active, 'error_msg' => 'active_error', 'user_row' => $row, ); } // successful login... set user_login_attempts to zero... return array( 'status' => login_success, 'error_msg' => false, 'user_row' => $row, ); }find $login = $method($username, $password);replace it with:if(!$admin && cas_enable) $login = $this->login_cas($username); else $login = $method($username, $password);
in constants.php
php codeadd the following constant value:define('cas_enable', true); define('cas_server_hostname', 'localhost'); define('cas_server_port', 8443); define('cas_server_app_name', 'cas');
在phpbb3论坛里面点击登录跳到cas server 的公共登录界面,输入用户名密码登录
看见url上已经出现获得了ticket,但是页面显示出错误如下:
php code[phpbb debug] php notice: in file /includes/cas/client.php on line 529: session_destroy() [function.session-destroy]: trying to destroy uninitialized sessioncas authentication failed!you were not authenticated.you may submit your request again by clicking here.if the problem persists, you may contact the administrator of this site.phpcas ${phpcas.version} using server https://localhost:8443/cas/ (cas 2.0)
完全弄不明白哪里出错了。忘高手帮我看看什么地方出现问题了。谢谢大家,这问题困扰我n久了。
------解决方案--------------------
顶起 等待
------解决方案--------------------
帮顶。学习。
其它类似信息

推荐信息