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'])) {
    $config['iscsitarget']['initiatorgroup'] = array();
}
示例#2
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("CIFS/SMB"), gettext("Shares"));
if ($_POST) {
    $pconfig = $_POST;
    if (isset($_POST['apply']) && $_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("smbshare", "smbshare_process_updatenotification");
            config_lock();
            // reload config if enabled
            if (isset($config['samba']['enable']) === true) {
                $retval |= rc_update_reload_service("samba");
            } else {
                $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 (!isset($config['samba']['share']) || !is_array($config['samba']['share'])) {
    $config['samba']['share'] = array();
}