7c93c30689
- Remove admin/config_backup.php (backup/restore page) and all nav links to it across the admin pages and the expert-mode shared header. - Remove factory reset: the full-device version in configure.php (JS confirm, POST handler that reset three git repos + wiped /etc config, and the hidden form) and the CSS-only version in expert/edit_dashboard.php. - Remove the PiStar-Remote and BM API full editors (admin/expert/fulledit_pistar-remote.php, fulledit_bmapikey.php) and their links from the expert-mode menu. - Add a "custom" option to the APRS server dropdown in configure.php so operators can type their own server + port instead of picking from APRSHosts.txt; wires the port through to ircDDBGateway, YSFGateway/YSF2DMR/YSF2NXDN/YSF2P25, and APRSGateway (previously only the hostname was ever configurable, port was hardcoded 14580). - Extend the POCSAG frequency band validator (functions.js) to also treat 150-160MHz as a valid/green range.
92 lines
4.1 KiB
PHP
92 lines
4.1 KiB
PHP
<?php
|
|
// Load the language support
|
|
require_once('config/language.php');
|
|
// Load the Pi-Star Release file
|
|
$pistarReleaseConfig = '/etc/pistar-release';
|
|
$configPistarRelease = array();
|
|
$configPistarRelease = parse_ini_file($pistarReleaseConfig, true);
|
|
// Load the Version Info
|
|
require_once('config/version.php');
|
|
|
|
// Sanity Check that this file has been opened correctly
|
|
if ($_SERVER["PHP_SELF"] == "/admin/power.php") {
|
|
// Sanity Check Passed.
|
|
header('Cache-Control: no-cache');
|
|
session_start();
|
|
?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
|
|
<head>
|
|
<meta name="robots" content="index" />
|
|
<meta name="robots" content="follow" />
|
|
<meta name="language" content="English" />
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
<meta name="Author" content="Andrew Taylor (MW0MWZ)" />
|
|
<meta name="Description" content="CDN Power" />
|
|
<meta name="KeyWords" content="CDN" />
|
|
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
|
<meta http-equiv="pragma" content="no-cache" />
|
|
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
|
|
<meta http-equiv="Expires" content="0" />
|
|
<title>CDN - <?php echo $lang['digital_voice']." ".$lang['dashboard']." - ".$lang['power'];?></title>
|
|
<link rel="stylesheet" type="text/css" href="css/pistar-css.php" />
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="header">
|
|
<div style="font-size: 8px; text-align: right; padding-right: 8px;">CDN:<?php echo $configPistarRelease['Pi-Star']['Version']?> / <?php echo $lang['dashboard'].": ".$version; ?></div>
|
|
<h1>CDN <?php echo $lang['digital_voice']." - ".$lang['power'];?></h1>
|
|
<p style="padding-right: 5px; text-align: right; color: #ffffff;">
|
|
<a href="/" style="color: #ffffff;"><?php echo $lang['dashboard'];?></a> |
|
|
<a href="/admin/" style="color: #ffffff;"><?php echo $lang['admin'];?></a> |
|
|
<a href="/admin/configure.php" style="color: #ffffff;"><?php echo $lang['configuration'];?></a>
|
|
</p>
|
|
</div>
|
|
<div class="contentwide">
|
|
<h2><?php echo $lang['power'];?></h2>
|
|
<?php if (!empty($_POST)) { ?>
|
|
<div class="settings-card">
|
|
<?php
|
|
if ( escapeshellcmd($_POST["action"]) == "reboot" ) {
|
|
echo '<div class="power-status">Reboot command has been sent to your Pi,
|
|
<br />please wait up to 90 secs for it to reboot.<br />
|
|
<br />You will be re-directed back to the
|
|
<br />dashboard automatically in 90 seconds.
|
|
<script language="JavaScript" type="text/javascript">
|
|
setTimeout("location.href = \'/index.php\'",90000);
|
|
</script>
|
|
</div>';
|
|
system('sudo sync && sudo sync && sudo sync && sudo mount -o remount,ro / > /dev/null &');
|
|
exec('sudo reboot > /dev/null &');
|
|
};
|
|
if ( escapeshellcmd($_POST["action"]) == "shutdown" ) {
|
|
echo '<div class="power-status">Shutdown command has been sent to your Pi,
|
|
<br /> please wait 30 secs for it to fully shutdown<br />before removing the power.</div>';
|
|
system('sudo sync && sudo sync && sudo sync && sudo mount -o remount,ro / > /dev/null &');
|
|
exec('sudo shutdown -h now > /dev/null &');
|
|
};
|
|
?>
|
|
</div>
|
|
<?php } else { ?>
|
|
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post" onsubmit="return confirm('Are you sure?');">
|
|
<div class="settings-card action-tiles">
|
|
<button class="action-tile" name="action" value="reboot">
|
|
<img src="/images/reboot.png" alt="Reboot" />
|
|
<span>Reboot</span>
|
|
</button>
|
|
<button class="action-tile" name="action" value="shutdown">
|
|
<img src="/images/shutdown.png" alt="Shutdown" />
|
|
<span>Shutdown</span>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
<?php
|
|
}
|
|
?>
|