public function account()
    {
        if (!$this->_step('database')) {
            $this->redirect(['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'database']);
        }

        $this->loadModel('User.Users');
        $user = $this->Users->newEntity();

        if ($this->request->data()) {
            $data = $this->request->data;
            $data['roles'] = ['_ids' => [1]];
            $user = $this->Users->newEntity($data);

            if ($this->Users->save($user)) {
                $this->Flash->success(__d('installer', 'Account created you can now login!'));
                $this->_step();
                $this->redirect(['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'finish']);
            } else {
                $this->Flash->danger(__d('installer', 'Account could not be created, please check your information.'));
            }
        }

        $this->title(__d('installer', 'Create New Account'));
        $this->set('user', $user);
    }
public function account()
    {
        if (!$this->_step('database')) {
            $this->redirect(['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'database']);
        }

        $this->loadModel('User.Users');
        $user = $this->Users->newEntity();

        if ($this->request->data()) {
            $data = $this->request->data;
            $data['roles'] = ['_ids' => [1]];
            $user = $this->Users->newEntity($data);

            if ($this->Users->save($user)) {
                $this->Flash->success(__d('installer', 'Account created you can now login!'));
                $this->_step();
                $this->redirect(['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'finish']);
            } else {
                $this->Flash->danger(__d('installer', 'Account could not be created, please check your information.'));
            }
        }

        $this->title(__d('installer', 'Create New Account'));
        $this->set('user', $user);
    }
public function account ( ) { if ( ! $ this -> _step ( 'database' ) ) { $ this -> redirect ( [ 'plugin' => 'Installer' , 'controller' => 'startup' , 'action' => 'database' ] ) ; } $ this -> loadModel ( 'User.Users' ) ; $ user = $ this -> Users -> newEntity ( ) ; if ( $ this -> request -> data ( ) ) { $ data = $ this -> request -> data ; $ data [ 'roles' ] = [ '_ids' => [ 1 ] ] ; $ user = $ this -> Users -> newEntity ( $ data ) ; if ( $ this -> Users -> save ( $ user ) ) { $ this -> Flash -> success ( __d ( 'installer' , 'Account created you can now login!' ) ) ; $ this -> _step ( ) ; $ this -> redirect ( [ 'plugin' => 'Installer' , 'controller' => 'startup' , 'action' => 'finish' ] ) ; } else { $ this -> Flash -> danger ( __d ( 'installer' , 'Account could not be created, please check your information.' ) ) ; } } $ this -> title ( __d ( 'installer' , 'Create New Account' ) ) ; $ this -> set ( 'user' , $ user ) ; }
Fifth step of the installation process.

Create a new administrator user account.

@return void
Fifth step of the installation process .