/** * Update user. * */ public function updateAction($id = null) { $user = $this->users->find($id); if ($user) { $values = array('id' => $id, 'name' => $user->getProperties()['name'], 'acronym' => $user->getProperties()['acronym'], 'password' => $user->getProperties()['password'], 'email' => $user->getProperties()['email'], 'active' => $user->getProperties()['active'], 'deleted' => $user->getProperties()['deleted']); $form = new \Anax\HTMLForm\CFormUserUpdate($values); $form->setDI($this->di); $status = $form->check(); $this->views->add('users/info-panel', [], 'flash'); $this->theme->setTitle("Redigera en användare"); $this->views->add('default/page', ['title' => "Redigera användare", 'content' => $form->getHTML()], 'main'); } }
/** * Update user. * * @param $id of user to update. * * @return void */ public function updateAction($id = null) { $this->users->denyAccessToPage('user', $id); $user = $this->users->find($id); $presentation = $user->getProperties()['presentation']; $acronym = $user->getProperties()['acronym']; $email = $user->getProperties()['email']; $web = $user->getProperties()['web']; $password = $user->getProperties()['password']; $active = $user->getProperties()['active']; $deleted = $user->getProperties()['deleted']; $created = $user->getProperties()['created']; $form = new \Anax\HTMLForm\CFormUserUpdate($id, $acronym, $presentation, $email, $web, $password, $active, $created); $form->setDI($this->di); $status = $form->check(); $this->di->theme->setTitle("Edit user"); $this->di->views->add('users/update', ['title' => "Edit user", 'form' => "<h4>" . $user->getProperties()['acronym'] . " \n (id " . $user->getProperties()['id'] . ")</h4>" . $form->getHTML()]); }