$rsyncclient['options']['extraoptions'] = $_POST['extraoptions'];
        if (isset($uuid) && FALSE !== $cnid) {
            $a_rsyncclient[$cnid] = $rsyncclient;
            $mode = UPDATENOTIFY_MODE_MODIFIED;
        } else {
            $a_rsyncclient[] = $rsyncclient;
            $mode = UPDATENOTIFY_MODE_NEW;
        }
        updatenotify_set("rsyncclient", $mode, $rsyncclient['uuid']);
        write_config();
        if (stristr($_POST['Submit'], gettext("Execute now"))) {
            $retval = 0;
            // Update scripts and execute it.
            config_lock();
            $retval |= rc_exec_service("rsync_client");
            $retval |= rc_exec_script("/var/run/rsync_client_{$rsyncclient['uuid']}.sh");
            config_unlock();
            $savemsg = get_std_save_message($retval);
        } else {
            header("Location: services_rsyncd_client.php");
            exit;
        }
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function set_selected(name) {
	document.getElementsByName(name)[1].checked = true;
}
Exemple #2
0
     do_input_validation_type($_POST, $reqdfields, $reqdfieldsn, $reqdfieldst, $input_errors);
 }
 if (empty($input_errors)) {
     $config['nfsd']['enable'] = isset($_POST['enable']) ? true : false;
     $config['nfsd']['v4enable'] = isset($_POST['v4enable']) ? true : false;
     $config['nfsd']['numproc'] = $_POST['numproc'];
     $v4state = $config['nfsd']['v4enable'] == true ? "enable" : "disable";
     write_config();
     $retval = 0;
     if (!file_exists($d_sysrebootreqd_path)) {
         config_lock();
         rc_exec_script("/etc/rc.d/nfsuserd forcestop");
         $retval |= mwexec("/usr/local/sbin/rconf service {$v4state} nfsv4_server");
         $retval |= mwexec("/usr/local/sbin/rconf service {$v4state} nfsuserd");
         if (isset($config['nfsd']['enable']) && isset($config['nfsd']['v4enable'])) {
             $retval |= rc_exec_script("/etc/rc.d/nfsuserd start");
         }
         $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);
            $a_rsyncclient[] = $rsyncclient;
            $mode = UPDATENOTIFY_MODE_NEW;
        }
        updatenotify_set("rsyncclient", $mode, $rsyncclient['uuid']);
        write_config();
        if (!empty($_POST['Submit']) && stristr($_POST['Submit'], gettext("Execute now"))) {
            $retval = 0;
            // Update scripts and execute it.
            config_lock();
            $retval |= rc_exec_service("rsync_client");
            $retval |= rc_update_service("cron");
            config_unlock();
            if ($retval == 0) {
                updatenotify_clear("rsyncclient", $rsyncclient['uuid']);
            }
            $retval |= rc_exec_script("su -m {$rsyncclient['who']} -c '/bin/sh /var/run/rsync_client_{$rsyncclient['uuid']}.sh'");
            $savemsg = get_std_save_message($retval);
        } else {
            header("Location: services_rsyncd_client.php");
            exit;
        }
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function set_selected(name) {
	document.getElementsByName(name)[1].checked = true;
}
        $rsynclocal['options']['extraoptions'] = $_POST['extraoptions'];
        if (isset($uuid) && FALSE !== $cnid) {
            $a_rsynclocal[$cnid] = $rsynclocal;
            $mode = UPDATENOTIFY_MODE_MODIFIED;
        } else {
            $a_rsynclocal[] = $rsynclocal;
            $mode = UPDATENOTIFY_MODE_NEW;
        }
        updatenotify_set("rsynclocal", $mode, $rsynclocal['uuid']);
        write_config();
        if (stristr($_POST['Submit'], gettext("Execute now"))) {
            $retval = 0;
            // Update scripts and execute it.
            config_lock();
            $retval |= rc_exec_service("rsync_local");
            $retval |= rc_exec_script("/var/run/rsync_local_{$rsynclocal['uuid']}.sh");
            config_unlock();
            $savemsg = get_std_save_message($retval);
        } else {
            header("Location: services_rsyncd_local.php");
            exit;
        }
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function set_selected(name) {
	document.getElementsByName(name)[1].checked = true;
}
             $input_errors[] = gettext("Image upload failed (out of memory?)");
         } else {
             /* move the image so PHP won't delete it */
             move_uploaded_file($_FILES['ulfile']['tmp_name'], "{$g['ftmp_path']}/firmware.gz.img");
             if (!verify_gzip_file("{$g['ftmp_path']}/firmware.gz.img")) {
                 $input_errors[] = gettext("The image file is corrupt");
                 unlink("{$g['ftmp_path']}/firmware.gz.img");
             }
         }
     }
 } else {
     $input_errors[] = gettext("Image upload failed (out of memory?)");
 }
 // Cleanup if there were errors.
 if (!empty($input_errors)) {
     rc_exec_script("/etc/rc.firmware disable");
     unlink_if_exists($d_fwupenabled_path);
 }
 // Upgrade firmware if there were no errors.
 if (empty($input_errors) && !file_exists($d_firmwarelock_path) && (empty($sig_warning) || $_POST['sig_override'])) {
     touch($d_firmwarelock_path);
     switch ($g['platform']) {
         case "embedded":
             rc_exec_script_async("/etc/rc.firmware upgrade {$g['ftmp_path']}/firmware.gz.img");
             break;
         case "full":
             rc_exec_script_async("/etc/rc.firmware fullupgrade {$g['ftmp_path']}/firmware.gz.img");
             break;
     }
     $savemsg = sprintf(gettext("The firmware is now being installed. The server will reboot automatically."));
     // Clean firmwarelock: Permit to force all pages to be redirect on the firmware page.
Exemple #6
0
$pconfig['enable'] = isset($config['vbox']['enable']);
$pconfig['homedir'] = $config['vbox']['homedir'];
if ($_POST) {
    unset($input_errors);
    unset($errormsg);
    $pconfig = $_POST;
    if (isset($_POST['enable'])) {
        $reqdfields = explode(" ", "homedir");
        $reqdfieldsn = array(gettext("Home directory"));
        $reqdfieldst = explode(" ", "string");
        do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
        do_input_validation_type($_POST, $reqdfields, $reqdfieldsn, $reqdfieldst, $input_errors);
    } else {
        // disable VirtualBox
        config_lock();
        $retval |= rc_exec_script("/etc/rc.d/vbox onestop");
        config_unlock();
    }
    if (empty($input_errors)) {
        $config['vbox']['enable'] = isset($_POST['enable']) ? true : false;
        $config['vbox']['homedir'] = $_POST['homedir'];
        $dir = $config['vbox']['homedir'];
        if ($dir == '' || !file_exists($dir)) {
            $dir = "/nonexistent";
        }
        // update homedir
        $user = "******";
        $group = "vboxusers";
        $opt = "-c \"Virtualbox user\" -d \"{$dir}\" -s /usr/sbin/nologin";
        $index = array_search_ex($user, $config['system']['usermanagement']['user'], "name");
        if ($index != false) {
            $a_rsynclocal[] = $rsynclocal;
            $mode = UPDATENOTIFY_MODE_NEW;
        }
        updatenotify_set("rsynclocal", $mode, $rsynclocal['uuid']);
        write_config();
        if (!empty($_POST['Submit']) && stristr($_POST['Submit'], gettext("Execute now"))) {
            $retval = 0;
            // Update scripts and execute it.
            config_lock();
            $retval |= rc_exec_service("rsync_local");
            $retval |= rc_update_service("cron");
            config_unlock();
            if ($retval == 0) {
                updatenotify_clear("rsynclocal", $rsynclocal['uuid']);
            }
            $retval |= rc_exec_script("su -m {$rsynclocal['who']} -c '/bin/sh /var/run/rsync_local_{$rsynclocal['uuid']}.sh'");
            $savemsg = get_std_save_message($retval);
        } else {
            header("Location: services_rsyncd_local.php");
            exit;
        }
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function set_selected(name) {
	document.getElementsByName(name)[1].checked = true;
}