mirror of
https://github.com/kleeja-official/kleeja.git
synced 2025-12-16 04:59:42 +01:00
delete plugins from server
add delete plugin action
This commit is contained in:
@@ -34,10 +34,11 @@ $plugin_enable_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&am
|
||||
$plugin_disable_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=disable&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_download_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=download&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_update_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=update&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_delete_folder_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=delete_folder&' . $GET_FORM_KEY . '&plg=';
|
||||
|
||||
|
||||
//check _GET Csrf token
|
||||
if (! empty($case) && in_array($case, ['install', 'uninstall', 'enable', 'disable' , 'download' , 'update']))
|
||||
if (! empty($case) && in_array($case, ['install', 'uninstall', 'enable', 'disable' , 'download' , 'update' , 'delete_folder']))
|
||||
{
|
||||
if (! kleeja_check_form_key_get('PLUGINS_FORM_KEY'))
|
||||
{
|
||||
@@ -610,7 +611,7 @@ switch ($case):
|
||||
// download or update msg
|
||||
kleeja_admin_info(
|
||||
sprintf($lang[ig('update') ? 'PLUGIN_UPDATED' : 'PLUGIN_DOWNLOADED'], $download_plugin),
|
||||
ADMIN_PATH . '?cp=' . basename(__file__, '.php')
|
||||
ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=local'
|
||||
);
|
||||
|
||||
exit;
|
||||
@@ -656,11 +657,29 @@ switch ($case):
|
||||
|
||||
if (is_dir($plugin_folder_name))
|
||||
{
|
||||
kleeja_unlink($plugin_folder_name);
|
||||
delete_plugin_folder($plugin_folder_name);
|
||||
}
|
||||
|
||||
redirect($plugin_download_link . $update_plugin . '&update' );
|
||||
|
||||
break;
|
||||
|
||||
case 'delete_folder':
|
||||
|
||||
$plugin_folder = g('plg');
|
||||
|
||||
$plugin_folder_name = PATH . KLEEJA_PLUGINS_FOLDER . '/' . $plugin_folder;
|
||||
|
||||
if (is_dir($plugin_folder_name))
|
||||
{
|
||||
delete_plugin_folder($plugin_folder_name);
|
||||
}
|
||||
|
||||
kleeja_admin_info(
|
||||
sprintf($lang['PLG_SUCSS_DEL'] , $plugin_folder),
|
||||
ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=local'
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
endswitch;
|
||||
|
||||
Reference in New Issue
Block a user