$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(); if (isset($_GET['act']) && $_GET['act'] === "del") { updatenotify_set("userdb_user", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: access_users.php"); exit; } function userdbuser_process_updatenotification($mode, $data)
$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']); } } else { updatenotify_set("ftpd_mod_ban", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); } header("Location: services_ftp_mod.php");
POSSIBILITY OF SUCH DAMAGE. */ require "auth.inc"; require "guiconfig.inc"; $pgtitle = array(gettext("Disks"), gettext("Software RAID"), gettext("RAID 0/1/5"), gettext("Management")); if ($_POST) { $pconfig = $_POST; if ($_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { // Process notifications $retval = updatenotify_process("raid_gvinum", "gvinum_process_updatenotification"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("raid_gvinum"); } header("Location: disks_raid_gvinum.php"); exit; } } if (!is_array($config['gvinum']['vdisk'])) { $config['gvinum']['vdisk'] = array(); } array_sort_key($config['gvinum']['vdisk'], "name"); $a_raid =& $config['gvinum']['vdisk']; if ($_GET['act'] === "del") { unset($errormsg); if ($a_raid[$_GET['id']]) { // Check if disk is mounted. if (0 == disks_ismounted_ex($a_raid[$_GET['id']]['devicespecialfile'], "devicespecialfile")) {
if (!isset($config['zfs']['pools']) || !is_array($config['zfs']['pools']['pool'])) { $config['zfs']['pools']['pool'] = array(); } array_sort_key($config['zfs']['pools']['pool'], "name"); $a_pool =& $config['zfs']['pools']['pool']; if ($_POST) { $pconfig = $_POST; if ($_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { // Process notifications updatenotify_process("zfszpool", "zfszpool_process_updatenotification"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("zfszpool"); } header("Location: disks_zfs_zpool.php"); exit; } } if ($_GET['act'] === "del") { updatenotify_set("zfszpool", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: disks_zfs_zpool.php"); exit; } function zfszpool_process_updatenotification($mode, $data) { global $config; $retval = 0; switch ($mode) {
either expressed or implied, of the NAS4Free Project. */ require "auth.inc"; require "guiconfig.inc"; $pgtitle = array(gettext("Disks"), gettext("Software RAID"), gettext("RAID1"), gettext("Management")); if ($_POST) { $pconfig = $_POST; if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { // Process notifications $retval = updatenotify_process("raid_gmirror", "gmirror_process_updatenotification"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("raid_gmirror"); } header("Location: disks_raid_gmirror.php"); exit; } } if (!isset($config['gmirror']['vdisk']) || !is_array($config['gmirror']['vdisk'])) { $config['gmirror']['vdisk'] = array(); } array_sort_key($config['gmirror']['vdisk'], "name"); $a_raid =& $config['gmirror']['vdisk']; if (isset($_GET['act']) && $_GET['act'] === "del") { unset($errormsg); if ($a_raid[$_GET['id']]) { // Check if disk is mounted. if (0 == disks_ismounted_ex($a_raid[$_GET['id']]['devicespecialfile'], "devicespecialfile")) {
$retval |= rc_update_service("rpcbind"); // !!! Do $retval |= rc_update_service("mountd"); // !!! not $retval |= rc_update_service("nfsd"); // !!! change $retval |= rc_update_service("statd"); // !!! this $retval |= rc_update_service("lockd"); // !!! order $retval |= rc_update_service("mdnsresponder"); config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("nfsshare"); } } } if (!isset($config['nfsd']['share']) || !is_array($config['nfsd']['share'])) { $config['nfsd']['share'] = array(); } array_sort_key($config['nfsd']['share'], "path"); $a_share =& $config['nfsd']['share']; if (isset($_GET['act']) && $_GET['act'] === "del") { updatenotify_set("nfsshare", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: services_nfs_share.php"); exit; } function nfsshare_process_updatenotification($mode, $data) {
if (!isset($config['zfs']['datasets']['dataset']) || !is_array($config['zfs']['datasets']['dataset'])) { $config['zfs']['datasets']['dataset'] = array(); } array_sort_key($config['zfs']['datasets']['dataset'], "name"); $a_dataset =& $config['zfs']['datasets']['dataset']; if ($_POST) { $pconfig = $_POST; if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { // Process notifications $retval |= updatenotify_process("zfsdataset", "zfsdataset_process_updatenotification"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("zfsdataset"); } header("Location: disks_zfs_dataset.php"); exit; } } if (isset($_GET['act']) && $_GET['act'] === "del") { updatenotify_set("zfsdataset", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: disks_zfs_dataset.php"); exit; } function zfsdataset_process_updatenotification($mode, $data) { global $config; $retval = 0; switch ($mode) {
require "guiconfig.inc"; $pgtitle = array(gettext("Services"), gettext("Rsync"), gettext("Client")); if ($_POST) { $pconfig = $_POST; if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("rsyncclient", "rsyncclient_process_updatenotification"); config_lock(); $retval |= rc_exec_service("rsync_client"); $retval |= rc_update_service("cron"); config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("rsyncclient"); } } } if (!isset($config['rsync']) || !is_array($config['rsync'])) { $config['rsync'] = array(); if (!isset($config['rsync']['rsyncclient']) || !is_array($config['rsync']['rsyncclient'])) { $config['rsync']['rsyncclient'] = array(); } } else { if (!isset($config['rsync']['rsyncclient']) || !is_array($config['rsync']['rsyncclient'])) { $config['rsync']['rsyncclient'] = array(); } } $a_rsyncclient =& $config['rsync']['rsyncclient']; if (isset($_GET['act']) && $_GET['act'] === "del") {
POSSIBILITY OF SUCH DAMAGE. */ require "auth.inc"; require "guiconfig.inc"; $pgtitle = array(gettext("Disks"), gettext("Software RAID"), gettext("RAID0"), gettext("Management")); if ($_POST) { $pconfig = $_POST; if ($_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { // Process notifications $retval = updatenotify_process("raid_gstripe", "gstripe_process_updatenotification"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("raid_gstripe"); } header("Location: disks_raid_gstripe.php"); exit; } } if (!is_array($config['gstripe']['vdisk'])) { $config['gstripe']['vdisk'] = array(); } array_sort_key($config['gstripe']['vdisk'], "name"); $a_raid =& $config['gstripe']['vdisk']; if ($_GET['act'] === "del") { unset($errormsg); if ($a_raid[$_GET['id']]) { // Check if disk is mounted. if (0 == disks_ismounted_ex($a_raid[$_GET['id']]['devicespecialfile'], "devicespecialfile")) {
require "guiconfig.inc"; $pgtitle = array(gettext("Services"), gettext("CIFS/SMB"), gettext("Shares")); if ($_POST) { $pconfig = $_POST; if ($_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("smbshare", "smbshare_process_updatenotification"); config_lock(); $retval |= rc_update_service("samba"); $retval |= rc_update_service("mdnsresponder"); config_unlock(); } $savemsg = get_std_save_message($retval); if (0 == $retval) { updatenotify_delete("smbshare"); } } } if (!is_array($config['samba']['share'])) { $config['samba']['share'] = array(); } array_sort_key($config['samba']['share'], "name"); $a_share =& $config['samba']['share']; if ($_GET['act'] === "del") { updatenotify_set("smbshare", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: services_samba_share.php"); exit; } function smbshare_process_updatenotification($mode, $data) {
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("loader.conf")); if ($_POST) { if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { touch($d_sysrebootreqd_path); } $retval |= updatenotify_process("loaderconf", "loaderconf_process_updatenotification"); $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("loaderconf"); } } } if (!isset($config['system']['loaderconf']['param']) || !is_array($config['system']['loaderconf']['param'])) { $config['system']['loaderconf']['param'] = array(); } array_sort_key($config['system']['loaderconf']['param'], "name"); $loader_param_list =& $config['system']['loaderconf']['param']; if (isset($_GET['act']) && $_GET['act'] === "del") { if ($_GET['id'] === "all") { foreach ($loader_param_list as $param_key => $param_value) { updatenotify_set("loaderconf", UPDATENOTIFY_MODE_DIRTY, $loader_param_list[$param_key]['uuid']); } } else { updatenotify_set("loaderconf", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']);
$config['smartd']['temp']['info'] = $_POST['temp_info']; $config['smartd']['temp']['crit'] = $_POST['temp_crit']; $config['smartd']['email']['enable'] = isset($_POST['email_enable']) ? true : false; $config['smartd']['email']['to'] = !empty($_POST['email_to']) ? $_POST['email_to'] : ""; $config['smartd']['email']['testemail'] = isset($_POST['email_testemail']) ? true : false; write_config(); $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("smartssd", "smartssd_process_updatenotification"); config_lock(); $retval |= rc_update_service("smartd"); config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("smartssd"); } } } if (!isset($config['disks']['disk']) || !is_array($config['disks']['disk'])) { $config['disks']['disk'] = array(); } if (!isset($config['smartd']['selftest']) || !is_array($config['smartd']['selftest'])) { $config['smartd']['selftest'] = array(); } $a_selftest =& $config['smartd']['selftest']; $a_type = array("S" => "Short Self-Test", "L" => "Long Self-Test", "C" => "Conveyance Self-Test", "O" => "Offline Immediate Test"); if (isset($_GET['act']) && $_GET['act'] === "del") { if ($_GET['uuid'] === "all") { foreach ($a_selftest as $selftestv) { updatenotify_set("smartssd", UPDATENOTIFY_MODE_DIRTY, $selftestv['uuid']);
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']; updatenotify_set("zfsautosnapshot", UPDATENOTIFY_MODE_DIRTY, serialize($autosnapshot)); header("Location: disks_zfs_snapshot_auto.php"); exit; } function zfsautosnapshot_process_updatenotification($mode, $data) { global $config; $ret = array("output" => array(), "retval" => 0); switch ($mode) {
either expressed or implied, of the NAS4Free Project. */ require "auth.inc"; require "guiconfig.inc"; $pgtitle = array(gettext("Disks"), gettext("Software RAID"), gettext("RAID5"), gettext("Management")); if ($_POST) { $pconfig = $_POST; if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { // Process notifications $retval = updatenotify_process("raid_graid5", "graid5_process_updatenotification"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("raid_graid5"); } header("Location: disks_raid_graid5.php"); exit; } } if (!isset($config['graid5']['vdisk']) || !is_array($config['graid5']['vdisk'])) { $config['graid5']['vdisk'] = array(); } array_sort_key($config['graid5']['vdisk'], "name"); $a_raid =& $config['graid5']['vdisk']; if (isset($_GET['act']) && $_GET['act'] === "del") { unset($errormsg); if ($a_raid[$_GET['id']]) { // Check if disk is mounted. if (0 == disks_ismounted_ex($a_raid[$_GET['id']]['devicespecialfile'], "devicespecialfile")) {
if ($root != '-') { $zfs['pools']['pool'][$index]['root'] = $root; } $zfs['pools']['pool'][$index]['size'] = $size; $zfs['pools']['pool'][$index]['cap'] = $cap; $zfs['pools']['pool'][$index]['health'] = $health; } if (updatenotify_exists('zfs_import_config')) { $notifications = updatenotify_get('zfs_import_config'); $retval = 0; foreach ($notifications as $notification) { $retval |= !($notification['data'] == true); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("zfs_import_config"); } } include "fbegin.inc"; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="tabnavtbl"> <ul id="tabnav"> <li class="tabinact"><a href="disks_zfs_zpool.php"><span><?php echo gettext("Pools"); ?> </span></a></li> <li class="tabinact"><a href="disks_zfs_dataset.php"><span><?php echo gettext("Datasets"); ?>
require "auth.inc"; require "guiconfig.inc"; $pgtitle = array(gettext("Access"), gettext("Groups")); if ($_POST) { $pconfig = $_POST; if ($_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("userdb_group", "userdbgroup_process_updatenotification"); config_lock(); $retval |= rc_exec_service("userdb"); config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("userdb_group"); } } } if (!is_array($config['access']['group'])) { $config['access']['group'] = array(); } array_sort_key($config['access']['group'], "name"); $a_group_conf =& $config['access']['group']; $a_group = system_get_group_list(); if ($_GET['act'] === "del") { updatenotify_set("userdb_group", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: access_users_groups.php"); exit; } function userdbgroup_process_updatenotification($mode, $data)
require "guiconfig.inc"; $pgtitle = array(gettext("Services"), gettext("Rsync"), gettext("Local")); if ($_POST) { $pconfig = $_POST; if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("rsynclocal", "rsynclocal_process_updatenotification"); config_lock(); $retval |= rc_exec_service("rsync_local"); $retval |= rc_update_service("cron"); config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("rsynclocal"); } } } if (!isset($config['rsync']) || !is_array($config['rsync'])) { $config['rsync'] = array(); if (!isset($config['rsync']['rsynclocal']) || !is_array($config['rsync']['rsynclocal'])) { $config['rsync']['rsynclocal'] = array(); } } else { if (!isset($config['rsync']['rsynclocal']) || !is_array($config['rsync']['rsynclocal'])) { $config['rsync']['rsynclocal'] = array(); } } $a_rsynclocal =& $config['rsync']['rsynclocal']; if (isset($_GET['act']) && $_GET['act'] === "del") {
if ($retval >= 0) { disks_update_mounts(); } //skip redirect //header("Location: disks_crypt.php"); //exit; } if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { // Process notifications $retval = updatenotify_process("geli", "geli_process_updatenotification"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("geli"); } header("Location: disks_crypt.php"); exit; } } if (!isset($config['geli']['vdisk']) || !is_array($config['geli']['vdisk'])) { $config['geli']['vdisk'] = array(); } array_sort_key($config['geli']['vdisk'], "devicespecialfile"); $a_geli =& $config['geli']['vdisk']; if (isset($_GET['act']) && $_GET['act'] === "del") { if (FALSE !== ($cnid = array_search_ex($_GET['uuid'], $config['geli']['vdisk'], "uuid"))) { if (disks_exists($config['geli']['vdisk'][$cnid]['devicespecialfile'])) { updatenotify_set("geli", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: disks_crypt.php");
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)) { $do_action = false; } if (!is_array($config['disks']['disk'])) { $config['disks']['disk'] = array(); }
if (!isset($config['zfs']['vdevices']['vdevice']) || !is_array($config['zfs']['vdevices']['vdevice'])) { $config['zfs']['vdevices']['vdevice'] = array(); } array_sort_key($config['zfs']['vdevices']['vdevice'], "name"); $a_vdevice =& $config['zfs']['vdevices']['vdevice']; if ($_POST) { $pconfig = $_POST; if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { // Process notifications updatenotify_process("zfsvdev", "zfsvdev_process_updatenotification"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("zfsvdev"); } header("Location: disks_zfs_zpool_vdevice.php"); exit; } } if (isset($_GET['act']) && $_GET['act'] === "del") { $index = array_search_ex($_GET['uuid'], $config['zfs']['vdevices']['vdevice'], "uuid"); if (false !== $index) { updatenotify_set("zfsvdev", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: disks_zfs_zpool_vdevice.php"); exit; } } function zfsvdev_process_updatenotification($mode, $data) {
require "guiconfig.inc"; $pgtitle = array(gettext("Services"), gettext("Rsync"), gettext("Server"), gettext("Modules")); if ($_POST) { $pconfig = $_POST; if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("rsyncd", "rsyncd_process_updatenotification"); config_lock(); $retval |= rc_update_service("rsyncd"); $retval |= rc_update_service("mdnsresponder"); config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("rsyncd"); } } } if (!isset($config['rsyncd']['module']) || !is_array($config['rsyncd']['module'])) { $config['rsyncd']['module'] = array(); } array_sort_key($config['rsyncd']['module'], "name"); $a_module =& $config['rsyncd']['module']; if (isset($_GET['act']) && $_GET['act'] === "del") { updatenotify_set("rsyncd", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: services_rsyncd_module.php"); exit; } function rsyncd_process_updatenotification($mode, $data) {
} write_config(); } } if (isset($_POST['apply']) && $_POST['apply'] || isset($_POST['Submit']) && $_POST['Submit']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("hosts", "hosts_process_updatenotification"); config_lock(); $retval |= rc_exec_service("hosts"); // Update /etc/hosts config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("hosts"); } } } if (!isset($config['system']['hosts']) || !is_array($config['system']['hosts'])) { $config['system']['hosts'] = array(); } if (!isset($config['system']['hostsacl']['rule']) || !is_array($config['system']['hostsacl']['rule'])) { $config['system']['hostsacl']['rule'] = array(); } array_sort_key($config['system']['hosts'], "name"); $a_hosts = $config['system']['hosts']; if (is_array($config['system']['hostsacl']['rule'])) { $pconfig['hostsacl'] = implode("\n", $config['system']['hostsacl']['rule']); } if (isset($_GET['act']) && $_GET['act'] === "del") {
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); $('#auxparam').prop('disabled', val); $('#alertemail').prop('disabled', val); $('#alertemailto').prop('disabled', val); } $('#enable').click(function(){ enable_change(false);
*/ require "auth.inc"; require "guiconfig.inc"; $pgtitle = array(gettext("System"), gettext("Advanced"), gettext("rc.conf")); if ($_POST) { if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("rcconf", "rcconf_process_updatenotification"); config_lock(); $retval |= rc_exec_service("rcconf"); config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("rcconf"); } } } if (!isset($config['system']['rcconf']['param']) || !is_array($config['system']['rcconf']['param'])) { $config['system']['rcconf']['param'] = array(); } array_sort_key($config['system']['rcconf']['param'], "name"); $a_rcvar =& $config['system']['rcconf']['param']; if (isset($_GET['act']) && $_GET['act'] === "del") { if ($_GET['uuid'] === "all") { foreach ($a_rcvar as $rcvarv) { updatenotify_set("rcconf", UPDATENOTIFY_MODE_DIRTY, $rcvarv['uuid']); } } else { updatenotify_set("rcconf", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']);
require "guiconfig.inc"; $pgtitle = array(gettext("Services"), gettext("AFP"), gettext("Shares")); if ($_POST) { $pconfig = $_POST; if (isset($_POST['apply']) && $_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("afpshare", "afpshare_process_updatenotification"); config_lock(); $retval |= rc_update_service("afpd"); $retval |= rc_update_service("mdnsresponder"); config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("afpshare"); } } } if (!isset($config['afp']['share']) || !is_array($config['afp']['share'])) { $config['afp']['share'] = array(); } array_sort_key($config['afp']['share'], "name"); $a_share =& $config['afp']['share']; if (isset($_GET['act']) && $_GET['act'] === "del") { updatenotify_set("afpshare", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: services_afp_share.php"); exit; } function afpshare_process_updatenotification($mode, $data) {
} } 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") { if ($_GET['uuid'] === "all") { foreach ($a_rule as $rulek => $rulev) { updatenotify_set("firewall", UPDATENOTIFY_MODE_DIRTY, $a_rule[$rulek]['uuid']); } } else {
if (isset($_POST['apply']) && $_POST['apply']) { write_config(); $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("iscsitarget_ig", "iscsitargetig_process_updatenotification"); config_lock(); $retval |= rc_update_reload_service("iscsi_target"); config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { if (get_hast_role() != 'secondary') { $savemsg .= "<br>"; $savemsg .= sprintf(gettext("The reloading request has been sent to the daemon. You can see the result by <a href=\"%s\">Log</a>."), "diag_log.php?log=2"); } updatenotify_delete("iscsitarget_ig"); } } } if (!isset($config['iscsitarget']['initiatorgroup']) || !is_array($config['iscsitarget']['initiatorgroup'])) { $config['iscsitarget']['initiatorgroup'] = array(); } array_sort_key($config['iscsitarget']['initiatorgroup'], "tag"); $a_iscsitarget_ig =& $config['iscsitarget']['initiatorgroup']; if (!isset($config['iscsitarget']['target']) || !is_array($config['iscsitarget']['target'])) { $config['iscsitarget']['target'] = array(); } if (isset($_GET['act']) && $_GET['act'] === "del") { $index = array_search_ex($_GET['uuid'], $config['iscsitarget']['initiatorgroup'], "uuid"); if ($index !== false) { $ig = $config['iscsitarget']['initiatorgroup'][$index];
POSSIBILITY OF SUCH DAMAGE. */ require "auth.inc"; require "guiconfig.inc"; $pgtitle = array(gettext("Network"), gettext("Static routes")); if ($_POST) { $pconfig = $_POST; if ($_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { $retval |= updatenotify_process("routes", "routes_process_updatenotification"); $retval |= rc_start_service("routing"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("routes"); } } } if (!is_array($config['staticroutes']['route'])) { $config['staticroutes']['route'] = array(); } array_sort_key($config['staticroutes']['route'], "network"); $a_routes =& $config['staticroutes']['route']; if ($_GET['act'] === "del") { updatenotify_set("routes", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']); header("Location: system_routes.php"); exit; } function routes_process_updatenotification($mode, $data) {
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) { global $config; $retval = 0; switch ($mode) { case UPDATENOTIFY_MODE_NEW: case UPDATENOTIFY_MODE_MODIFIED:
POSSIBILITY OF SUCH DAMAGE. */ require "auth.inc"; require "guiconfig.inc"; $pgtitle = array(gettext("Disks"), gettext("Software RAID"), gettext("JBOD"), gettext("Management")); if ($_POST) { $pconfig = $_POST; if ($_POST['apply']) { $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { // Process notifications $retval = updatenotify_process("raid_gconcat", "gconcat_process_updatenotification"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { updatenotify_delete("raid_gconcat"); } header("Location: disks_raid_gconcat.php"); exit; } } if (!is_array($config['gconcat']['vdisk'])) { $config['gconcat']['vdisk'] = array(); } array_sort_key($config['gconcat']['vdisk'], "name"); $a_raid =& $config['gconcat']['vdisk']; if ($_GET['act'] === "del") { unset($errormsg); if ($a_raid[$_GET['id']]) { // Check if disk is mounted. if (0 == disks_ismounted_ex($a_raid[$_GET['id']]['devicespecialfile'], "devicespecialfile")) {