Home > CMS Tutorial > PHPCMS > How to reset the backend URL in phpcms

How to reset the backend URL in phpcms

王林
Release: 2020-02-08 10:19:44
Original
2780 people have browsed it

How to reset the backend URL in phpcms

1. Modify the admin.php file name, modify the jump address and write the complete path. The specific modifications are as follows:

<?php header(&#39;location:index.php?m=admin&#39;); ?>
Copy after login

Replace the "index" in the code .php?m=admin" to a specific URL, such as: https://www.php.cn/myadmin/index.php.

2. Modify /phpcms/modules/admin/index.php and change the public function login to the address you want:

Find "?m=admin&c=index&a=login" to proceed Bulk replacement.

3. Modify /phpcms/modules/admin/classes/admin.class.php

3.1 Modify the following code:

final public function check_admin() {
if(ROUTE_M ==&#39;admin&#39; && ROUTE_C ==&#39;index&#39; && in_array(ROUTE_A, array(&#39;login&#39;, &#39;public_card&#39;))) {
Copy after login

to:

final public function check_admin() {
if(ROUTE_M ==&#39;admin&#39; && ROUTE_C ==&#39;index&#39; && in_array(ROUTE_A, array(&#39;新登录函数名&#39;, &#39;public_card&#39;))) {
Copy after login

3.2 Modify the code

if(!isset($_SESSION[&#39;userid&#39;]) || !isset($_SESSION[&#39;roleid&#39;]) || !$_SESSION[&#39;userid&#39;] || !$_SESSION[&#39;roleid&#39;]) showmessage(L(&#39;admin_login&#39;),&#39;m=admin&c=index&a=login&#39;);
Copy after login

to

if(!isset($_SESSION[&#39;userid&#39;]) || !isset($_SESSION[&#39;roleid&#39;]) || !$_SESSION[&#39;userid&#39;] || !$_SESSION[&#39;roleid&#39;]) showmessage(L(&#39;admin_login&#39;),APP_PATH);
Copy after login

Note: This modification will avoid jumping to the homepage of the website, because you will never be able to type without knowing the exact address. Open the login page.

3.3 Change the code

final public function check_priv() {
if(ROUTE_M ==&#39;admin&#39; && ROUTE_C ==&#39;index&#39; && in_array(ROUTE_A, array(&#39;login&#39;, &#39;init&#39;, &#39;public_card&#39;))) return true;
Copy after login

to

final public function check_priv() {
if(ROUTE_M ==&#39;admin&#39; && ROUTE_C ==&#39;index&#39; && in_array(ROUTE_A, array(&#39;新登录函数名&#39;, &#39;init&#39;, &#39;public_card&#39;))) return true;
Copy after login

4. Modify /phpcms/modules/admin/templates/login.tpl.php

and change the code

<form action="index.php?m=admin&c=index&a=login&dosubmit=1" method="post" name="myform">
Copy after login

is modified to:

<form action="index.php?m=admin&c=index&a=新登录函数名&dosubmit=1" method="post" name="myform">
Copy after login

5. Search all files under /phpcms/modules/admin and change a=login to a=new login function name.

In this way, the default background address of phpcms v9 can be modified, such as https://www.php.cn/myadmin/index.php (myadmin/index.php is the modified file name).

Related recommendations: phpcms tutorial

The above is the detailed content of How to reset the backend URL in phpcms. 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