remake to switch betwen enable and disable buton and second button is remove, remova now not work

This commit is contained in:
Haitem 2020-10-30 15:25:34 +01:00
parent 6689b4285e
commit 2117e9acac
3 changed files with 19 additions and 8 deletions

View File

@ -4,9 +4,11 @@ error_reporting(E_ALL);
ini_set( 'display_errors','1'); ini_set( 'display_errors','1');
//setup //setup
parse_str($_SERVER['QUERY_STRING'], $params);
$urlSes = str_replace((!empty ($params['url']) ? $params['url'] : ""), "", str_replace('https://' . $_SERVER['HTTP_HOST'], "", $_SERVER['REQUEST_URI']));
session_set_cookie_params( session_set_cookie_params(
1209600, 1209600,
str_replace('login', "", str_replace('https://' . $_SERVER['HTTP_HOST'], "", $_SERVER['REQUEST_URI'])), $urlSes,
str_replace("/var/www/", "", $_SERVER['DOCUMENT_ROOT']), str_replace("/var/www/", "", $_SERVER['DOCUMENT_ROOT']),
true, true,
true true

View File

@ -1,9 +1,10 @@
<?php <?php
if (!empty ($_POST)){ if (!empty ($_POST)){
if ( if (
isset($_POST['name']) && isset ($_POST['name']) &&
$_POST['name'] != '' $_POST['name'] != '' &&
){ !isset ($_POST['remove'])
) {
if ($_POST['status'] == "true") { if ($_POST['status'] == "true") {
if (file_exists ($_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"); rename($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php", $_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php");
@ -16,4 +17,12 @@ if (!empty ($_POST)){
header('Location: ./plugins'); header('Location: ./plugins');
die(); die();
} }
if (
isset ($_POST['name']) &&
$_POST['name'] != '' &&
isset ($_POST['remove'])
) {
//
}
} }

View File

@ -12,15 +12,15 @@
<div class="col"> <div class="col">
<form method="post" action=""> <form method="post" action="">
<input type="hidden" name="name" value="<?php echo $PLUGINNAME; ?>"/> <input type="hidden" name="name" value="<?php echo $PLUGINNAME; ?>"/>
<input type="hidden" name="status" value="true"/> <input type="hidden" name="status" value="<?php echo ($PLUGINSTATUS == false ? "true" : "false"); ?>"/>
<a class="button is-primary m-1" onclick="$(this).closest('form').submit();"><?php $LANGMNG->echo('b_approve')?></a> <a class="button is-primary m-1" onclick="$(this).closest('form').submit();"><?php echo ($PLUGINSTATUS == false ? $LANGMNG->get('b_approve') : $LANGMNG->get('b_disable')); ?></a>
</form> </form>
</div> </div>
<div class="col"> <div class="col">
<form method="post" action=""> <form method="post" action="">
<input type="hidden" name="name" value="<?php echo $PLUGINNAME; ?>"/> <input type="hidden" name="name" value="<?php echo $PLUGINNAME; ?>"/>
<input type="hidden" name="status" value="false"/> <input type="hidden" name="remove" value="1"/>
<a class="button is-primary m-1" onclick="$(this).closest('form').submit();"><?php $LANGMNG->echo('b_disable')?></a> <a class="button is-primary m-1" onclick="$(this).closest('form').submit();"><?php $LANGMNG->echo('b_remove'); ?></a>
</form> </form>
</div> </div>
</div> </div>