Skip to content

Commit

Permalink
added FE logout, update bootstrap file
Browse files Browse the repository at this point in the history
  • Loading branch information
sandiCzech committed Jan 18, 2016
1 parent 50b1fc0 commit ab1d0fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions FrontendModule/presenters/LoginPresenter.php
Expand Up @@ -40,11 +40,11 @@ protected function createComponentSignInForm($name)

$form->addText('username', 'Přihlašovací jméno')
->setRequired('Please provide a username.')
->setAttribute('placeholder', $this->translation['Username']);
->setAttribute('placeholder', 'Přihlašovací jméno');

$form->addPassword('password', 'Heslo')
->setRequired('Please provide a password.')
->setAttribute('placeholder', $this->translation['Password']);
->setAttribute('placeholder', 'Heslo');

$form->addCheckbox('remember', 'Permanent login?');

Expand Down Expand Up @@ -72,11 +72,21 @@ public function signInFormSubmitted($form)
}
$this->getUser()->login($values->username, $values->password);
$this->flashMessage('Přihlášení bylo úspěšné', 'success');
$this->forward('Homepage:');

//TODO bude upraveno - ted nestiham :)
//$this->forward('Homepage:');
$this->redirectUrl('http://test.webcook.cz/guaranteed-investment/www/pro-investory-1');
} catch (NS\AuthenticationException $e) {
$this->flashMessage($this->translation[$e->getMessage()], 'danger');
$form->addError($e->getMessage());
}
}

public function actionOut()
{
$this->getUser()->logout();
$this->flashMessage('Odhlášení bylo úspěšné', 'success');
$this->forward('Homepage:');
}

}
2 changes: 1 addition & 1 deletion install/bootstrap
Expand Up @@ -102,7 +102,7 @@ $container->router[] = new Route('admin/<presenter>/<action>[/<id>]', array(
'action' => 'default'
),$securedAdmin);

$container->router[] = new Route('loginfe', array(
$container->router[] = new Route('loginfe/<presenter>/<action>', array(
'module' => 'Frontend',
'presenter' => 'Login',
'action' => 'default'
Expand Down

0 comments on commit ab1d0fc

Please sign in to comment.