Commit c7740782 authored by Franco Fichtner's avatar Franco Fichtner

src: remove restart_httpd.php and clean up the startup function

parent 8515fb0c
......@@ -728,12 +728,6 @@ $priv_list['page-diagnostics-rebootsystem']['descr'] = gettext("Allow access to
$priv_list['page-diagnostics-rebootsystem']['match'] = array();
$priv_list['page-diagnostics-rebootsystem']['match'][] = "reboot.php*";
$priv_list['page-diagnostics-restart-httpd'] = array();
$priv_list['page-diagnostics-restart-httpd']['name'] = gettext("WebCfg - Diagnostics: Restart HTTPD : System page");
$priv_list['page-diagnostics-restart-httpd']['descr'] = gettext("Allow access to the 'Diagnostics: Restart HTTPD: System' page.");
$priv_list['page-diagnostics-restart-httpd']['match'] = array();
$priv_list['page-diagnostics-restart-httpd']['match'][] = "restart_httpd.php*";
$priv_list['page-services-captiveportal'] = array();
$priv_list['page-services-captiveportal']['name'] = gettext("WebCfg - Services: Captive portal page");
$priv_list['page-services-captiveportal']['descr'] = gettext("Allow access to the 'Services: Captive portal' page.");
......
......@@ -791,11 +791,6 @@ function system_webgui_start()
{
global $config, $g;
if (file_exists("/var/run/booting")) {
/* XXX no no no no no no no no */
echo gettext("Starting webConfigurator...");
}
chdir('/usr/local/www');
/* defaults */
......@@ -864,17 +859,8 @@ function system_webgui_start()
/* regenerate the php.ini files in case the setup has changed */
mwexec('/usr/local/etc/rc.php_ini_setup');
/* attempt to start lighthttpd */
$res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-webConfigurator.conf");
if (file_exists("/var/run/booting")) {
if ($res == 0)
echo gettext("done.") . "\n";
else
echo gettext("failed!") . "\n";
}
return $res;
/* attempt to start lighthttpd and return true if ok */
return !mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-webConfigurator.conf");
}
function system_generate_lighty_config(
......
......@@ -241,7 +241,7 @@ local_sync_accounts();
echo "done.\n";
/* start web server */
system_webgui_start();
echo 'Starting webConfigurator...'. (system_webgui_start() ? 'done.' : 'failed.') . PHP_EOL;
/* configure cron service */
echo "Configuring CRON...";
......
......@@ -114,7 +114,6 @@ page-services-ntp-pps=status_ntpd_pps.php*
page-loadbalancer-virtualserver-edit=load_balancer_virtual_server_edit.php*
page-package-edit=pkg_edit.php*
page-diagnostics-rebootsystem=reboot.php*
page-diagnostics-restart-httpd=restart_httpd.php*
page-services-captiveportal=services_captiveportal.php*
page-services-captiveportal-filemanager=services_captiveportal_filemanager.php*
page-services-captiveportal-allowedips=services_captiveportal_ip.php*
......
......@@ -248,15 +248,10 @@ $diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php");
$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php");
$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php");
if(file_exists("/var/run/gmirror_active"))
if (file_exists("/var/run/gmirror_active")) {
$diagnostics_menu[] = array(gettext("GEOM Mirrors"), "/diag_gmirror.php" );
if (isset($config['system']['developer'])) {
$diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php", "style" => "font-weight: bold; color: yellow;");
}
$diagnostics_menu = msort($diagnostics_menu, 0);
$help_menu = array();
......@@ -269,12 +264,13 @@ $help_menu[] = array(gettext("Paid Support"), "https://opnsense.org/support-over
$help_menu[] = array(gettext("FreeBSD Handbook"), "https://www.freebsd.org/doc/handbook/");
$help_menu = msort($help_menu, 0);
function add_to_menu($url, $name) {
if (isAllowedPage($url))
function add_to_menu($url, $name)
{
if (isAllowedPage($url)) {
echo "<a href=\"{$url}\" class=\"list-group-item\">{$name}</a>\n";
}
}
/* display a top alert bar if need be */
$need_alert_display = false;
$found_notices = are_notices_pending();
......
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2005 Bill Marquette <bill.marquette@gmail.com>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("guiconfig.inc");
$pgtitle = array(gettext("Restarting httpd"));
include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<form>
<?php include("fbegin.inc"); ?>
<?=gettext("Forcing all PHP file permissions to 0755");?>...
<?php flush(); sleep(1); system('/bin/chmod -R 0755 /usr/local/www/*.php'); ?>
<?=gettext("Done");?>.<br />
<?=gettext("Restarting mini_httpd");?>...
<?php flush(); sleep(1); system_webgui_start(); ?>
<?=gettext("Done");?>.<br />
<?php
include("fend.inc");
?>
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