(cp 0b9e177) issue #1852 also forbid extension deletion

This commit is contained in:
plegall
2023-01-25 15:21:11 +01:00
parent 53e37d3847
commit 24b439e2a7
10 changed files with 39 additions and 5 deletions
+12 -2
View File
@@ -52,7 +52,7 @@ function ws_plugins_getList($params, $service)
*/
function ws_plugins_performAction($params, $service)
{
global $template;
global $template, $conf;
if (get_pwg_token() != $params['pwg_token'])
{
@@ -64,6 +64,11 @@ function ws_plugins_performAction($params, $service)
return new PwgError(403, l10n('Webmaster status is required.'));
}
if (!$conf['enable_extensions_install'] and 'delete' == $params['action'])
{
return new PwgError(401, 'Piwigo extensions install/update/delete system is disabled');
}
define('IN_ADMIN', true);
include_once(PHPWG_ROOT_PATH.'admin/include/plugins.class.php');
@@ -94,13 +99,18 @@ function ws_plugins_performAction($params, $service)
*/
function ws_themes_performAction($params, $service)
{
global $template;
global $template, $conf;
if (get_pwg_token() != $params['pwg_token'])
{
return new PwgError(403, 'Invalid security token');
}
if (!$conf['enable_extensions_install'] and 'delete' == $params['action'])
{
return new PwgError(401, 'Piwigo extensions install/update/delete system is disabled');
}
define('IN_ADMIN', true);
include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');