Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to solve the problem that phpcms cannot delete columns

Shulou Source: shulou.com Published: 2022-06-02 12:14:33 10月24日 Update

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.

Tags: Columns permissions administrators administrators sites time questions content methods files articles more knowledge articles roles awakening tips yes that is location Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Docker MySQL Shulou Technology Shulou Information