Example #1
0
 public function executeSystemParameters(sfWebRequest $request)
 {
     $error = 0;
     $this->forward404Unless($request->isMethod(sfRequest::POST));
     //If the HTTP method is "post", get the values entered by the user:
     $this->values = array('ip_address' => $this->getRequestParameter('ip_address'), 'srv_port' => $this->getRequestParameter('srv_port'), 'dbms' => $this->getRequestParameter('dbms') + 1, 'db_name' => $this->getRequestParameter('db_name'), 'db_user_name' => $this->getRequestParameter('db_user_name'), 'db_password' => $this->getRequestParameter('db_password'), '_csrf_token' => $this->getRequestParameter('_csrf_token'));
     //Build the form with theses values:
     $form = new SystemParametersForm($this->values);
     //Execute the validators of this form:
     $form->bind($this->values);
     //If everything is fine:
     if ($form->isValid()) {
         //Insert the new values in the xml configuration file:*/
         ParametersConfiguration::setBddParams($this->values);
         ParametersConfiguration::editYaml();
         sfToolkit::clearGlob(sfConfig::get('sf_cache_dir') . '/install/*');
         $this->redirect('firstBoot/stepTwo');
     } else {
         $this->form = $form;
         $this->setTemplate("stepOne");
     }
 }