PHPCMS improves security by modifying the template path and background address

Source: Internet
Author: User

Modify the background logon address in PHPCMS

The background of a website is very important to a website. Therefore, the background must be kept confidential. Sometimes I don't understand the background of the website. I can see that some websites put the background entries on the homepage.

Open-source systems, such as the PHPCMS background addresses are all unified, so we don't want to let others know, so we have to change the background logon address.

You only need to modify five files to change the background address.

1.Modify \ phpcms \ modules \ admin \ index. in php, change "login" to your method name. In this example, replace "a = login" with "a = newlogin ";


2.In the \ phpcms \ modules \ admin \ classes \ admin. class. Php file, modify

If (ROUTE_M = 'admin' & ROUTE_C = 'index' & in_array (ROUTE_A, array ('login', 'public _ card '))){
Return true;
} Else {
If (! Isset ($ _ SESSION ['userid']) |! Isset ($ _ SESSION ['roleid']) |! $ _ SESSION ['userid'] |! $ _ SESSION ['roleid']) showmessage (L ('admin _ login '),'? M = admin & c = index & a = login ');
}

To:
If (ROUTE_M = 'admin' & ROUTE_C = 'index' & in_array (ROUTE_A, array ('newlogin', 'public _ card '))){
Return true;
} Else {
If (! Isset ($ _ SESSION ['userid']) |! Isset ($ _ SESSION ['roleid']) |! $ _ SESSION ['userid'] |! $ _ SESSION ['roleid']) header ("location: http://www.lrfun.com /");
}


Note: The logon address is determined here. If the logon address is incorrect, go to the homepage of the website (the domain name is changed to your own domain name), and replace "a = login" with "a = newlogin ";


3.Modify \ phpcms \ modules \ admin \ classes \ admin respectively. class. php, \ phpcms \ modules \ admin \ templates \ header. tpl. php, \ phpcms \ modules \ admin \ templates \ login. tpl. php: replace "a = login" with "a = newlogin ";


This completes the modification of the background login address! The background address is index. php? M = admin & c = index & a = newlogin


Change the template path in phpcms


Change the name of a background language pack

1. Copy the files under ages/zh-cn/phpcms_admin.lang.php
Renamed: ages/zh-cn/dmlf_admin.lang.php
2. Add 10 lines in admin. php;
Require PHPCMS_ROOT. 'Ages/'. LANG.'/phpcms_admin.lang.php ';
Changed:
Require PHPCMS_ROOT. 'Ages/'. LANG.'/dmlf_admin.lang.php ';

2. Change the name of the front-end Language Pack

1. Copy the files under ages/zh-cn/phpcms. lang. php
Renamed: ages/zh-cn/dmlf. lang. php
2. Add 18 rows in include/common. inc. php;
Require PHPCMS_ROOT. 'Ages/'. LANG.'/phpcms. lang. Php ';
Changed:
Require PHPCMS_ROOT. 'Ages/'. LANG.'/dmlf. lang. Php ';

3. Remove phpcms from the template path.

1. Set the templates/default/phpcms folder
Renamed: templates/default/dmlf
2 templates/default/skins/default/phpcms.css
Renamed: templates/default/skins/default/dmlf.css
3. Open the template file in the renamed templates/default/dmlf folder.
Change {template 'phpcms' and 'header'} to {template 'dmlf', 'header '}
{Template 'phpcms', 'footer '} was renamed to: {template 'dmlf', 'footer '}
4. Open the renamed templates/default/dmlf/header.html,
Replace
<Link href = "your skin_path}$$mod}.css" rel = "stylesheet" type = "text/css"/>
Changed to: <link href = "javasskin_path1_dmlf.css" rel = "stylesheet" type = "text/css"/>
5. Choose System Settings> related settings> menu management> top menu in the background (manage the menu as a sub menu) -> [template Style] (management operation: Sub Menu)-> Change [phpcms] to [dmlf]
6. Choose System Settings> related settings> menu management> top menu in the background (manage the menu as a sub menu) -> [template Style] (tube operation: sub-menu)-> [dmlf] (tube operation: Sub Menu)-> [template management] (tube operation: modify) link address :? Mod = phpcms & file = template & action = manage & module = phpcms
Changed :? Mod = phpcms & file = template & action = manage & module = dmlf
7. Update cache
8. In index. php; list. php; show. php
Include template ('phpcms ', $ template );
Changed:
Include template ('dmlf', $ template );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.