/** * Add new user. * * @param string $acronym of user to add. * * @return void */ public function addAction($acronym = null) { //if (!isset($acronym)) { // die("Missing acronym"); //} $form = new \Anax\HTMLForm\CFormUserAdd(); $form->setDI($this->di); $status = $form->check(); $now = gmdate('Y-m-d H:i:s'); $this->theme->setTitle("Lägg till en användare"); $this->views->add('users/info-panel', [], 'flash'); $this->views->add('users/form', ['title' => "Lägg till en användare", 'content' => $form->getHTML()], 'main'); //$url = $this->url->create('users/id/' . $this->user->id); //$this->response->redirect($url); }
/** * Add new user. * * * @return void */ public function addAction() { $form = new \Anax\HTMLForm\CFormUserAdd(); $form->setDI($this->di); $status = $form->check(); $this->theme->setTitle("Register new user"); $this->views->add('users/add', ['title' => "Register new user", 'form' => $form->GetHTML()]); }
/** * Add new user. * * @param string $username of user to add. * * @return void */ public function addAction($username = null) { //if (!isset($acronym)) { // die("Missing acronym"); //} if ($this->users->isAuthenticated() && $this->users->isAdmin()) { $form = new \Anax\HTMLForm\CFormUserAdd(); $form->setDI($this->di); $status = $form->check(); $now = gmdate('Y-m-d H:i:s'); $this->theme->setTitle("Lägg till en användare"); if ($this->users->isAuthenticated() && $this->users->isAdmin()) { $this->views->add('users/info-panel', [], 'flash'); } $this->views->add('users/form', ['title' => "Lägg till en användare", 'content' => $form->getHTML()], 'main'); } else { $this->theme->setTitle('NEKAD'); $this->views->add('fo/403', [], 'main'); } }