diff --git a/app/controllers/pluginsController.php b/app/controllers/pluginsController.php index c14ec9f..42b78fe 100644 --- a/app/controllers/pluginsController.php +++ b/app/controllers/pluginsController.php @@ -2,13 +2,16 @@ if (!empty ($_POST)){ if ( isset($_POST['name']) && - $_POST['name'] != '' && - isset($_POST['actualStatus']) + $_POST['name'] != '' ){ - if ($_POST['actualStatus']) { - rename($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php", $_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php"); + if ($_POST['status'] == "true") { + if (file_exists ($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php")) { + rename($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php", $_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php"); + } } else { - rename($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php", $_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php"); + if (file_exists ($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php")) { + rename($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php", $_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php"); + } } header('Location: ./plugins'); die(); diff --git a/app/views/templates/part/pluginButton.phtml b/app/views/templates/part/pluginButton.phtml index d840553..8acea49 100644 --- a/app/views/templates/part/pluginButton.phtml +++ b/app/views/templates/part/pluginButton.phtml @@ -1,21 +1,29 @@
-
-
-
-
-
- -
-
-
- -
-
+
+
+
+
+
+ +
+
+
+
+
+
+ + + echo('b_approve')?> +
+
+
+
+ + + echo('b_disable')?> +
+
+
+
+
diff --git a/app/views/templates/plugins.phtml b/app/views/templates/plugins.phtml index 6a59b5d..a002f96 100644 --- a/app/views/templates/plugins.phtml +++ b/app/views/templates/plugins.phtml @@ -27,27 +27,16 @@
- prepare('langMng',$LANGMNG); $partial->prepare('pluginName',$plugin['name']); $partial->prepare('pluginStatus',$plugin['status']); $partial->render(); - + ?> -
-
- - - -
-
-
-
-
-