1.
2.
<if condition= "$GLOBALS [' userinfo '] [' user_id '] GT 0" >
<span class= "help_wz" ><a href= "{$ think.config.vip_url}/member/user_pwd/"style=" color: #404958; " > Find login Password </a></span>
<else/>
<span class= "help_wz" ><a href= "/login/findpwd" style= "COLOR: #404958;" > Find login password </a></span>
</if>
3. Setting global variables in the background and querying user information
Public Function UserInfo ($user _id) {//query System Information $system =array (' CmdId ' => ' system ', ' Token ' => ' wap ', ' postdetails ' =
>json_encode (Array ()));
Sending an interface request via Curl Post mode $curl =new Curlcontroller ();
$strs = $curl->sendcurl ($system);
$GLOBALS [' System ']= $strs [' acctdetails '];
if (Empty ($user _id)) {return false;} setcookie ("Login_uid", $user _id, time () + 3600, "/", C (' Cookie_url ')); Setcookie ("Rdun"), $this->authcode ($user _id. "," .
Time (), "ENCODE"), time () + 3600, "/", C (' Cookie_url '));; $data =array (' CmdId ' => ' individual ', ' Token ' =>session (' Token '), ' postdetails ' =>json_encode (' User_
Id ' => $user _id));
Sending an interface request via Curl Post mode $curl =new Curlcontroller ();
$str = $curl->sendcurl ($data);
$GLOBALS [' userinfo ']= $str [' acctdetails '];
$newtoken =unserialize ($str [' acctdetails '] [' token ']);
$oldtoken =unserialize (Session (' token ')); if (!empty (Session (' token ')) &&!empty ($str [' acctdetails '] [' token ']) {//user not to if ($newtoken [' user_id ']!== $
newtoken[' user_id '] {session (' token ', null);Session (' user_id ', null);
Header (' Location:/login/login ');
return false; //token does not $newtoken [' time ']!== $oldtoken [' time ']} {session (' token ', null); session (' user_id ', null); Header ('
Location:/login/login ');
return false;
//timeout cannot be done in this, because the value of the session is unchanged, if the user has been operating, and only once, then there will be problems} return true; }
The above is a small set to the introduction of PHP to determine whether the user has logged in (jump to different pages or perform different actions), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!