当前位置:网站首页>phpcms v9去掉phpsso模块
phpcms v9去掉phpsso模块
2022-06-26 08:38:00 【cms小程序插件【官方】】
phpsso一直是被phpsso使用者所诟病,因为对于大多数企业站来说,是不需要多应用登录的,因此也就用不到phpsso,但是phpcms官方并没有设计一个开关之类的东西,而是强制使用phpsso,强制也就算了,而我们常常又会被phpsso的“通讯”拦住,因此很多人都想着怎么去除phpsso,让会员功能不再依赖phpsso。
因为我要开发phpcms v9的微信小程序插件,需要对接会员系统,但是可恶的phpsso很让人抓狂,并且获取用户头像比较麻烦,因为默认的phpsso的头像是不入库的,因此读取比较困难,所以决定砍掉phpsso
(1)给v9_member表增加一个字段avatar,用来存储头像,设置varchar类型。
(2)全面整改phpcms\modules\member下的index.php,贴出来部分代码:

(3)全面整改全面整改phpcms\modules\member下的member.php,content.php 基本改法和index.php一致
(4)修改前台和后台模板全部调用头像的代码,原本的不再支持,并且废除前台默认的修改头像的方法,改成phpcms 默认的图片上传类,图片调用可以直接使用$memberinfo['avatar']和get_memberavatar($userid,$is_userid='1','')的方式调用。
(5)修改phpcms\libs\functions\global.func.php中的get_memberavatar方法改成:
- function get_memberavatar($uid, $is_userid='1', $size='30') {
- if($is_userid) {
- $db = pc_base::load_model('member_model');
- $memberinfo = $db->get_one(array('userid'=>$uid));
- if(isset($memberinfo['userid'])) {
- $uid = $memberinfo['userid'];
- $avatar = $memberinfo['avatar'];
- } else {
- return false;
- }
- }
- }
根据以上修改,做测试,关闭phpsso之后,仍可以实现会员的注册于登录,目前暂未发现其他bug,。
为了拒绝伸手党,源码暂不公布,有需要可以联系我,如果你觉得对你有用,你可以对我打赏,多少无所谓,尊重劳动成果,码农不易,多多理解!加我微信:15137100750或QQ:2863868475
边栏推荐
- 基于SSM的毕业论文管理系统
- Tensorboard
- Yolov5进阶之二安装labelImg
- 【MATLAB GUI】 键盘回调中按键识别符查找表
- [IVI] 15.1.2 system stability optimization (lmkd Ⅱ) psi pressure stall information
- Implementation code of interceptor and filter
- Machine learning (Part 2)
- ImportError: ERROR: recursion is detected during loading of “cv2“ binary extensions. Check OpenCV in
- nn. Modulelist and nn Sequential
- 唯品会工作实践 : Json的deserialization应用
猜你喜欢

Detailed explanation of traditional image segmentation methods

Data warehouse (3) star model and dimension modeling of data warehouse modeling

Fast construction of neural network

What are the conditions for Mitsubishi PLC to realize Ethernet wireless communication?

什么是乐观锁,什么是悲观锁

Optimize quiver function in MATLAB to draw arrow diagram or vector diagram (1) -matlab development

Using MySQL and Qt5 to develop takeout management system (I): environment configuration

WBC learning notes (I): manually push WBC formula

SRv6----IS-IS扩展

uniapp用uParse实现解析后台的富文本编辑器的内容及修改uParse样式
随机推荐
Use of PCL
Fourier transform of image
Backward usage
Drawing with MATLAB (2) -- color ring
Install Anaconda + NVIDIA graphics card driver + pytorch under win10_ gpu
QT_ AI
Leetcode notes: binary search simple advanced
Data warehouse (1) what is data warehouse and what are the characteristics of data warehouse
1.17 daily improvement of winter vacation learning (frequency school and Bayesian school) and maximum likelihood estimation
Record the problem yaml file contains Chinese message 'GBK' error
HDU - 6225 Little Boxes(__int128的使用)
MPC learning notes (I): push MPC formula manually
Detailed explanation of self attention & transformer
Solution to the encoding problem encountered by the crawler when requesting get/post
Graduation thesis management system based on SSM
[qnx hypervisor 2.2 user manual]12.1 terminology (I)
Optimize quiver function in MATLAB to draw arrow diagram or vector diagram (1) -matlab development
多台三菱PLC如何实现无线以太网高速通讯?
Exploration of webots and ROS joint simulation (II): model import
torch. fft