[icinga-checkins] icinga.org: icinga-web/r1.5: * Session cleaning for API in r1.5 (ref #2501)

git at icinga.org git at icinga.org
Wed Apr 4 14:23:17 CEST 2012


Module: icinga-web
Branch: r1.5
Commit: 9d6d031b30ef8315d2de545d36d4f3d1d586e1e8
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=9d6d031b30ef8315d2de545d36d4f3d1d586e1e8

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Apr  4 14:22:50 2012 +0200

* Session cleaning for API in r1.5 (ref #2501)

---

 app/modules/Api/actions/ApiSearchAction.class.php |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/app/modules/Api/actions/ApiSearchAction.class.php b/app/modules/Api/actions/ApiSearchAction.class.php
index 7bb1e4d..31ba653 100644
--- a/app/modules/Api/actions/ApiSearchAction.class.php
+++ b/app/modules/Api/actions/ApiSearchAction.class.php
@@ -55,6 +55,7 @@ class Api_ApiSearchAction extends IcingaApiBaseAction {
         $validation = $this->getContainer()->getValidationManager();
 
         if (!$user->isAuthenticated() && $authKey) {
+            
             try {
                 $user->doAuthKeyLogin($authKey);
             } catch (Exception $e) {
@@ -112,6 +113,13 @@ class Api_ApiSearchAction extends IcingaApiBaseAction {
         }
 
         $rd->setParameter("searchResult", $res);
+        
+        if ($rd->getParameter("authkey") && $this->getContext()
+            ->getUser()->isAuthenticated()) {
+            $this->getContext()->getUser()->doLogout();
+            session_destroy();
+        } 
+        
         return $this->getDefaultViewName();
     }
 





More information about the icinga-checkins mailing list