Home > CMS Tutorial > PHPCMS > How to implement background access restrictions in phpcms

How to implement background access restrictions in phpcms

王林
Release: 2020-02-08 13:56:56
Original
2201 people have browsed it

How to implement background access restrictions in phpcms

File path:/caches/config/system.php

Modification method:

Modification:

'admin_url' => ''
Copy after login

For example: the domain name that needs to be bound to the backend is a8800.phpip.com, then we can only access the backend through http://a8800.phpip.com/admin.php.

So this should be changed to:

'admin_url' => 'a8800.phpip.com',
Copy after login

Bind the domain name: a8800.phpip.com to the same directory as the website.

The a8800 here is any domain name, the more complex the better.

Function implementation method:

File:/phpcms/modules/admin/classes/admin.class.php

if(pc_base::load_config('system','admin_url') && $_SERVER["HTTP_HOST"]!= pc_base::load_config('system','admin_url')) {
                        Header("http/1.1 403 Forbidden");
                        exit('No permission resources.');
                }
Copy after login

Related Recommended: phpcms tutorial

The above is the detailed content of How to implement background access restrictions 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