// set pointers to the actual configuration variables $cfgPtr['hostname'] =& $config['system']['hostname']; $cfgPtr['domain'] =& $config['system']['domain']; $cfgPtr['username'] =& $config['system']['username']; $cfgPtr['password'] =& $config['system']['password']; $cfgPtr['webuiport'] =& $config['system']['webgui']['port']; $cfgPtr['language'] =& $config['system']['webgui']['language']; $cfgPtr['timezone'] =& $config['system']['timezone']; $cfgPtr['timeupdateinterval'] =& $config['system']['time-update-interval']; $cfgPtr['timeservers'] =& $config['system']['timeservers']; // this content is stored encoded as base64 //$cfgPtr['notes'] = &$config['system']['notes']; // if ($_POST) { // get back the form object state and update it according to user input $form->wake($_SESSION[$sessionName]); // validate user input $form->validForm($form); // check no errors collected... $input_errors = $form->get_errQueue(); // 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)) {
// set a pointer to the actual configuration variables $cfgPtr =& $config['system']['storage']; // form object session name $cfgSvcName = 'frmSvcCfg'; // json return data $data = array(); $data['retval'] = 1; $data['errors'] = array(); // basics checks if (!isset($_POST)) { $data['errors'][] = _('Missing parameters, process aborted!'); } // instantiate the service binding configuration form object $confForm = new cfgForm('sys_storage_edit.php', 'method=post|name=confform|id=confform'); // get back the form object state and update it according to user input $confForm->wake($_SESSION[$cfgSvcName]); // validate user input $confForm->validForm(); $data['errors'] = $confForm->get_errQueue(); // something failed? if (count($data['errors']) > 0) { exit(json_encode($data)); } $svcMount = $confForm->getFldValue('fsmount'); $cfgPtr['fsmounts'][$svcMount]['uuid'] = $confForm->getFldValue('uuid'); $cfgPtr['fsmounts'][$svcMount]['label'] = $confForm->getFldValue('label'); $cfgPtr['fsmounts'][$svcMount]['filesystem'] = $confForm->getFldValue('filesystem'); $cfgPtr['fsmounts'][$svcMount]['comment'] = $confForm->getFldValue('desc'); $cfgPtr['fsmounts'][$svcMount]['active'] = $confForm->getFldValue('active'); $svcAvail = getAvailServices(); $svcSetNow = null;