[icinga-checkins] icinga.org: icinga-web/jmosshammer/filtering: PHP 5.4 changes

git at icinga.org git at icinga.org
Wed Jan 2 15:43:54 CET 2013


Module: icinga-web
Branch: jmosshammer/filtering
Commit: c85c9c3358c692cc8698dc27db8970b89991f0f8
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=c85c9c3358c692cc8698dc27db8970b89991f0f8

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Thu Dec 20 16:34:00 2012 +0100

PHP 5.4 changes

---

 app/modules/AppKit/lib/database/models/NsmUser.php |    3 ++-
 .../models/Credential/AggregatorModel.class.php    |    8 ++------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/app/modules/AppKit/lib/database/models/NsmUser.php b/app/modules/AppKit/lib/database/models/NsmUser.php
old mode 100644
new mode 100755
index d2ee9fb..3dbe851
--- a/app/modules/AppKit/lib/database/models/NsmUser.php
+++ b/app/modules/AppKit/lib/database/models/NsmUser.php
@@ -208,7 +208,8 @@ class NsmUser extends BaseNsmUser {
                 ->update("NsmUserPreference p")->set($field,"?",$val)
                 ->where("p.upref_user_id=? and p.upref_key=?",array($this->user_id,$key))
                 ->execute();
-            $pref[$field] = $val;
+            if(is_array($pref[$field]))
+                $pref[$field] = $val;
 
         } catch (AppKitDoctrineException $e) {
             $pref = new NsmUserPreference();
diff --git a/app/modules/AppKit/models/Credential/AggregatorModel.class.php b/app/modules/AppKit/models/Credential/AggregatorModel.class.php
index eb1667f..7e498bf 100755
--- a/app/modules/AppKit/models/Credential/AggregatorModel.class.php
+++ b/app/modules/AppKit/models/Credential/AggregatorModel.class.php
@@ -107,11 +107,7 @@ class AppKit_Credential_AggregatorModel extends AppKitBaseModel
 
         $dbrev = $this->getDatabaseRevision();
         $count = $this->getCount();
-        $oids = "";
-        $ids = array_keys($this->object_ids);
-        foreach($ids as $key) {
-            $oids .= pack("I",$key);
-        }
+        $oids = implode(",",array_keys($this->object_ids));
         $storage->write(self::SESSION_KEY_COUNT, $count);
         $storage->write(self::SESSION_KEY_OID, $oids);
         $storage->write(self::SESSION_KEY_REV, $dbrev);
@@ -124,7 +120,7 @@ class AppKit_Credential_AggregatorModel extends AppKitBaseModel
 
         $storage = $this->getContext()->getStorage();
         $oids = $storage->read(self::SESSION_KEY_OID);
-        $this->object_ids = array_flip(unpack("I*",$oids));
+        $this->object_ids = array_flip(explode(",",$oids));
         if(isset($this->object_ids["-1"])) {
             $this->object_ids = array("-1"=>"0");
         }





More information about the icinga-checkins mailing list