Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of resetting the background URL by phpcms

Shulou Source: shulou.com Published: 2022-06-02 05:19:20 10月12日 Update

How to reset the background URL by phpcms? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

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

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

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

Find "? m=admin&c=index&a=login" for batch replacement.

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

3.1 the code will be as follows:

Final public function check_admin () {if (ROUTE_M = = 'admin' & & ROUTE_C = =' index' & & in_array (ROUTE_A, array ('login',' public_card') {

Modified to:

Final public function check_admin () {if (ROUTE_M = = 'admin' & & ROUTE_C = =' index' & & in_array (ROUTE_A, array ('new login function name', 'public_card') {

3.2 translate the code

If (! isset ($_ SESSION ['userid']) | |! isset ($_ SESSION [' roleid']) | |! $_ SESSION ['userid'] | |! $_ SESSION [' roleid']) showmessage (L ('admin_login'),' masked adminstration centering indexation

Modify to

If (! isset ($_ SESSION ['userid']) | |! isset ($_ SESSION [' roleid']) | |! $_ SESSION ['userid'] | |! $_ SESSION [' roleid']) showmessage (L ('admin_login'), APP_PATH)

Note: this modification avoids jumping to the home page of the site, because you can never open the login page if you don't know the exact address.

3.3 put the code

Final public function check_priv () {if (ROUTE_M = = 'admin' & & ROUTE_C = =' index' & & in_array (ROUTE_A, array ('login',' init', 'public_card') return true

Change to

Final public function check_priv () {if (ROUTE_M = = 'admin' & & ROUTE_C = =' index' & & in_array (ROUTE_A, array ('new login function name', 'init',' public_card') return true

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

Put the code

Modified to:

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

This makes it possible to change the default background address of phpcms v9, such as https://www.php.cn/myadmin/index.php (myadmin/index.php is the modified file name).

Thank you for reading! After reading the above, do you have a general idea of how phpcms resets the background URL? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.

Tags: Code content address login background URL function file method file name article question more look website home page industry information channel path Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Information Docker Microsoft Shulou Tech Info