phpcms2008整合discuz1.5+ucenter1.5
?
1.??? 软件版本
1.??? phpcms : phpcms2008sp4_utf8_110406.zip
2.??? discuz : Discuz_X1.5_SC_UTF8.zip
3.??? ucenter : Ucenter_1.5.2_SC_UTF8.z
2.??? 安装
1.??? phpcms2008的安装
1.??? 根据源码的说明修改相应文件的访问权限
2.??? 创建数据库phpcms
3.??? phpcms 选择必要的模块:财务,广告管理,评论管理,友情链接,短消息,网站公告,全站搜索,专题,错误报告,表单向导,采集管理,视频。
4.??? 配置数据库信息
5.??? 设定管理员和密码(最好与discuz,ucenter的管理员账户设置成相同的。)
2.??? ucenter的安装
1.??? 根据源码的说明修改相应文件的访问权限
2.??? 创建数据库ucenter
3.??? 配置数据库信息
4.??? 设定管理员和密码(最好与discuz,phpcms的管理员账户设置成相同的。)
3.??? discuz的安装
1.??? 根据源码的说明修改相应文件的访问权限
2.??? 创建数据库discuz
3.??? 单独安装discuz指定ucenter,填写ucenter相应的信息
4.??? 配置数据库信息
5.??? 设定管理员和密码(最好与ucenter,phpcms的管理员账户设置成相同的。)
3.??? 整合
1.??? phpcms配置
1.??? 我的面板-》常用操作-》网站配置-》基本信息
1.??? Phpcms 官方网站帐号:phpcms
2.??? Phpcms 官方网站密码:phpcms
2.??? 我的面板-》常用操作-》网站配置-》通行证
1.??? 正向通行证设置,反向通行证设置 选择否不用设置
2.??? Ucenter Client 配置是要配置的;
1.??? 启用选择是
2.??? ucenter api地址:ucenter的根目录地址
3.??? ip地址:本地:127.0.0.1,如果不是本地填写相应的ip地址
4.??? 填写ucenter数据库相应的信息
5.??? 应用id:2 (稍后在ucenter中设置phpcms时将产生phpcms的应用id,要和这里的一致)
6.??? ucenter通信密钥:phpcms(要和ucenter配置phpcms应用时的密钥要一致)
7.??? 测试数据库链接是否成功
8.??? 提交,成功。
2.??? Ucenter配置
1.??? 应用管理
1.??? 查看discuz!的通信情况,通信成功
2.??? -》添加新应用-》自定义安装
1.??? 应用名称:phpcms
2.??? 应用的主url:phpcms.wolf.com (phpcms2008网站的url)
3.??? 应用ip 本地:127.0.0.1 如果不本地的填写相应的ip地址
4.??? 通信密钥:phpcms(和phpcms配置时的ucenter通信密钥要一致)
5.??? 应用类型:其他
6.??? 是否开启同步登录:是
7.??? 是否接受通知:是
8.??? 其他项目保留默认值
9.??? 提交,并查看时候提交成功,在列表中查看时候通信成功。
?
?
3.??? Discuz配置
1.??? 站长-》ucenter配置:将ucenter连接方式改为接口方式,其他保留原来的数据。
?
?
4.??? 代码修改解决用户同步免激活
1.??? discuz代码修改:/api/uc.php : 168 synlogin 函数修改为一下代码:
function synlogin($get, $post) {
?
?? global $_G;
?
?? if(!API_SYNLOGIN) {
?
??? return API_RETURN_FORBIDDEN;
?
?? }
?
?? header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
?
?? $cookietime = 31536000;
?
?? $uid = intval($get['uid']);
?
?? $query = DB::query("SELECT uid, username, password FROM ".DB::table('common_member')." WHERE uid='$uid'");
?
?? if($member = DB::fetch($query)) {
?
??? dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
?
?? }else{
?
?????? $username = $get['username'];???????????????????????
?
???????????? $password = md5(time().rand(100000, 999999));
?
???????????? $email = $get['email'];
?
???????????? $ip = $_SERVER['REMOTE_ADDR'];
?
???????????? $time = time();??
?
???????????? $userdata = array(
?
??????? ?????????????????'uid' => $uid,
?
???????????????????????? 'username' => $username,
?
???????????????????????? 'password' => $password,
?
???????????????????????? 'email' => $email,
?
???????????????????????? 'adminid' => 0,
?
???????????????????????? 'groupid' => 10,
?
???????????????????????? 'regdate' => $time,
?
???????????????????????? 'credits' => 0,
?
???????????????????????? 'timeoffset' => 9999
?
???????????? );
?
???????????? DB::insert('common_member', $userdata);
?
???????????? $status_data = array(
?
???? ????????????????????'uid' => $uid,
?
???????????????????????? 'regip' => $ip,
?
???????????????????????? 'lastip' => $ip,
?
???????????????????????? 'lastvisit' => $time,
?
???????????????????????? 'lastactivity' => $time,
?
???????????????????????? 'lastpost' => 0,
?
???????????????????????? 'lastsendmail' => 0,
?
???????????? );
?
???????????? DB::insert('common_member_status', $status_data);
?
???????????? DB::insert('common_member_profile', array('uid' => $uid));
?
???????????? DB::insert('common_member_field_forum', array('uid' => $uid));
?
???????????? DB::insert('common_member_field_home', array('uid' => $uid));
?
???????????? DB::insert('common_member_count', array('uid' => $uid));
?
???????????? $query = DB::query("SELECT uid, username, password FROM ".DB::table('common_member')." WHERE uid='$uid'");
?
???????????? if($member = DB::fetch($query)) {
?
???????????????? dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
?
???????????? }
?
?? }
?
?}
?
2.??? phpcms2008代码修改:/member/register.php : 66 将if语句if($memberinfo['modelid'] && $M['choosemodel'] && !$M['enablemailcheck'] && !$M['enableadmincheck'])中的内容替换成
?list($uc_uid, $uc_username, $uc_password, $uc_email) =? uc_call("uc_user_login", array($memberinfo['username'], $memberinfo['password']));
?
$synlogin_code = uc_call('uc_user_synlogin', array($uc_uid));
?
showmessage('开始填写详细资料!'.$script.$synlogin_code, $M['url'].'register_model.php');
5.??? 更新phpcms,ucenter,discuz的缓存
?

Absolute session timeout starts at the time of session creation, while an idle session timeout starts at the time of user's no operation. Absolute session timeout is suitable for scenarios where strict control of the session life cycle is required, such as financial applications; idle session timeout is suitable for applications that want users to keep their session active for a long time, such as social media.

The server session failure can be solved through the following steps: 1. Check the server configuration to ensure that the session is set correctly. 2. Verify client cookies, confirm that the browser supports it and send it correctly. 3. Check session storage services, such as Redis, to ensure that they are running normally. 4. Review the application code to ensure the correct session logic. Through these steps, conversation problems can be effectively diagnosed and repaired and user experience can be improved.

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

Setting the httponly flag is crucial for session cookies because it can effectively prevent XSS attacks and protect user session information. Specifically, 1) the httponly flag prevents JavaScript from accessing cookies, 2) the flag can be set through setcookies and make_response in PHP and Flask, 3) Although it cannot be prevented from all attacks, it should be part of the overall security policy.

PHPsessionssolvetheproblemofmaintainingstateacrossmultipleHTTPrequestsbystoringdataontheserverandassociatingitwithauniquesessionID.1)Theystoredataserver-side,typicallyinfilesordatabases,anduseasessionIDstoredinacookietoretrievedata.2)Sessionsenhances

PHPsessionscanstorestrings,numbers,arrays,andobjects.1.Strings:textdatalikeusernames.2.Numbers:integersorfloatsforcounters.3.Arrays:listslikeshoppingcarts.4.Objects:complexstructuresthatareserialized.

TostartaPHPsession,usesession_start()atthescript'sbeginning.1)Placeitbeforeanyoutputtosetthesessioncookie.2)Usesessionsforuserdatalikeloginstatusorshoppingcarts.3)RegeneratesessionIDstopreventfixationattacks.4)Considerusingadatabaseforsessionstoragei

Session regeneration refers to generating a new session ID and invalidating the old ID when the user performs sensitive operations in case of session fixed attacks. The implementation steps include: 1. Detect sensitive operations, 2. Generate new session ID, 3. Destroy old session ID, 4. Update user-side session information.


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

WebStorm Mac version
Useful JavaScript development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version
