Example #1
0
            $reqdfieldst = array_merge($reqdfieldst, explode(" ", "string numeric"));
        }
        do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
        do_input_validation_type($_POST, $reqdfields, $reqdfieldsn, $reqdfieldst, &$input_errors);
    }
    if (!$input_errors) {
        $config['system']['swap']['enable'] = $_POST['enable'] ? true : false;
        $config['system']['swap']['type'] = $_POST['type'];
        $config['system']['swap']['mountpoint'] = $_POST['mountpoint'];
        $config['system']['swap']['devicespecialfile'] = $_POST['devicespecialfile'];
        $config['system']['swap']['size'] = $_POST['size'];
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("swap");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.type.disabled = endis;
	document.iform.mountpoint.disabled = endis;
	document.iform.size.disabled = endis;
	document.iform.devicespecialfile.disabled = endis;
Example #2
0
        $config['websrv']['dirlisting'] = isset($_POST['dirlisting']) ? true : false;
        // Write additional parameters.
        unset($config['websrv']['auxparam']);
        foreach (explode("\n", $_POST['auxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['websrv']['auxparam'][] = $auxparam;
            }
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("websrvauth", "websrvauth_process_updatenotification");
            config_lock();
            $retval |= rc_exec_service("websrv_htpasswd");
            $retval |= rc_update_service("websrv");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if (0 == $retval) {
            updatenotify_delete("websrvauth");
        }
    }
}
if (isset($_GET['act']) && $_GET['act'] === "del") {
    updatenotify_set("websrvauth", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']);
    header("Location: services_websrv.php");
    exit;
}
function websrvauth_process_updatenotification($mode, $data)
{
Example #3
0
if ($_GET['act'] === "retry") {
    $index = array_search_ex($_GET['uuid'], $config['mounts']['mount'], "uuid");
    if (false !== $index) {
        if (0 == disks_mount($config['mounts']['mount'][$index])) {
            rc_update_service("samba");
            rc_update_service("rsyncd");
            rc_update_service("afpd");
            rc_update_service("rpcbind");
            // !!! Do
            rc_update_service("mountd");
            // !!! not
            rc_update_service("nfsd");
            // !!! change
            rc_update_service("statd");
            // !!! this
            rc_update_service("lockd");
            // !!! order
        }
        header("Location: disks_mount.php");
        exit;
    }
}
function mountmanagement_process_updatenotification($mode, $data)
{
    global $config;
    if (!is_array($config['mounts']['mount'])) {
        return 1;
    }
    $index = array_search_ex($data, $config['mounts']['mount'], "uuid");
    if (false === $index) {
        return 1;
        // Encode string, otherwise line breaks will get lost
        $config['system']['sysconsaver']['enable'] = $_POST['sysconsaver'] ? true : false;
        $config['system']['sysconsaver']['blanktime'] = $_POST['sysconsaverblanktime'];
        $config['system']['enableserialconsole'] = $_POST['enableserialconsole'] ? true : false;
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_exec_service("rcconf.sh");
            $retval |= rc_update_service("powerd");
            $retval |= rc_update_service("mdnsresponder");
            $retval |= rc_exec_service("motd");
            if (isset($config['system']['tune'])) {
                $retval |= rc_update_service("sysctl");
            }
            $retval |= rc_update_service("syscons");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
function sysctl_tune($mode)
{
    global $config;
    if (!is_array($config['system']['sysctl']['param'])) {
        $config['system']['sysctl']['param'] = array();
    }
    array_sort_key($config['system']['sysctl']['param'], "name");
    $a_sysctlvar =& $config['system']['sysctl']['param'];
    $a_mib = array("net.inet.tcp.delayed_ack" => 0, "net.inet.tcp.rfc1323" => 1, "net.inet.tcp.sendspace" => 262144, "net.inet.tcp.recvspace" => 262144, "net.inet.udp.recvspace" => 65536, "net.inet.udp.maxdgram" => 57344, "net.local.stream.recvspace" => 65536, "net.local.stream.sendspace" => 65536, "kern.ipc.maxsockbuf" => 2097152, "kern.ipc.somaxconn" => 8192, "kern.ipc.nmbclusters" => 32768, "kern.maxfiles" => 65536, "kern.maxfilesperproc" => 32768, "net.inet.icmp.icmplim" => 300, "net.inet.icmp.icmplim_output" => 1, "net.inet.tcp.inflight.enable" => 0, "net.inet.tcp.path_mtu_discovery" => 0);
    switch ($mode) {
Example #5
0
	of the authors and should not be interpreted as representing official policies,
	either expressed or implied, of the NAS4Free Project.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Services"), gettext("FTP"), gettext("Modules"));
$pconfig['mod_ban_enable'] = isset($config['ftpd']['mod_ban']['enable']);
if ($_POST) {
    $pconfig = $_POST;
    $config['ftpd']['mod_ban']['enable'] = isset($_POST['mod_ban_enable']) ? true : false;
    write_config();
    $retval = 0;
    if (!file_exists($d_sysrebootreqd_path)) {
        $retval |= updatenotify_process("ftpd_mod_ban", "ftpd_mod_ban_process_updatenotification");
        config_lock();
        $retval |= rc_update_service("proftpd");
        config_unlock();
    }
    $savemsg = get_std_save_message($retval);
    if ($retval == 0) {
        updatenotify_delete("ftpd_mod_ban");
    }
}
if (!isset($config['ftpd']['mod_ban']['rule']) || !is_array($config['ftpd']['mod_ban']['rule'])) {
    $config['ftpd']['mod_ban']['rule'] = array();
}
$a_rule =& $config['ftpd']['mod_ban']['rule'];
if (isset($_GET['act']) && $_GET['act'] === "del") {
    if ($_GET['uuid'] === "all") {
        foreach ($a_rule as $rulek => $rulev) {
            updatenotify_set("ftpd_mod_ban", UPDATENOTIFY_MODE_DIRTY, $a_rule[$rulek]['uuid']);
	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 "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Disks"), gettext("Management"));
if ($_POST) {
    $pconfig = $_POST;
    if ($_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("device", "diskmanagement_process_updatenotification");
            config_lock();
            $retval |= rc_update_service("ataidle");
            $retval |= rc_update_service("smartd");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            updatenotify_delete("device");
        }
        header("Location: disks_manage.php");
        exit;
    }
    if ($_POST['disks_rescan']) {
        $do_action = true;
        $disks_rescan = true;
    }
}
if (!isset($do_action)) {
Example #7
0
        $config['ad']['username'] = $_POST['username'];
        $config['ad']['password'] = $_POST['password'];
        $config['ad']['enable'] = isset($_POST['enable']) ? true : false;
        if ($config['ad']['enable']) {
            $config['samba']['enable'] = true;
            $config['samba']['security'] = "ads";
            $config['samba']['workgroup'] = $_POST['domainname_netbios'];
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            rc_exec_service("pam");
            rc_exec_service("ldap");
            rc_start_service("nsswitch");
            rc_update_service("samba");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.domaincontrollername.disabled = endis;
	document.iform.domainname_dns.disabled = endis;
	document.iform.domainname_netbios.disabled = endis;
	document.iform.username.disabled = endis;
}
$a_timehour = array();
foreach (range(0, 23) as $hour) {
    $min = 0;
    $a_timehour[sprintf("%02.2d%02.2d", $hour, $min)] = sprintf("%02.2d:%02.2d", $hour, $min);
}
$a_lifetime = array("0" => gettext("infinity"), "1w" => sprintf(gettext("%d week"), 1), "2w" => sprintf(gettext("%d weeks"), 2), "30d" => sprintf(gettext("%d days"), 30), "60d" => sprintf(gettext("%d days"), 60), "90d" => sprintf(gettext("%d days"), 90), "180d" => sprintf(gettext("%d days"), 180), "1y" => sprintf(gettext("%d year"), 1), "2y" => sprintf(gettext("%d years"), 2));
if ($_POST) {
    $pconfig = $_POST;
    if (isset($_POST['apply']) && $_POST['apply']) {
        $ret = array("output" => array(), "retval" => 0);
        if (!file_exists($d_sysrebootreqd_path)) {
            // Process notifications
            $ret = zfs_updatenotify_process("zfsautosnapshot", "zfsautosnapshot_process_updatenotification");
            config_lock();
            $ret['retval'] |= rc_update_service("autosnapshot");
            config_unlock();
        }
        $savemsg = get_std_save_message($ret['retval']);
        if ($ret['retval'] == 0) {
            updatenotify_delete("zfsautosnapshot");
            header("Location: disks_zfs_snapshot_auto.php");
            exit;
        }
        updatenotify_delete("zfsautosnapshot");
        $errormsg = implode("\n", $ret['output']);
    }
}
if (isset($_GET['act']) && $_GET['act'] === "del") {
    $autosnapshot = array();
    $autosnapshot['uuid'] = $_GET['uuid'];
Example #9
0
        write_config();
        $retval = 0;
        config_lock();
        $retval |= rc_exec_service("userdb");
        config_unlock();
        if ($dir != "/nonexistent" && file_exists($dir)) {
            // adjust permission
            chmod($dir, 0755);
            chown($dir, $user);
            chgrp($dir, $group);
            // update auth method
            $cmd = "/usr/local/bin/sudo -u {$user} /usr/local/bin/VBoxManage setproperty websrvauthlibrary null";
            mwexec2("{$cmd} 2>&1", $rawdata, $result);
            if (!file_exists($d_sysrebootreqd_path)) {
                config_lock();
                $retval |= rc_update_service("vbox");
                config_unlock();
            }
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
	function enable_change(enable_change) {
		var endis = !($('#enable').prop('checked') || enable_change);
		$('#homedir').prop('disabled', endis);
		$('#homedirbrowsebtn').prop('disabled', endis);
		if (endis) {
Example #10
0
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Access"), gettext("Users"));
if ($_POST) {
    $pconfig = $_POST;
    if (isset($_POST['apply']) && $_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("userdb_user", "userdbuser_process_updatenotification");
            config_lock();
            $retval |= rc_exec_service("userdb");
            $retval |= rc_exec_service("websrv_htpasswd");
            $retval |= rc_exec_service("fmperm");
            if (isset($config['samba']['enable'])) {
                $retval |= rc_exec_service("passdb");
                $retval |= rc_update_service("samba");
            }
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            updatenotify_delete("userdb_user");
        }
    }
}
if (!isset($config['access']['user']) || !is_array($config['access']['user'])) {
    $config['access']['user'] = array();
}
array_sort_key($config['access']['user'], "login");
$a_user =& $config['access']['user'];
$a_group = system_get_group_list();
Example #11
0
                $config['lcdproc']['lcdproc']['param'][] = $param;
            }
        }
        unset($config['lcdproc']['lcdproc']['auxparam']);
        foreach (explode("\n", $_POST['lcdproc_auxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['lcdproc']['lcdproc']['auxparam'][] = $auxparam;
            }
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("LCDd");
            $retval |= rc_update_service("lcdproc");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);

	document.iform.driver.disabled = endis;
	document.iform.port.disabled = endis;
	document.iform.waittime.disabled = endis;
        $reqdfieldsn = array_merge($reqdfieldsn, array(gettext("Working directory")));
        do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
        // Check if working directory exists
        if (!$_POST['mkdir'] && !file_exists($_POST['workdir'])) {
            $input_errors[] = gettext("The working directory does not exist.");
        }
    }
    if (!$input_errors) {
        $config['unison']['workdir'] = $_POST['workdir'];
        $config['unison']['enable'] = $_POST['enable'] ? true : false;
        $config['unison']['mkdir'] = $_POST['mkdir'] ? true : false;
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("unison");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
if (!is_array($config['mounts']['mount'])) {
    $config['mounts']['mount'] = array();
}
array_sort_key($config['mounts']['mount'], "devicespecialfile");
$a_mount =& $config['mounts']['mount'];
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
Example #13
0
	SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

	The views and conclusions contained in the software and documentation are those
	of the authors and should not be interpreted as representing official policies,
	either expressed or implied, of the NAS4Free Project.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("sysctl.conf"));
if ($_POST) {
    if (isset($_POST['apply']) && $_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("sysctl", "sysctl_process_updatenotification");
            config_lock();
            $retval |= rc_update_service("sysctl");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            updatenotify_delete("sysctl");
        }
    }
}
if (!isset($config['system']['sysctl']['param']) || !is_array($config['system']['sysctl']['param'])) {
    $config['system']['sysctl']['param'] = array();
}
array_sort_key($config['system']['sysctl']['param'], "name");
$a_sysctlvar =& $config['system']['sysctl']['param'];
if (isset($_GET['act']) && $_GET['act'] === "del") {
    if ($_GET['id'] === "all") {
Example #14
0
        $config['ups']['email']['subject'] = $_POST['email_subject'];
        # Write additional parameters.
        unset($config['ups']['auxparam']);
        foreach (explode("\n", $_POST['auxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['ups']['auxparam'][] = $auxparam;
            }
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("nut");
            $retval |= rc_update_service("nut_upslog");
            $retval |= rc_update_service("nut_upsmon");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);

	if (enable_change.name == "email_enable") {
		endis = !enable_change.checked;
Example #15
0
            }
        }
        unset($config['kerberos']['sssdauxparam']);
        foreach (explode("\n", $_POST['sssdauxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['kerberos']['sssdauxparam'][] = $auxparam;
            }
        }
        $config['kerberos']['enable'] = isset($_POST['enable']) ? true : false;
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            rc_exec_service("kerberos");
            $retval |= rc_update_service("sssd");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
var types = [ 'sss', 'ldap' ];

function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.kdc.disabled = endis;
	document.iform.realms.disabled = endis;
            unset($pconfig['ocs_cacert'], $config['ocsinventory_agent']['ocs_cacert']);
        } elseif (!empty($_FILES['ocs_cacert']['tmp_name'])) {
            if (is_uploaded_file($_FILES['ocs_cacert']['tmp_name'])) {
                move_uploaded_file($_FILES['ocs_cacert']['tmp_name'], $fn);
                $config['ocsinventory_agent']['ocs_cacert'] = $fn;
                chmod($fn, 0600);
            } else {
                $input_errors[] = sprintf("%s %s", gettext("Failed to upload file."), $g_file_upload_error[$_FILES['ocs_cacert']['error']]);
            }
        }
        $config['ocsinventory_agent']['enable'] = isset($_POST['enable']) ? true : false;
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("ocsinventory_agent");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.server.disabled = endis;
	document.iform.realm.disabled = endis;
	document.iform.ocs_user.disabled = endis;
	document.iform.password.disabled = endis;
        $config['iscsitarget']['maxconnections'] = $_POST['maxconnections'];
        $config['iscsitarget']['firstburstlength'] = $_POST['firstburstlength'];
        $config['iscsitarget']['maxburstlength'] = $_POST['maxburstlength'];
        $config['iscsitarget']['maxrecvdatasegmentlength'] = $_POST['maxrecvdatasegmentlength'];
        $config['iscsitarget']['uctlenable'] = $_POST['uctlenable'] ? true : false;
        $config['iscsitarget']['uctladdress'] = $_POST['uctladdress'];
        $config['iscsitarget']['uctlport'] = $_POST['uctlport'];
        $config['iscsitarget']['uctlnetmask'] = $_POST['uctlnetmask'];
        $config['iscsitarget']['uctlauthmethod'] = $_POST['uctlauthmethod'];
        $config['iscsitarget']['uctlauthgroup'] = $_POST['uctlauthgroup'];
        $config['iscsitarget']['mediadirectory'] = $_POST['mediadirectory'];
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("iscsi_target");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
if (!is_array($config['iscsitarget']['portalgroup'])) {
    $config['iscsitarget']['portalgroup'] = array();
}
if (!is_array($config['iscsitarget']['initiatorgroup'])) {
    $config['iscsitarget']['initiatorgroup'] = array();
}
if (!is_array($config['iscsitarget']['authgroup'])) {
    $config['iscsitarget']['authgroup'] = array();
}
include "fbegin.inc";
            $config['bacula_sd']['device'][$device_nb]['removablemedia'] = isset($_POST['device'][$device_nb]['removablemedia']) ? true : false;
            $config['bacula_sd']['device'][$device_nb]['alwaysopen'] = isset($_POST['device'][$device_nb]['alwaysopen']) ? true : false;
        }
        unset($config['bacula_sd']['storageauxparam']);
        foreach (explode("\n", $_POST['storageauxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['bacula_sd']['storageauxparam'][] = $auxparam;
            }
        }
        $config['bacula_sd']['enable'] = isset($_POST['enable']) ? true : false;
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("bacula_sd");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change),
	device_length = <?php 
echo count($pconfig['device']);
?>
;
        $config['statusreport']['all_months'] = $_POST['all_months'];
        $config['statusreport']['all_weekdays'] = $_POST['all_weekdays'];
        write_config();
        if (stristr($_POST['Submit'], gettext("Send now"))) {
            // Send an email status report now.
            $retval = @report_send_mail();
            if (0 == $retval) {
                $savemsg = gettext("Status report successfully sent.");
            } else {
                $failmsg = sprintf(gettext("Failed to send status report. Please check the <a href='%s'>log</a> files."), "diag_log.php");
            }
        } else {
            // Configure cron job.
            if (!file_exists($d_sysrebootreqd_path)) {
                config_lock();
                $retval = rc_update_service("cron");
                config_unlock();
            }
            $savemsg = get_std_save_message($retval);
        }
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function set_selected(name) {
	document.getElementsByName(name)[1].checked = true;
}

function enable_change(enable_change) {
Example #20
0
        } else {
            $config['system']['rcconf']['param'][] = array("uuid" => uuid(), "name" => "powerd_flags", "value" => $pwopt, "comment" => "System power control options", "enable" => true);
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_exec_service("rcconf");
            $retval |= rc_update_service("powerd");
            $retval |= rc_update_service("mdnsresponder");
            $retval |= rc_exec_service("motd");
            if (isset($config['system']['tune'])) {
                $retval |= rc_update_service("sysctl");
            }
            $retval |= rc_update_service("syscons");
            $retval |= rc_update_service("fmperm");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
function sysctl_tune($mode)
{
    global $config;
    if (!is_array($config['system']['sysctl']['param'])) {
        $config['system']['sysctl']['param'] = array();
    }
    array_sort_key($config['system']['sysctl']['param'], "name");
    $a_sysctlvar =& $config['system']['sysctl']['param'];
    $a_mib = array("net.inet.tcp.delayed_ack" => 0, "net.inet.tcp.rfc1323" => 1, "net.inet.tcp.sendspace" => 262144, "net.inet.tcp.recvspace" => 262144, "net.inet.tcp.sendbuf_max" => 4194304, "net.inet.tcp.sendbuf_inc" => 262144, "net.inet.tcp.sendbuf_auto" => 1, "net.inet.tcp.recvbuf_max" => 4194304, "net.inet.tcp.recvbuf_inc" => 262144, "net.inet.tcp.recvbuf_auto" => 1, "net.inet.udp.recvspace" => 65536, "net.inet.udp.maxdgram" => 57344, "net.local.stream.recvspace" => 65536, "net.local.stream.sendspace" => 65536, "kern.ipc.maxsockbuf" => 16777216, "kern.ipc.somaxconn" => 8192, "kern.ipc.nmbclusters" => 262144, "kern.ipc.nmbjumbop" => 262144, "kern.ipc.nmbjumbo9" => 131072, "kern.ipc.nmbjumbo16" => 65536, "kern.maxfiles" => 65536, "kern.maxfilesperproc" => 32768, "net.inet.icmp.icmplim" => 300, "net.inet.icmp.icmplim_output" => 1, "net.inet.tcp.path_mtu_discovery" => 0, "hw.intr_storm_threshold" => 9000);
    switch ($mode) {
Example #21
0
            $retval |= rc_update_service("iscsi_target");
            $retval |= rc_update_service("bsnmpd");
            $retval |= rc_update_service("nut");
            $retval |= rc_update_service("nut_upslog");
            $retval |= rc_update_service("nut_upsmon");
            $retval |= rc_update_service("mdnsresponder");
            config_unlock();
        } else {
            write_config();
        }
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("hastd");
            if (false !== $mode) {
                updatenotify_set("cronjob", $mode, $cronjob['uuid']);
                $retval_cron |= rc_update_service("cron");
            }
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval_cron == 0) {
            updatenotify_delete("cronjob");
        }
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
	function enable_change(enable_change) {
		var val = !($('#enable').prop('checked') || enable_change);
Example #22
0
        $config['dynamicdns']['updateperiod'] = $_POST['updateperiod'];
        $config['dynamicdns']['forcedupdateperiod'] = $_POST['forcedupdateperiod'];
        $config['dynamicdns']['wildcard'] = isset($_POST['wildcard']) ? true : false;
        # Write additional parameters.
        unset($config['dynamicdns']['auxparam']);
        foreach (explode("\n", $_POST['auxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['dynamicdns']['auxparam'][] = $auxparam;
            }
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("inadyn");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
// Get list of available interfaces.
$a_interface = get_interface_list();
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.provider.disabled = endis;
	document.iform.domainname.disabled = endis;
    }
    if (!$input_errors) {
        $config['tftpd']['enable'] = $_POST['enable'] ? true : false;
        $config['tftpd']['dir'] = $_POST['dir'];
        $config['tftpd']['allowfilecreation'] = $_POST['allowfilecreation'] ? true : false;
        $config['tftpd']['port'] = $_POST['port'];
        $config['tftpd']['username'] = $_POST['username'];
        $config['tftpd']['umask'] = $_POST['umask'];
        $config['tftpd']['timeout'] = $_POST['timeout'];
        $config['tftpd']['maxblocksize'] = $_POST['maxblocksize'];
        $config['tftpd']['extraoptions'] = $_POST['extraoptions'];
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("tftpd");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.dir.disabled = endis;
	document.iform.dirbrowsebtn.disabled = endis;
	document.iform.allowfilecreation.disabled = endis;
	document.iform.port.disabled = endis;
Example #24
0
            $retval |= rc_update_service("inadyn");
            $retval |= rc_update_service("bsnmpd");
            $retval |= rc_update_service("nut");
            $retval |= rc_update_service("nut_upslog");
            $retval |= rc_update_service("nut_upsmon");
            $retval |= rc_exec_service("websrv_htpasswd");
            $retval |= rc_update_service("websrv");
            $retval |= rc_update_service("transmission");
            $retval |= rc_update_service("mdnsresponder");
            config_unlock();
        } else {
            write_config();
        }
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("hastd");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
	function enable_change(enable_change) {
		var val = !($('#enable').prop('checked') || enable_change);
		$('#auxparam').prop('disabled', val);
	}
	$('#enable').click(function(){
		enable_change(false);
        $config['snmpd']['modules']['netgraph'] = $_POST['netgraph'] ? true : false;
        $config['snmpd']['modules']['hostres'] = $_POST['hostres'] ? true : false;
        $config['snmpd']['modules']['ucd'] = $_POST['ucd'] ? true : false;
        // Write additional parameters.
        unset($config['snmpd']['auxparam']);
        foreach (explode("\n", $_POST['auxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['snmpd']['auxparam'][] = $auxparam;
            }
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("bsnmpd");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.location.disabled = endis;
	document.iform.contact.disabled = endis;
	document.iform.read.disabled = endis;
	document.iform.mibii.disabled = endis;
                header("Location: system_firewall.php");
                exit;
            }
        } else {
            $errormsg = sprintf("%s %s", gettext("Failed to upload file."), $g_file_upload_error[$_FILES['rulesfile']['error']]);
        }
    } else {
        if ($_POST) {
            $pconfig = $_POST;
            $config['system']['firewall']['enable'] = $_POST['enable'] ? true : false;
            write_config();
            $retval = 0;
            if (!file_exists($d_sysrebootreqd_path)) {
                $retval |= updatenotify_process("firewall", "firewall_process_updatenotification");
                config_lock();
                $retval |= rc_update_service("ipfw");
                config_unlock();
            }
            $savemsg = get_std_save_message($retval);
            if ($retval == 0) {
                updatenotify_delete("firewall");
            }
        }
    }
}
if (!is_array($config['system']['firewall']['rule'])) {
    $config['system']['firewall']['rule'] = array();
}
array_sort_key($config['system']['firewall']['rule'], "ruleno");
$a_rule =& $config['system']['firewall']['rule'];
if ($_GET['act'] === "del") {
Example #27
0
    $pconfig = $_POST;
    if ($_POST['enable'] && !($_POST['guest'] || $_POST['local'])) {
        $input_errors[] = gettext("You must select at least one authentication method.");
    }
    if (!$input_errors) {
        $config['afp']['enable'] = $_POST['enable'] ? true : false;
        $config['afp']['afpname'] = $_POST['afpname'];
        $config['afp']['guest'] = $_POST['guest'] ? true : false;
        $config['afp']['local'] = $_POST['local'] ? true : false;
        $config['afp']['noddp'] = $_POST['noddp'] ? true : false;
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("afpd");
            $retval |= rc_update_service("mdnsresponder");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.afpname.disabled = endis;
	document.iform.guest.disabled = endis;
	document.iform.local.disabled = endis;
	document.iform.noddp.disabled = endis;
Example #28
0
	The views and conclusions contained in the software and documentation are those
	of the authors and should not be interpreted as representing official policies,
	either expressed or implied, of the NAS4Free Project.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Disks"), gettext("Management"), gettext("iSCSI Initiator"));
if ($_POST) {
    $pconfig = $_POST;
    if (isset($_POST['apply']) && $_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("iscsiinitiator", "iscsiinitiator_process_updatenotification");
            config_lock();
            $retval |= rc_update_service("iscsi_initiator");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            updatenotify_delete("iscsiinitiator");
        }
    }
}
if (!isset($config['iscsiinit']['vdisk']) || !is_array($config['iscsiinit']['vdisk'])) {
    $config['iscsiinit']['vdisk'] = array();
}
array_sort_key($config['iscsiinit']['vdisk'], "name");
$a_iscsiinit =& $config['iscsiinit']['vdisk'];
if (isset($_GET['act']) && $_GET['act'] === "del") {
    updatenotify_set("iscsiinitiator", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']);