[icinga-checkins] icinga.org: icinga-web/master: Session: Update empty data results in error

git at icinga.org git at icinga.org
Tue Nov 18 17:10:11 CET 2014


Module: icinga-web
Branch: master
Commit: 88b073051dec9dc3f0c9d1fb2fbe58b9746ac154
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=88b073051dec9dc3f0c9d1fb2fbe58b9746ac154

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Oct 30 09:54:50 2014 +0100

Session: Update empty data results in error

SQLSTATE[HY093]: Invalid parameter number: number of
bound variables does not match number of tokens.

Refs #7718

---

 .../AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php b/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
index 49286e1..11e26a8 100644
--- a/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
+++ b/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
@@ -177,14 +177,14 @@ class AppKitDoctrineSessionStorage extends AgaviSessionStorage {
             $max = 1440;
         }
 
-        $date = new DateTime($this->NsmSession->session_modified);
-        $m = null;
+        $date = DateTime::CreateFromFormat('Y-m-d H:i:s', $this->NsmSession->session_modified);
+        $m = md5($data);
 
         if ((time() - $date->getTimestamp()) >= $max) {
             $update = true;
         }
 
-        if (! $update && $this->NsmSession->session_checksum === ($m = md5($data))) {
+        if (! $update && $this->NsmSession->session_checksum === $m) {
             return;
         }
 
@@ -193,8 +193,11 @@ class AppKitDoctrineSessionStorage extends AgaviSessionStorage {
         $this->NsmSession->session_data = $data;
         $this->NsmSession->session_checksum = $m;
         $this->NsmSession->session_modified = date('Y-m-d H:i:s');
+
         $this->NsmSession->save();
 
+        AppKitLogger::debug("Write session update: %s", $id);
+
         AppKitLogger::verbose("Writing new session information successful");
     }
 



More information about the icinga-checkins mailing list