bug:2022 admins can uninstall plugins

git-svn-id: http://piwigo.org/svn/trunk@9994 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100
2011-04-02 14:07:26 +00:00
parent 00b11dd74e
commit 488a911657
+15 -8
View File
@@ -38,17 +38,24 @@ $plugins = new plugins();
//--------------------------------------------------perform requested actions
if (isset($_GET['action']) and isset($_GET['plugin']))
{
check_pwg_token();
$page['errors'] = $plugins->perform_action($_GET['action'], $_GET['plugin']);
if (empty($page['errors']))
if ($_GET['action'] == 'uninstall' AND !is_webmaster())
{
if ($_GET['action'] == 'activate' or $_GET['action'] == 'deactivate')
array_push($page['errors'], l10n('Webmaster status is required.'));
}
else
{
check_pwg_token();
$page['errors'] = $plugins->perform_action($_GET['action'], $_GET['plugin']);
if (empty($page['errors']))
{
$template->delete_compiled_templates();
if ($_GET['action'] == 'activate' or $_GET['action'] == 'deactivate')
{
$template->delete_compiled_templates();
}
redirect($base_url);
}
redirect($base_url);
}
}