Module: nagvis Branch: master Commit: adeaceccb6135387c778e6b1cf1079e7dfb1ef6d URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=adeaceccb6135387c778e6b1cf1079e7dfb1ef6d
Author: LaMi <[email protected]> Date: Sat Nov 28 15:57:12 2009 +0100 When using the trusted auth the user will be redirected to the requested uri after authentication now --- .../nagvis-js/classes/FrontendModLogonEnv.php | 12 ++++++++++-- share/server/core/classes/CoreRequestHandler.php | 11 ++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/share/frontend/nagvis-js/classes/FrontendModLogonEnv.php b/share/frontend/nagvis-js/classes/FrontendModLogonEnv.php index 5aaa48c..0943df6 100644 --- a/share/frontend/nagvis-js/classes/FrontendModLogonEnv.php +++ b/share/frontend/nagvis-js/classes/FrontendModLogonEnv.php @@ -55,7 +55,15 @@ class FrontendModLogonEnv extends FrontendModule { if($this->AUTHENTICATION->isAuthenticated(AUTH_TRUST_USERNAME)) { // Display success with link and refresh in 5 seconds to called page $FHANDLER = new CoreRequestHandler($_POST); - new GlobalMessage('NOTE', $this->CORE->getLang()->getText('You have been authenticated. You will be redirected.'), null, null, 1, $FHANDLER->getReferer()); + + // Redirect without message to the user + //new GlobalMessage('NOTE', $this->CORE->getLang()->getText('You have been authenticated. You will be redirected.'), null, null, 1, $FHANDLER->getReferer()); + $ref = $FHANDLER->getRequestUri(); + if($ref === '') { + $ref = $this->CORE->getMainCfg()->getValue('paths', 'htmlbase'); + } + + header('Location:'.$ref); } else { // Invalid credentials // FIXME: Count tries and maybe block somehow @@ -67,7 +75,7 @@ class FrontendModLogonEnv extends FrontendModule { } } else { // When the user is already authenticated redirect to start page (overview) - Header('Location:'.$this->CORE->getMainCfg()->getValue('paths', 'htmlbase')); + header('Location:'.$this->CORE->getMainCfg()->getValue('paths', 'htmlbase')); } break; } diff --git a/share/server/core/classes/CoreRequestHandler.php b/share/server/core/classes/CoreRequestHandler.php index 3db528b..63dea19 100644 --- a/share/server/core/classes/CoreRequestHandler.php +++ b/share/server/core/classes/CoreRequestHandler.php @@ -1,7 +1,8 @@ <?php class CoreRequestHandler { private $aOpts; - private $sReferer; + private $sReferer = ''; + private $sRequestUri = ''; public function __construct($aOptions) { $this->aOpts = $aOptions; @@ -9,6 +10,10 @@ class CoreRequestHandler { if(isset($_SERVER['HTTP_REFERER'])) { $this->sReferer = $_SERVER['HTTP_REFERER']; } + + if(isset($_SERVER['REQUEST_URI'])) { + $this->sRequestUri = $_SERVER['REQUEST_URI']; + } } public function getKeys() { @@ -42,6 +47,10 @@ class CoreRequestHandler { public function getReferer() { return $this->sReferer; } + + public function getRequestUri() { + return $this->sRequestUri; + } } ?> ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
