コード例 #1
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("iSCSI Target"), gettext("Target"));
$pconfig['enable'] = isset($config['iscsitarget']['enable']);
if ($_POST) {
    $pconfig = $_POST;
    //$config['iscsitarget']['enable'] = $_POST['enable'] ? true : false;
    if (isset($_POST['apply']) && $_POST['apply']) {
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("iscsitarget_extent", "iscsitargetextent_process_updatenotification");
            $retval |= updatenotify_process("iscsitarget_target", "iscsitargettarget_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_extent");
            updatenotify_delete("iscsitarget_target");
        }
    }
}
コード例 #2
0
ファイル: services_ftp_mod.php プロジェクト: sdoney/nas4free
	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("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") {
コード例 #3
0
	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 "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") {
コード例 #4
0
	(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
	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("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");
コード例 #5
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("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") {
コード例 #6
0
	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 "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']);
コード例 #7
0
	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 "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;
コード例 #8
0
        }
    }
    if (empty($input_errors)) {
        $config['smartd']['enable'] = isset($_POST['enable']) ? true : false;
        $config['smartd']['interval'] = $_POST['interval'];
        $config['smartd']['powermode'] = $_POST['powermode'];
        $config['smartd']['temp']['diff'] = $_POST['temp_diff'];
        $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();
コード例 #9
0
ファイル: system_loaderconf.php プロジェクト: sdoney/nas4free
	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("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']);
コード例 #10
0
ファイル: access_users.php プロジェクト: rterbush/nas4free
	(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
	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("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");
        }
    }
コード例 #11
0
ファイル: disks_raid_graid5.php プロジェクト: sdoney/nas4free
	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("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") {
コード例 #12
0
	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 "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") {
コード例 #13
0
require "auth.inc";
require "guiconfig.inc";
require "zfs.inc";
$pgtitle = array(gettext("Disks"), gettext("ZFS"), gettext("Volumes"), gettext("Volume"));
if (!isset($config['zfs']['volumes']['volume']) || !is_array($config['zfs']['volumes']['volume'])) {
    $config['zfs']['volumes']['volume'] = array();
}
array_sort_key($config['zfs']['volumes']['volume'], "name");
$a_volume =& $config['zfs']['volumes']['volume'];
if ($_POST) {
    $pconfig = $_POST;
    if (isset($_POST['apply']) && $_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            // Process notifications
            $retval |= updatenotify_process("zfsvolume", "zfsvolume_process_updatenotification");
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            updatenotify_delete("zfsvolume");
        }
        header("Location: disks_zfs_volume.php");
        exit;
    }
}
if (isset($_GET['act']) && $_GET['act'] === "del") {
    updatenotify_set("zfsvolume", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']);
    header("Location: disks_zfs_volume.php");
    exit;
}
function get_volsize($pool, $name)
コード例 #14
0
ファイル: system_sysctl.php プロジェクト: sdoney/nas4free
	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.

	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'];
コード例 #15
0
ファイル: system_rcconf.php プロジェクト: rterbush/nas4free
	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.

	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("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'];
コード例 #16
0
	(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
	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("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();
コード例 #17
0
                }
                write_config();
                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");
コード例 #18
0
	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 "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") {
コード例 #19
0
	(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
	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("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();
コード例 #20
0
	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 "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'];
コード例 #21
0
require "auth.inc";
require "guiconfig.inc";
require "zfs.inc";
$pgtitle = array(gettext("Disks"), gettext("ZFS"), gettext("Datasets"), gettext("Dataset"));
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)
コード例 #22
0
ファイル: system_cron.php プロジェクト: rterbush/nas4free
	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.

	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("Cron"));
if ($_POST) {
    if (isset($_POST['apply']) && $_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("cronjob", "cronjob_process_updatenotification");
            config_lock();
            $retval |= rc_update_service("cron");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            updatenotify_delete("cronjob");
        }
    }
}
if (!isset($config['cron']['job']) || !is_array($config['cron']['job'])) {
    $config['cron']['job'] = array();
}
$a_cron =& $config['cron']['job'];
if (isset($_GET['act']) && $_GET['act'] === "del") {
コード例 #23
0
require "auth.inc";
require "guiconfig.inc";
require "zfs.inc";
$pgtitle = array(gettext("Disks"), gettext("ZFS"), gettext("Pools"), gettext("Management"));
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)
コード例 #24
0
ファイル: disks_crypt.php プロジェクト: sdoney/nas4free
            } else {
                $input_errors[] = gettext("detected an error while importing.");
            }
        }
        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") {
コード例 #25
0
	(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
	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("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");
コード例 #26
0
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Disks"), gettext("ZFS"), gettext("Pools"), gettext("Virtual device"));
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;
コード例 #27
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("Services"), gettext("iSCSI Target"), gettext("Initiator Group"));
if ($_POST) {
    $pconfig = $_POST;
    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'])) {
コード例 #28
0
ファイル: system_hosts.php プロジェクト: rterbush/nas4free
        $pconfig = $_POST;
        if (empty($input_errors)) {
            unset($config['system']['hostsacl']['rule']);
            foreach (explode("\n", $_POST['hostsacl']) as $rule) {
                $rule = trim($rule, "\t\n\r");
                if (!empty($rule)) {
                    $config['system']['hostsacl']['rule'][] = $rule;
                }
            }
            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'])) {
コード例 #29
0
ファイル: services_websrv.php プロジェクト: sdoney/nas4free
        $config['websrv']['privatekey'] = base64_encode($_POST['privatekey']);
        $config['websrv']['certificate'] = base64_encode($_POST['certificate']);
        $config['websrv']['authentication']['enable'] = isset($_POST['authentication']) ? true : false;
        $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;
コード例 #30
0
	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 "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Disks"), gettext("Mount Point"), gettext("Management"));
if ($_POST) {
    $pconfig = $_POST;
    if ($_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            // Process notifications
            updatenotify_process("mountpoint", "mountmanagement_process_updatenotification");
            // Restart services
            config_lock();
            $retval |= rc_update_service("samba");
            $retval |= rc_update_service("rsyncd");
            $retval |= rc_update_service("afpd");
            $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