search
HomeCMS TutorialPHPCMSWhat is the phpcms backend?

What is the phpcms backend?

Jul 17, 2020 am 10:04 AM
phpcms

phpcms backend address is "your domain name/admin.php". Because PHPCMS adopts the MVC design pattern, its backend access address is fixed. Although it can be modified by modifying the routing configuration file, But it will be troublesome to modify the routing configuration file every time.

What is the phpcms backend?

phpcmsThe default backend address is: "your domain name/admin.php".

The latest release of PHPCMS V9 adopts the MVC design pattern, so its background access address is fixed. Although it can be modified by modifying the routing configuration file, it is difficult for me to modify the routing configuration file every time. It's a bit troublesome, and mistakes can happen if you're not careful. Another once-and-for-all method is used here to achieve the purpose of conveniently modifying the access to the backend entrance. The entire modification is divided into two steps:

The first step:

Create a folder in the root directory of the website, In the future, you will use this folder to enter the backend login interface, so the folder name must be a name that is not easy for others to guess. As a demonstration here, I will call it managers. Next, create a new file index.php in this folder with the content:

<?php 
define(&#39;PHPCMS_PATH&#39;, realpath(dirname(__FILE__) . &#39;/..&#39;) . &#39;../&#39;); 
include PHPCMS_PATH . &#39;/phpcms/base.php&#39;; 
// pc_base::creat_app(); 
$session_storage = &#39;session_&#39; . pc_base :: load_config(&#39;system&#39;, &#39;session_storage&#39;); pc_base :: load_sys_class($session_storage); session_start(); $_SESSION[&#39;right_enter&#39;] = 1; unset($session_storage); header(&#39;location:../index.php?m=admin&#39;);

Step 2:

Create a new file MY_index.php in the phpcms/modules/admin/ folder , the content is:

<?php defined(&#39;IN_PHPCMS&#39;) or exit(&#39;No permission resources.&#39;);
class MY_index extends index {
public function __construct() {
if (empty($_SESSION[&#39;right_enter&#39;])) {
header(&#39;location:./&#39;);
exit;
}
parent :: __construct();
}
public function public_logout() {
$_SESSION[&#39;right_enter&#39;] = 0;
parent :: public_logout();
}
}
?>

Okay, the modification is completed. In the future, you can only access the backend login portal through the managers/ directory. If you directly use index.php?m=admin to access it, it will jump directly to the homepage of the website, thus preventing direct access to the backend login portal.

The above is the detailed content of What is the phpcms backend?. 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

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment