getUserID()==-1){... }" and save it."/> getUserID()==-1){... }" and save it.">
Home >CMS Tutorial >DEDECMS >How to implement the login-free interface of Dreamweaver CMS
How to implement the login-free interface of DreamWeaver cms?
This article introduces the login-free interface of DreamWeaver cms for dedev5.
The implementation steps are as follows:
Cancel the login prompt that appears when DEDE is not logged in Automatically log in to DEDE Modify one DEDE code, It is config.php in the DEDE program administrator directory. The default path is dede/config.php. The code is as follows: //Check user login status The code is as follows:$cuserLogin = new userLogin(); if($cuserLogin->getUserID()==-1) { header("location:login.php?gotopage=".urlencode($dedeNowurl)); exit(); }The function of this code is to guide the user to enter the login process if the user's login information is not detected. Modify it as follows:
//检验用户登录状态The code is as follows:
$cuserLogin = new userLogin(); if($cuserLogin->getUserID()==-1) { if($my_u != ''){ $res = $cuserLogin->checkUser($my_u, $my_p); if($res==1) $cuserLogin->keepUser(); } if($cuserLogin->getUserID()==-1) { header("location:login.php?gotopage=".urlencode($dedeNowurl)); exit(); } }The function of this code is to When it is detected that the user is not logged in, try to log in using the parameters passed by the page. If the login is successful, the user's information is saved and other operations are performed; if the login fails, the user is directed to the login page.
The above is the detailed content of How to implement the login-free interface of Dreamweaver CMS. For more information, please follow other related articles on the PHP Chinese website!