public function execute(HTTPRequestCustom $request) { parent::load_lang($request); $this->build_form(); if ($this->submit_button->has_been_submited() && $this->form->validate()) { $login = $this->form->get_value('email'); if ($this->form->get_value('custom_login', false)) { $login = $this->form->get_value('login'); } $installation_services = new InstallationServices(); $installation_services->create_admin($login, $this->form->get_value('password'), $this->form->get_value('email'), $this->form->get_value('createSession'), $this->form->get_value('autoconnect')); HtaccessFileCache::regenerate(); AppContext::get_response()->redirect(InstallUrlBuilder::finish()); } return $this->create_response(); }
private function install() { CLIOutput::writeln('installation'); $this->installation = new InstallationServices($this->website_locale); CLIOutput::writeln("\t" . 'kernel...'); if (!$this->create_phpboost_tables()) { return false; } CLIOutput::writeln("\t" . 'modules...'); if (!$this->installation->configure_website($this->website_server, $this->website_path, $this->website_name, $this->website_slogan, $this->website_description, $this->website_timezone)) { return false; } CLIOutput::writeln("\t" . 'admin creation...'); if (!$this->installation->create_admin($this->user_login, $this->user_password, $this->user_email, false, false)) { return false; } $this->installation->save_server_environnement_config(); CLIOutput::writeln('installation successfull'); return true; }