Commit 25850ae7 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) refactor system_advanced_admin.php

parent f25f1bb1
...@@ -231,7 +231,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -231,7 +231,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
$retval = filter_configure(); filter_configure();
$savemsg = get_std_save_message(); $savemsg = get_std_save_message();
if ($restart_webgui) { if ($restart_webgui) {
...@@ -243,9 +243,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -243,9 +243,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// Restart DNS in case dns rebinding toggled // Restart DNS in case dns rebinding toggled
if (isset($config['dnsmasq']['enable'])) { if (isset($config['dnsmasq']['enable'])) {
services_dnsmasq_configure(); services_dnsmasq_configure();
} elseif (isset($config['unbound']['enable'])) } elseif (isset($config['unbound']['enable'])) {
services_unbound_configure(); services_unbound_configure();
} }
if ($restart_sshd) {
killbyname("sshd");
log_error(gettext("secure shell configuration has changed. Stopping sshd."));
if ($config['system']['ssh']['enabled']) {
log_error(gettext("secure shell configuration has changed. Restarting sshd."));
configd_run("sshd restart");
}
}
if ($restart_webgui) {
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
mwexec_bg('/usr/local/etc/rc.restart_webgui 2');
}
}
} }
...@@ -277,6 +292,19 @@ include("head.inc"); ...@@ -277,6 +292,19 @@ include("head.inc");
document.getElementById("ssl_opts").style.display="none"; document.getElementById("ssl_opts").style.display="none";
} }
} }
$( document ).ready(function() {
prot_change();
<?php
// reload page after 20 seconds if webserver is restarted
if ( isset($restart_webgui) && $restart_webgui):?>
setTimeout(function(){
window.location.assign("<?=$url;?>");
}, 20000);
});
<?php
endif;?>
//]]> //]]>
</script> </script>
...@@ -292,7 +320,7 @@ include("head.inc"); ...@@ -292,7 +320,7 @@ include("head.inc");
} }
?> ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box tab-content"> <div class="content-box tab-content table-responsive">
<form action="system_advanced_admin.php" method="post" name="iform" id="iform"> <form action="system_advanced_admin.php" method="post" name="iform" id="iform">
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
...@@ -570,34 +598,4 @@ include("head.inc"); ...@@ -570,34 +598,4 @@ include("head.inc");
</div> </div>
</div> </div>
</section> </section>
<script type="text/javascript">
//<![CDATA[
prot_change();
//]]>
</script>
<?php
if ($restart_webgui) {
echo "<meta http-equiv=\"refresh\" content=\"20;url={$url}\" />";
}
?>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
<?php
if ($restart_sshd) {
killbyname("sshd");
log_error(gettext("secure shell configuration has changed. Stopping sshd."));
if ($config['system']['ssh']['enabled']) {
log_error(gettext("secure shell configuration has changed. Restarting sshd."));
configd_run("sshd restart");
}
}
if ($restart_webgui) {
ob_flush();
flush();
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
mwexec_bg('/usr/local/etc/rc.restart_webgui 2');
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment