<?php session_start(); if (!isset($_SESSION['RPirrigate_UserID']) && trim($_SERVER['REMOTE_ADDR']) != '127.0.0.1') { header('location: index.php?login'); die; } include 'config/config.php'; $db = new DB_CONN(); $userID = $_SESSION['RPirrigate_UserID']; $lang = $db->select1_setting('Language'); include 'languages/' . $lang . '/' . $lang . '.php'; $bannerMessage = ""; if (isset($_POST['name']) && isset($_POST['description']) && isset($_POST['gpio']) && isset($_POST['throughtput'])) { $db->query_module_add($_POST['name'], $_POST['description'], $_POST['gpio'], $_POST['throughtput'], $_FILES['image']); $bannerMessage = LANG_modulenew_BANNER; //*** ALSO SEND SIGUSR1 TO THE DAEMON TO MAKE IT RELOAD SETTINGS!! $pid = $db->select1_daemon_pid(); //Newer php version use SIG_NAME, newer SIGNAME if (defined('SIG_USR1')) { posix_kill($pid, SIG_USR1); } else { posix_kill($pid, SIGUSR1); } sleep(1); //let daemon reload and log } ?> <!DOCTYPE html> <html> <head>
<?php session_start(); if (!isset($_SESSION['RPirrigate_UserID']) && trim($_SERVER['REMOTE_ADDR']) != '127.0.0.1') { header('location: index.php?login'); die; } if (!isset($_GET['id'])) { die; } include 'config/config.php'; $db = new DB_CONN(); $location = $db->select1_setting('Location'); $userID = $_SESSION['RPirrigate_UserID']; $lang = $db->select1_setting('Language'); include 'languages/' . $lang . '/' . $lang . '.php'; $currModuleID = $_GET['id']; //If module doesn't exist, go to Home if (!$db->select1_module_exists($currModuleID)) { header('location: home.php'); die; } $bannerMessage = ""; if (isset($_POST['Description'])) { $db->query_module_description_update($currModuleID, nl2br($_POST['Description'])); $bannerMessage = LANG_module_BANNER_DESCRIPTION; } if (isset($_POST['ManualSave']) && $_POST['ManualSave'] == 'true') { $val = isset($_POST['ManualVAL']); $act = isset($_POST['ManualACT']); $db->query_module_manual_update($currModuleID, $act, $val);
<?php session_start(); if (!isset($_SESSION['RPirrigate_UserID']) && trim($_SERVER['REMOTE_ADDR']) != '127.0.0.1') { header('location: index.php?login'); die; } include 'config/config.php'; $db = new DB_CONN(); $lang = $db->select1_setting('Language'); $location = $db->select1_setting('Location'); $userID = $_SESSION['RPirrigate_UserID']; $hashPWD = $db->select1_hash_password($userID); $weather = $db->select1_setting("WeatherEnabled") == "1"; $bannerMessage = ""; //check that new language!=current language also if (isset($_POST['ChangeLanguage']) && $_POST['ChangeLanguage'] != $lang) { $lang = $_POST['ChangeLanguage']; $db->set_setting('Language', $lang); $bannerMessage = "languagedone"; } //include the file only afther eventual language change include 'languages/' . $lang . '/' . $lang . '.php'; //workaround... because I didn't have the constants when changing language if ($bannerMessage == "languagedone") { $bannerMessage = LANG_settings_BANNER_LANGUAGE; } if (isset($_POST['ChangeLocation']) && $_POST['ChangeLocation'] != $location) { $location = $_POST['ChangeLocation']; $db->set_setting('Location', $location); $bannerMessage = LANG_settings_BANNER_LOCATION;