当前位置:网站首页>Phpcms V9 remove the phpsso module

Phpcms V9 remove the phpsso module

2022-06-26 09:02:00 CMS applet plug-in [official]

phpsso Has always been phpsso Users' complaints , Because for most enterprise stations , There is no need to log in with multiple applications , Therefore, there is no need to phpsso, however phpcms The official didn't design a switch or something , It's mandatory phpsso, Even if it is mandatory , And we are often phpsso Of “ Communications ” stop , So many people are thinking about how to remove phpsso, Let the member function no longer depend on phpsso.

Because I want to develop phpcms v9 Wechat applet plug-in , It needs to connect with the member system , But damn phpsso It's crazy , And it is troublesome to get the user's Avatar , Because the default phpsso Your avatar is not stored , Therefore, it is difficult to read , So I decided to cut it down phpsso

(1) to v9_member Add a field to the table avatar, Used to store avatars , Set up varchar type .
(2) Comprehensive rectification phpcms\modules\member Under the index.php, Post some code :




(3) Comprehensive rectification phpcms\modules\member Under the member.php,content.php Basic modification and index.php Agreement

(4) Modify the code of all calling avatars in the foreground and background templates , The original no longer supports , And abolish the default method of modifying the avatar in the foreground , Change to phpcms Default image upload class , Picture call can be used directly $memberinfo['avatar'] and get_memberavatar($userid,$is_userid='1','') Method call .

(5) modify phpcms\libs\functions\global.func.php Medium get_memberavatar Method changed to :

  1. function get_memberavatar($uid, $is_userid='1', $size='30') { 
  2.     if($is_userid) { 
  3.         $db = pc_base::load_model('member_model'); 
  4.         $memberinfo = $db->get_one(array('userid'=>$uid)); 
  5.         if(isset($memberinfo['userid'])) { 
  6.             $uid = $memberinfo['userid']; 
  7.             $avatar = $memberinfo['avatar']; 
  8.         } else { 
  9.             return false; 
  10.         } 
  11.     } 

According to the above modification , Do a test , close phpsso after , You can still register your members at , At present, no other bug,.

To refuse to reach out to the party , The source code will not be released for the time being , You can contact me if you need , If you think it works for you , You can reward me , It doesn't matter how much , Respect the fruits of labor , It's not easy , Understand more ! Add me WeChat :15137100750 or QQ:2863868475

原网站

版权声明
本文为[CMS applet plug-in [official]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260838407174.html