Home > CMS Tutorial > DEDECMS > How to implement the login-free interface of Dreamweaver CMS

How to implement the login-free interface of Dreamweaver CMS

藏色散人
Release: 2019-12-24 10:16:21
Original
2063 people have browsed it

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(); 
}
Copy after login

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:

//检验用户登录状态
Copy after login

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(); 
} 
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template