phpBB in conjunction with CAS in the configuration of Linux when there are problems,

Source: Internet
Author: User
Tags cas apache tomcat
phpBB combined with CAs in the configuration of Linux when there are problems, urgent urgency.
A problem with CAs under Linux, after installing MySQL PHP apache Tomcat SSL Environment
The code that joins Casclient in phpBB is configured with the following
In function.php
PHP Code
  
   Add 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 Code
  Add the following function:function Login_cas ($username) {global $db; $sql = ' SELECT user_id, username, User_password, use R_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_a ctive, ' 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 Code
  
   ADD the following constant Value:define (' cas_enable ', true); Define (' cas_server_hostname ', ' localhost '); Define (' Cas_server_port ', 8443); Define (' Cas_server_app_name ', ' CAS ');

In the PHPBB3 forum, click Login to jump to the public login interface of CAS server, enter the user name password login
See the URL has appeared to get ticket, but the page shows an error as follows:
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 a your request again by clicking. If the problem persists, you could contact the administrator of this Site.phpcas ${phpcas.version} using Server Https://loca lhost:8443/cas/(CAS 2.0)

Completely confused about what went wrong. Forget the master to help me see where there is a problem. Thank you all, this question has been bothering me for n long.

------Solution--------------------
Top Up waiting
------Solution--------------------
Help Top. Learn.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.