Module: nagvis Branch: master Commit: 556d1f2476d5892115b1f21138d596d9feab15fe URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=556d1f2476d5892115b1f21138d596d9feab15fe
Author: Lars Michelsen <[email protected]> Date: Sun Oct 18 22:40:55 2009 +0200 #116 Fixed redirection for already logged in users --- .../nagvis-js/classes/CoreModLogonDialog.php | 32 +++++++++++++------ 1 files changed, 22 insertions(+), 10 deletions(-) diff --git a/share/frontend/nagvis-js/classes/CoreModLogonDialog.php b/share/frontend/nagvis-js/classes/CoreModLogonDialog.php index c1d949a..83658d5 100644 --- a/share/frontend/nagvis-js/classes/CoreModLogonDialog.php +++ b/share/frontend/nagvis-js/classes/CoreModLogonDialog.php @@ -23,20 +23,32 @@ class CoreModLogonDialog extends FrontendModule { if($this->offersAction($this->sAction)) { switch($this->sAction) { case 'view': - $sReturn = $this->displayDialog(); + // Check if user is already authenticated + if(!$this->AUTHENTICATION->isAuthenticated()) { + $sReturn = $this->displayDialog(); + } else { + // When the user is already authenticated redirect to start page (overview) + Header('Location:'.$this->CORE->MAINCFG->getValue('paths', 'htmlbase')); + } break; case 'login': - $aReturn = $this->handleResponse(); - - $AUTH = new FrontendModAuth($this->CORE); - - if($aReturn !== false) { - $AUTH->setAction('login'); - $AUTH->passCredentials($aReturn); + // Check if user is already authenticated + if(!$this->AUTHENTICATION->isAuthenticated()) { + $aReturn = $this->handleResponse(); + + $AUTH = new FrontendModAuth($this->CORE); - return $AUTH->handleAction(); + if($aReturn !== false) { + $AUTH->setAction('login'); + $AUTH->passCredentials($aReturn); + + return $AUTH->handleAction(); + } else { + $sReturn = $AUTH->msgInvalidCredentials(); + } } else { - $sReturn = $AUTH->msgInvalidCredentials(); + // When the user is already authenticated redirect to start page (overview) + Header('Location:'.$this->CORE->MAINCFG->getValue('paths', 'htmlbase')); } break; } ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
