예제 #1
0
 /**
  * Renders the page for creating the master account.
  *
  * This page performs the following steps:
  * 1. Check that the master account doesn't already exist.  If it does, redirect to the home page.
  * 2. This page features a "configuration token" as a security feature, to prevent malicious agents from intercepting
  * an in-progress installation and setting themselves as the master account.  This requires the developer to look
  * in the configuration table of the database.
  * Request type: GET
  */
 public function pageSetupMasterAccount()
 {
     // Get the alert message stream
     $ms = $this->_app->alerts;
     // Do not allow registering a master account if one has already been created
     if (User::find($this->_app->config('user_id_master'))) {
         $ms->addMessageTranslated("danger", "MASTER_ACCOUNT_EXISTS");
         $this->_app->redirect($this->_app->urlFor('uri_home'));
     }
     $schema = new \Fortress\RequestSchema($this->_app->config('schema.path') . "/forms/register.json");
     $this->_app->jsValidator->setSchema($schema);
     $this->_app->render('install/install-master.twig', ['validators' => $this->_app->jsValidator->rules(), 'table_config' => Database::getSchemaTable('configuration')->name]);
 }