field_text("dbAddress"); $form->field_text("dbName"); $form->field_text("dbUser"); $form->field_text("dbPass", null, false); $form->field_enum("settSSL", array("force", "neither", "forbid")); if (!$form->populate($input)) { $this->logFormErrors($form); return; } /* TODO -- test database connection before proceeding */ $f = fopen($this->CONF_FILE, "w"); if (!$f) { $this->logError("Can not create configuration file"); return; } fwrite($f, "dbAddress . "';\n"); fwrite($f, "\$_SCROTT['dbName'] = '" . $form->dbName . "';\n"); fwrite($f, "\$_SCROTT['dbUser'] = '" . $form->dbUser . "';\n"); fwrite($f, "\$_SCROTT['dbPass'] = '" . $form->dbPass . "';\n"); fwrite($f, "\$_SCROTT['settSSL'] = '" . $form->settSSL . "';\n"); fwrite($f, "?>\n"); fclose($f); $this->redirectTo($this->ar()); } } ?>