PHP_SMART_HOME_V3/app/controllers/pluginsController.php

17 lines
561 B
PHP

<?php
if (!empty ($_POST)){
if (
isset($_POST['name']) &&
$_POST['name'] != '' &&
isset($_POST['actualStatus'])
){
if ($_POST['actualStatus']) {
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");
}
header('Location: ./plugins');
die();
}
}