diff options
author | emkael <emkael@tlen.pl> | 2016-05-04 16:36:28 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-05-04 16:36:28 +0200 |
commit | f73bc251c7e1362463d632c54f62ea4c48decab8 (patch) | |
tree | 93b8c543f0df1b908c03a1baee56be9c3b6b584a /app/php | |
parent | b835177e60ec69677ef46935af291421078d667f (diff) |
* preserving URL on manual login
Diffstat (limited to 'app/php')
-rw-r--r-- | app/php/controls/HeaderMenu.php | 7 | ||||
-rw-r--r-- | app/php/controls/HeaderMenu.tpl | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/app/php/controls/HeaderMenu.php b/app/php/controls/HeaderMenu.php index a9759da..1e74be3 100644 --- a/app/php/controls/HeaderMenu.php +++ b/app/php/controls/HeaderMenu.php @@ -6,6 +6,13 @@ Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton'); class HeaderMenu extends TemplateControl { + public function loginUser($sender, $param) { + $this->Application->getModule('auth')->setReturnUrl($this->Request->RequestUri); + $this->Response->redirect( + $this->Service->ConstructUrl('Login') + ); + } + public function logoutUser($sender, $param) { $this->Application->getModule('auth')->logout(); $this->Response->redirect( diff --git a/app/php/controls/HeaderMenu.tpl b/app/php/controls/HeaderMenu.tpl index 603a231..b50c4ef 100644 --- a/app/php/controls/HeaderMenu.tpl +++ b/app/php/controls/HeaderMenu.tpl @@ -1,8 +1,7 @@ <nav role="navigation"> - <com:THyperLink Text="Login"> - <prop:NavigateUrl><%= $this->Service->constructUrl('Login') %></prop:NavigateUrl> + <com:TActiveLinkButton Text="Login" OnCommand="loginUser"> <prop:Visible><%= $this->User->IsGuest %></prop:Visible> - </com:THyperLink> + </com:TActiveLinkButton> <com:THyperLink Text="Profile"> <prop:NavigateUrl><%= $this->Service->constructUrl('Profile') %></prop:NavigateUrl> <prop:Visible><%= !$this->User->IsGuest %></prop:Visible> |