Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that phpcms cannot delete columns

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to solve the problem that phpcms can not delete columns. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Phpcms can not delete the column because the site administrator does not have permission to delete the column, the solution: first find and open the "admin.class.php" file; then add the site administrator's permission to delete the column; finally, modify the "category.php" file.

Phpcms cannot delete columns? PHPCMS site administrator does not have permission to delete columns

Phpcms V9 except Super Admin, other administrators do not have permission to delete and modify columns, which may be a bug of the system.

Analysis:

PHPCMS v9 determines only the permissions recorded in the admin_role_ privtable when determining permissions. That is, the "permission setting" we make when setting the role, regardless of the "column permissions" we set. As can be seen from admin:check_priv (), this method does not give any consideration to column permissions. So when we use non-managed login, modify or delete the column will prompt "you do not have permission to operate this item".

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

Solution:

1. Find / phpcms/modules/admin/classes/admin.class.php, find it inside

$r = $privdb- > get_one (array ('siteid'= = > ROUTE_M,'c'= > ROUTE_C,'a'= > $action,'roleid'= > $_ SESSION [' roleid'], 'siteid'= > $siteid))

Probably on line 177, then add at the end of the sentence:

/ / add the delete column permission by of the site administrator: if (ROUTE_C = = 'category') {$catid = $_ GET [' catid']? $_ GET ['catid']: $_ POST [' catid']; / / get the role's current permission setting pc_base::load_app_class ('role_cat',', 0); $priv = role_cat::get_roleid ($_ SESSION ['roleid'], $siteid) If ($priv [$catid] [$action]) $r = true;}

two。 Found in / phpcms/modules/admin/category.php

Foreach ($arrchildid_arr as $arr_v) {$this- > update_priv ($arr_v, $_ POST ['priv_groupid'], 0);}

Change to:

Foreach ($arrchildid_arr as $arr_v) {$this- > update_priv ($arr_v, $_ POST ['priv_roleid']); / / add site administrator's permission to delete the column by: xingmu $this- > update_priv ($arr_v, $_ POST [' priv_groupid'], 0);}

Tip:

Remember to select the appropriate delete goods modification permission when adding the goods modification column.

On how to solve the problem that phpcms can not delete the column is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report