From d71d69dbe7ae82cf630f0d73b65147e0d9c6d8db Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 6 Jan 2021 15:03:09 +0100 Subject: [PATCH] fixes #1277 ability to activate plugin link only for webmasters --- admin/include/plugins.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/admin/include/plugins.class.php b/admin/include/plugins.class.php index 76a3b04f3..b06a6f114 100644 --- a/admin/include/plugins.class.php +++ b/admin/include/plugins.class.php @@ -317,9 +317,21 @@ DELETE FROM '. PLUGINS_TABLE .' { $plugin['author uri'] = trim($val[1]); } - if (preg_match("/Has Settings:\\s*(true|True)/", $plg_data, $val)) + if (preg_match("/Has Settings:\\s*([Tt]rue|[Ww]ebmaster)/", $plg_data, $val)) { - $plugin['hasSettings'] = true; + if (strtolower($val[1]) == 'webmaster') + { + global $user; + + if ('webmaster' == $user['status']) + { + $plugin['hasSettings'] = true; + } + } + else + { + $plugin['hasSettings'] = true; + } } if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid=')) {