Small fixes to user model + Form decorators
This commit is contained in:
parent
359e42a44b
commit
49ecfc9fbd
7 changed files with 33 additions and 16 deletions
|
|
@ -42,28 +42,17 @@ class AuthController extends Fiktiv_Controller_Action
|
|||
|
||||
if ($this->_request->isPost() && $form->isValid($this->_request->getParams())) {
|
||||
|
||||
$users = new Users();
|
||||
$users = $this->dataService->User;
|
||||
|
||||
if ($users->login($this->_request->getParam('email'), $this->_request->getParam('password'))) {
|
||||
|
||||
// TODO: redirect user
|
||||
$this->_redirect('/');
|
||||
} else {
|
||||
// TODO: Wrong email / password
|
||||
var_dump($emailElement->getErrors());
|
||||
echo "Wrong email / password";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "You are ";
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ($auth->hasIdentity()) {
|
||||
$user = $auth->getIdentity();
|
||||
echo $user->firstName;
|
||||
} else {
|
||||
echo "Nobody";
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue