Пример #1
0
    if (count($input_errors) == 0) {
        $changedFields = $form->getFields($cfgPtr, 'password|webuiport');
        if (in_array('password', $changedFields)) {
            // set a persistent flag to notify that a system reboot is required
            touch($d_passworddirty_path);
            touch($d_sysrebootreqd_path);
        }
        $retval = 0;
        write_config();
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            // update system settings
            $retval = system_hostname_configure();
            $retval |= system_hosts_generate();
            $retval |= writeSysRegSettings($config);
            $retval |= system_cron_configure();
            // update application specific settings
            //
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
} else {
    // prepare the configuration form
    $form->startFieldSet('fset_sysmanage', _('Management'));
    $form->startBlock('rw_username');
    $form->setLabel(null, _('Username'), 'username', 'class=labelcol');
    $form->startBlock('rw_username', 'right');
    $form->setField('username', 'text', 'size=20|maxlength=64|class=required');
    $form->setDefault('username', 'admin');
    $form->setInputText('username', $cfgPtr['username']);
Пример #2
0
echo ' - Configuring console ... ';
system_update_shell_password();
system_console_configure();
system_sshd_configure();
echo 'done', PHP_EOL;
/* start dyndns service */
echo ' - Configuring dyndns... ';
services_dyndns_configure();
echo 'done', PHP_EOL;
/* static IP address? -> attempt DNS update */
/*
	if ($config['interfaces']['lan']['topology'] == "public" ||
		$config['interfaces']['lan']['topology'] == "natstatic")
		services_dnsupdate_process();*/
/* run any shell commands specified in config.xml */
echo ' - Running shell commands... ';
system_do_shell_commands();
echo 'done', PHP_EOL;
/* configure/run platform specific applications */
if (is_callable('startApplianceBundle')) {
    startApplianceBundle($config);
}
echo ' - Configuring cron services... ';
system_cron_configure();
echo 'done', PHP_EOL;
echo ' - Configuring displays... ';
system_displays_configure();
echo 'done', PHP_EOL;
/* done */
unlink("{$g['varrun_path']}/booting");
$g['booting'] = false;