search
HomeCMS TutorialPHPCMSHow to reset the backend URL in phpcms

How to reset the backend URL in phpcms

Feb 08, 2020 am 10:19 AM
phpcms

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;); ?>

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;))) {

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;))) {

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;);

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);

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;

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;

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">

is modified to:

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

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!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),