public function deleteAction() { if ($this->request->isPost()) { $element = Feusers::findFirstByUid($this->request->getPost('uid')); $element->deleted = 1; $element->save(); } }
public function oldstartAction() { $request = $this->request; if ($this->request->isPost()) { //Receiving the variables sent by POST $email = $this->request->getPost('username', 'email'); $rawpassword = $this->request->getPost('password'); //Find the user in the database $feusers = Feusers::findFirst(array("email = :email: AND deleted=0 AND hidden=0", "bind" => array('email' => $email))); $checkedPasswords = $this->checkPassword($feusers->password, $rawpassword); if ($checkedPasswords != false) { $this->_registerSession($feusers); $this->flashSession->success($this->translate('welcome') . $feusers->username); //Forward to the 'invoices' controller if the user is valid $this->response->redirect(""); $this->view->disable(); } else { $this->flash->error('Wrong email/password'); } } return $this->forward('session/index'); }
/** * Auths the user by his/her id * * @param int $id */ public function authUserById($id) { $user = Feusers::findFirstById($id); if ($user == false) { throw new Exception('The user does not exist'); } $this->checkUserFlags($user); $this->session->set('auth', array('uid' => $user->id, 'username' => $user->name, 'profile' => $user->profile->name)); }