PHPBB结合CAS在linux下配置时候出现有关问题,
PHPBB结合CAS在linux下配置时候出现问题,急急急。。
在linux下结合CAS时候出现问题,安装好mysql php apache tomcat ssl环境之后
按照在PHPBB中加入CASClient 的代码配置了下
in function.php
- PHP code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 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
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> Add 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 code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 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');
在phpBB3论坛里面点击登录跳到CAS server 的公共登录界面,输入用户名密码登录
看见url上已经出现获得了ticket,但是页面显示出错误如下:
- PHP code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> [phpBB Debug] PHP Notice: in file /includes/CAS/client.php on line 529: session_destroy() [function.session-destroy]: Trying to destroy uninitialized session CAS 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久了。
------解决方案--------------------
顶起 等待
------解决方案--------------------
帮顶。学习。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



WindowsServerBackup is a function that comes with the WindowsServer operating system, designed to help users protect important data and system configurations, and provide complete backup and recovery solutions for small, medium and enterprise-level enterprises. Only users running Server2022 and higher can use this feature. In this article, we will explain how to install, uninstall or reset WindowsServerBackup. How to Reset Windows Server Backup If you are experiencing problems with your server backup, the backup is taking too long, or you are unable to access stored files, then you may consider resetting your Windows Server backup settings. To reset Windows

On the occasion of releasing the build 26040 version of Windows Server, Microsoft announced the official name of the product: Windows Server 2025. Also launched is the Windows11WindowsInsiderCanaryChannel version build26040. Some friends may still remember that many years ago someone successfully converted Windows NT from workstation mode to server mode, showing the commonalities between various versions of Microsoft operating systems. Although there are clear differences between Microsoft's current version of the server operating system and Windows 11, those who pay attention to the details may be curious: why Windows Server updated the brand,

How to use Flask-Login to implement user login and session management Introduction: Flask-Login is a user authentication plug-in for the Flask framework, through which we can easily implement user login and session management functions. This article will introduce how to use Flask-Login for user login and session management, and provide corresponding code examples. 1. Preparation Before using Flask-Login, we need to install it in the Flask project. You can use pip with the following command

How to modify the default name of nginx, you can disguise it a little, or you can install Tip: Generally, modifications are made before nginx is compiled. After modification, the code needs to be recompiled as follows: scr/core/nginx.conf#definenginx_version"1.4.7"#definenginx_ver"nginx/"n

PHP security verification through CAS (CentralAuthenticationService) With the rapid development of the Internet, user rights management and identity verification are becoming more and more important. When developing web applications, it is crucial to protect user data and prevent unauthorized access. In order to achieve this goal, we can use CAS (CentralAuthenticationService) for PHP security verification. CAS

While Microsoft released the Win11 preview update for the desktop, today it also released the Windows Server Long Term Service Channel (LTSC) preview Build 25335. As usual, Microsoft did not publish a complete change log, or even provide a corresponding blog post. Microsoft has adjusted the Windows Server preview version update log to make it the same as the Canary channel version. If no new content is introduced, the official blog post will not be posted. Note from IT Home: The server brand has not been updated and is still Windows Server 2022 in the preview version. In addition, Microsoft calls these versions Windows Server vNext instead of the Windows version that is already on the market.

In Docker, the permission problem of the mounting directory can usually be solved by the following method: adding permission-related options when using the -v parameter to specify the mounting directory. You can specify the permissions of the mounted directory by adding: ro or :rw after the mounted directory, indicating read-only and read-write permissions respectively. For example: dockerrun-v/host/path:/container/path:roimage_name Define the USER directive in the Dockerfile to specify the user running in the container to ensure that operations inside the container comply with permission requirements. For example: FROMimage_name#CreateanewuserRUNuseradd-ms/bin/

1. Explain that when multiple threads perform CAS operations on a resource at the same time, only one thread succeeds, but it will not block other threads, and other threads will only receive a signal that the operation failed. It can be seen that CAS is actually an optimistic lock. 2. Following the AtomInteger code, we can find that sum.misc.Unsafe is finally called. Look at the name Unsafe, it's an unsafe class that exploits just the right holes in Java's class and visibility rules. For the sake of speed, Unsafe makes some compromises on Java's security standards. publicfinalnativebooleancompareAndSwapInt(Objec
