[Pkg-nagios-changes] [SCM] Debian packaging of icinga-web branch, upstream, updated. upstream/1.8.2-1-g4aa93b9

Markus Frosch markus at lazyfrosch.de
Mon Mar 25 15:53:17 UTC 2013


The following commit has been merged in the upstream branch:
commit 4aa93b9879c1fedcaa74a94c2a5e86f715b388ec
Author: Markus Frosch <markus at lazyfrosch.de>
Date:   Mon Mar 25 16:25:52 2013 +0100

    Imported Upstream version 1.8.3

diff --git a/app/modules/AppKit/lib/auth/AppKitSecurityUser.class.php b/app/modules/AppKit/lib/auth/AppKitSecurityUser.class.php
index 09b0dc3..90c3b55 100644
--- a/app/modules/AppKit/lib/auth/AppKitSecurityUser.class.php
+++ b/app/modules/AppKit/lib/auth/AppKitSecurityUser.class.php
@@ -179,6 +179,9 @@ class AppKitSecurityUser extends AgaviRbacSecurityUser {
         $this->clearCredentials();
         $this->setAuthenticated(false);
 
+        // destroy the session with all settings
+        session_destroy();
+
         $this->getContext()->getLoggerManager()
         ->log(sprintf('User %s (%s) logged out!', $this->getAttribute('userobj')->user_name, $this->getAttribute('userobj')->givenName()), AgaviLogger::INFO);
 
diff --git a/app/modules/AppKit/lib/database/models/NsmUser.php b/app/modules/AppKit/lib/database/models/NsmUser.php
index bd7a777..f44ee57 100755
--- a/app/modules/AppKit/lib/database/models/NsmUser.php
+++ b/app/modules/AppKit/lib/database/models/NsmUser.php
@@ -221,9 +221,9 @@ class NsmUser extends BaseNsmUser {
 
             AppKitLogger::warn("New: Setting %s => %s", $key,$pref->toArray(false) );
         }
-        NsmUser::$cachedPreferences[$key] = array();
         NsmUser::$cachedPreferences[$key] = $val;
-        $this->getStorage()->write("appkit.nsm_user.preferences",self::$cachedPreferences);
+        // disabled storing cached prefs into session -mfrosch
+        //$this->getStorage()->write("appkit.nsm_user.preferences",self::$cachedPreferences);
         return true;
     }
 
@@ -325,7 +325,8 @@ class NsmUser extends BaseNsmUser {
         if(!empty(self::$cachedPreferences)) {
             return self::$cachedPreferences;
         }
-        self::$cachedPreferences = $this->getStorage()->read("appkit.nsm_user.preferences");
+        // disabled storing cached prefs into session -mfrosch
+        //self::$cachedPreferences = $this->getStorage()->read("appkit.nsm_user.preferences");
         if(!empty(self::$cachedPreferences)) {
             return self::$cachedPreferences;
         }
@@ -347,7 +348,8 @@ class NsmUser extends BaseNsmUser {
             }
         }
         self::$cachedPreferences = $out;
-        $this->getStorage()->write("appkit.nsm_user.preferences",self::$cachedPreferences);
+        // disabled storing cached prefs into session -mfrosch
+        //$this->getStorage()->write("appkit.nsm_user.preferences",self::$cachedPreferences);
         return $out;
     }
 
@@ -433,8 +435,10 @@ class NsmUser extends BaseNsmUser {
      * @return Doctrine_Collection
      */
     public function getPrincipals($userOnly= false) {
+        /* removed caching for principals due to problems on deletion -mfrosch
         if ($this->principals === null)
             $this->principals =  $this->getStorage()->read("appkit.nsm_user.principals");
+        */
 
         if ($this->principals === null) {
             $roles = $this->getRoleIds();
@@ -445,7 +449,9 @@ class NsmUser extends BaseNsmUser {
 
                                 ->orWhere('p.principal_user_id = ?',$this->user_id)
                                 ->execute();
+            /* removed caching for principals due to problems on deletion -mfrosch
             $this->getStorage()->write("appkit.nsm_user.principals",$this->principals);
+            */
         }
         
         return $this->principals;
@@ -573,10 +579,12 @@ class NsmUser extends BaseNsmUser {
     }
 
     public function getTargetValuesArray() {
+        /* removed caching for target values due to problems on deletion -mfrosch
         if (empty(self::$targetValuesCache)) {
             self::$targetValuesCache = $this->getStorage()->read("appkit.nsm_user.targetvalues");
         }
         if (empty(self::$targetValuesCache)) {
+        */
             $tc = AppKitDoctrineUtil::createQuery()
                   ->select('t.target_name, t.target_id')
                   ->from('NsmTarget t')
@@ -606,9 +614,12 @@ class NsmUser extends BaseNsmUser {
                 }
             }
             
+        /* removed caching for target values due to problems on deletion -mfrosch
             self::$targetValuesCache =& $out;
             $this->getStorage()->write("appkit.nsm_user.targetvalues",self::$targetValuesCache);
         }
         return self::$targetValuesCache;
+        */
+        return $out;
     }
 }
diff --git a/app/modules/AppKit/lib/database/models/generated/BaseNsmUserPreference.php b/app/modules/AppKit/lib/database/models/generated/BaseNsmUserPreference.php
index 8a7df63..abb093c 100644
--- a/app/modules/AppKit/lib/database/models/generated/BaseNsmUserPreference.php
+++ b/app/modules/AppKit/lib/database/models/generated/BaseNsmUserPreference.php
@@ -107,6 +107,15 @@ abstract class BaseNsmUserPreference extends Doctrine_Record {
 
         $this->index('upref_search_key_idx', array('fields' => array('upref_key')));
         $this->index('principal_role_id_ix', array('fields' => array('upref_user_id')));
+
+        $this->index('upref_user_key_unique_idx', array(
+                         'fields' => array(
+                             'upref_user_id',
+                             'upref_key',
+                         ),
+                         'type' => 'unique'
+        ));
+
     }
 
     public function setUp() {
diff --git a/app/modules/Cronks/lib/js/Cronk/grid/MetaGridPanel.js b/app/modules/Cronks/lib/js/Cronk/grid/MetaGridPanel.js
index a95778b..1c1ccac 100755
--- a/app/modules/Cronks/lib/js/Cronk/grid/MetaGridPanel.js
+++ b/app/modules/Cronks/lib/js/Cronk/grid/MetaGridPanel.js
@@ -168,6 +168,7 @@ Ext.ns("Cronk.grid");
             
             this.fieldIterator(function (fieldName, field) {
                 if (field.order['default'] === true) {
+                    field.order.order = field.order.order || field.order.direction;
                     storeConfig.sortInfo = {
                         direction: (field.order.order ? field.order.order.toUpperCase() : 'ASC'),
                         field: fieldName
diff --git a/app/modules/Cronks/lib/js/Cronk/grid/renderer/AdvancedHostStatusColumnRenderer.js b/app/modules/Cronks/lib/js/Cronk/grid/renderer/AdvancedHostStatusColumnRenderer.js
index c9ea257..12760e6 100644
--- a/app/modules/Cronks/lib/js/Cronk/grid/renderer/AdvancedHostStatusColumnRenderer.js
+++ b/app/modules/Cronks/lib/js/Cronk/grid/renderer/AdvancedHostStatusColumnRenderer.js
@@ -138,7 +138,7 @@ Ext.ns('Cronk.grid');
         this.hostStatus = function () {
             return function (value, metaData, record, rowIndex, colIndex, store) {
                 if (Ext.isDefined(record.json.host_has_been_checked)) {
-                    if (record.json.host_has_been_checked === 0) {
+                    if (record.json.host_has_been_checked == 0) {
                         value = 99;
                     }
                 }
diff --git a/app/modules/Cronks/lib/js/Cronk/grid/renderer/ColumnRenderer.js b/app/modules/Cronks/lib/js/Cronk/grid/renderer/ColumnRenderer.js
index c96833b..8a4943e 100755
--- a/app/modules/Cronks/lib/js/Cronk/grid/renderer/ColumnRenderer.js
+++ b/app/modules/Cronks/lib/js/Cronk/grid/renderer/ColumnRenderer.js
@@ -252,11 +252,11 @@ Ext.ns('Cronk.grid');
                 return function (value, metaData, record, rowIndex, colIndex, store) {
 
                     if (Ext.isDefined(record.json.service_is_pending)) {
-                        if (record.json.service_is_pending > 0) {
+                        if (record.json.service_is_pending == 1) {
                             value = 99;
                         }
                     } else if (Ext.isDefined(record.json.service_has_been_checked)) {
-                        if (record.json.service_has_been_checked === 0) {
+                        if (record.json.service_has_been_checked == 0) {
                             value = 99;
                         }
                     }
@@ -270,11 +270,11 @@ Ext.ns('Cronk.grid');
             hostStatus: function (cfg) {
                 return function (value, metaData, record, rowIndex, colIndex, store) {
                     if (Ext.isDefined(record.json.host_is_pending)) {
-                        if (record.json.host_is_pending > 0) {
+                        if (record.json.host_is_pending == 1) {
                             value = 99;
                         }
                     } else if (Ext.isDefined(record.json.host_has_been_checked)) {
-                        if (record.json.host_has_been_checked === 0) {
+                        if (record.json.host_has_been_checked == 0) {
                             value = 99;
                         }
                     }
@@ -312,4 +312,4 @@ Ext.ns('Cronk.grid');
             }
     };
 
-})();
\ No newline at end of file
+})();
diff --git a/app/modules/Cronks/views/System/ViewProc/MetaInformationSuccessView.class.php b/app/modules/Cronks/views/System/ViewProc/MetaInformationSuccessView.class.php
index c428ef3..ba4bbeb 100644
--- a/app/modules/Cronks/views/System/ViewProc/MetaInformationSuccessView.class.php
+++ b/app/modules/Cronks/views/System/ViewProc/MetaInformationSuccessView.class.php
@@ -42,7 +42,7 @@ class Cronks_System_ViewProc_MetaInformationSuccessView extends CronksBaseView {
 
             if($file === null)
                 $file = AppKitFileUtil::getAlternateFilename(AgaviConfig::get('modules.cronks.xml.path.grid'), $rd->getParameter('template'), '.xml');
-            $template = new CronkGridTemplateXmlParser($file);
+            $template = new CronkGridTemplateXmlParser($file->getRealPath());
             $template->parseTemplate();
             $user = $this->getContext()->getUser()->getNsmUser();
             $data = $template->getTemplateData();
@@ -67,4 +67,4 @@ class Cronks_System_ViewProc_MetaInformationSuccessView extends CronksBaseView {
     
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/configure b/configure
index 703f05c..707f892 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for icinga-web 1.8.2.
+# Generated by GNU Autoconf 2.68 for icinga-web 1.8.3.
 #
 # Report bugs to <dev.icinga.org>.
 #
@@ -560,8 +560,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='icinga-web'
 PACKAGE_TARNAME='icinga-web'
-PACKAGE_VERSION='1.8.2'
-PACKAGE_STRING='icinga-web 1.8.2'
+PACKAGE_VERSION='1.8.3'
+PACKAGE_STRING='icinga-web 1.8.3'
 PACKAGE_BUGREPORT='dev.icinga.org'
 PACKAGE_URL=''
 
@@ -1254,7 +1254,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures icinga-web 1.8.2 to adapt to many kinds of systems.
+\`configure' configures icinga-web 1.8.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1315,7 +1315,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of icinga-web 1.8.2:";;
+     short | recursive ) echo "Configuration of icinga-web 1.8.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1447,7 +1447,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-icinga-web configure 1.8.2
+icinga-web configure 1.8.3
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1464,7 +1464,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by icinga-web $as_me 1.8.2, which was
+It was created by icinga-web $as_me 1.8.3, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -1814,7 +1814,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 # Release date
-RELEASE_DATE=2013-02-12
+RELEASE_DATE=2013-03-25
 
 
 
@@ -3349,7 +3349,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by icinga-web $as_me 1.8.2, which was
+This file was extended by icinga-web $as_me 1.8.3, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -3402,7 +3402,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-icinga-web config.status 1.8.2
+icinga-web config.status 1.8.3
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
diff --git a/doc/CHANGELOG-1.8 b/doc/CHANGELOG-1.8
index 29b8563..bddcb88 100644
--- a/doc/CHANGELOG-1.8
+++ b/doc/CHANGELOG-1.8
@@ -5,6 +5,22 @@ Icinga-web 1.8 changelog
 Thanks to all contributers, testers and developers. Please read AUTHORS and
 THANKS for a detailed list :-)
 
+1.8.3 (2013-03-25)
+
+Bugs
+    * Session does not get cleared on logout #3721
+    * Fixed duplicated user preferences / appstate #3727 #3870
+      (caused a Doctrine_Hydrator_Exception)
+    * Fix for PHP 5.3.22 / 5.4.xx #3751
+    * Fix Pending states shown as OK #3843
+    * Fix order handling with Cronk templates #3886
+    * Disabed all caching of permissions for a user #3880
+      (caused problems when deleting a user from the system)
+
+    Please make sure to apply the SQL update for MySQL and PgSQL
+
+    It should clean up duplicated user preferences from the database!
+
 1.8.2
 
 Bugs
diff --git a/doc/VERSION b/doc/VERSION
index 53adb84..a7ee35a 100644
--- a/doc/VERSION
+++ b/doc/VERSION
@@ -1 +1 @@
-1.8.2
+1.8.3
diff --git a/etc/make/version.m4 b/etc/make/version.m4
index 4d97b1c..c091be7 100644
--- a/etc/make/version.m4
+++ b/etc/make/version.m4
@@ -9,5 +9,5 @@ dnl to tag a specific release. Icinga releases do not use
 dnl this name.
 dnl
 
-m4_define([ICINGA_VERSION], [1.8.2])
-m4_define([ICINGA_RELEASE_DATE], [2013-02-12])
+m4_define([ICINGA_VERSION], [1.8.3])
+m4_define([ICINGA_RELEASE_DATE], [2013-03-25])
diff --git a/etc/schema/mysql.sql b/etc/schema/mysql.sql
index 6ca0fba..c4ddb8d 100644
--- a/etc/schema/mysql.sql
+++ b/etc/schema/mysql.sql
@@ -19,7 +19,7 @@ CREATE TABLE nsm_session (session_entry_id INT AUTO_INCREMENT, session_id VARCHA
 CREATE TABLE nsm_target (target_id INT AUTO_INCREMENT, target_name VARCHAR(45) NOT NULL, target_description VARCHAR(100), target_class VARCHAR(80), target_type VARCHAR(45) NOT NULL, PRIMARY KEY(target_id)) ENGINE = INNODB;
 CREATE TABLE nsm_target_value (tv_pt_id INT, tv_key VARCHAR(45), tv_val VARCHAR(45) NOT NULL, PRIMARY KEY(tv_pt_id, tv_key)) ENGINE = INNODB;
 CREATE TABLE nsm_user (user_id INT AUTO_INCREMENT, user_account INT DEFAULT 0 NOT NULL, user_name VARCHAR(127) NOT NULL, user_lastname VARCHAR(40) NOT NULL, user_firstname VARCHAR(40) NOT NULL, user_password VARCHAR(64) NOT NULL, user_salt VARCHAR(64) NOT NULL, user_authsrc VARCHAR(45) DEFAULT 'internal' NOT NULL, user_authid TEXT, user_authkey VARCHAR(64), user_email VARCHAR(254) NOT NULL, user_disabled TINYINT DEFAULT '1' NOT NULL, user_created DATETIME NOT NULL, user_modified DATETIME NOT NULL, UNIQUE INDEX user_name_unique_idx (user_name), INDEX user_search_idx (user_name, user_authsrc, user_disabled, user_authid(127)), PRIMARY KEY(user_id)) ENGINE = INNODB;
-CREATE TABLE nsm_user_preference (upref_id INT AUTO_INCREMENT, upref_user_id INT NOT NULL, upref_val VARCHAR(100), upref_longval LONGTEXT, upref_key VARCHAR(50) NOT NULL, upref_created DATETIME NOT NULL, upref_modified DATETIME NOT NULL, INDEX upref_search_key_idx_idx (upref_key), INDEX principal_role_id_ix_idx (upref_user_id), PRIMARY KEY(upref_id)) ENGINE = INNODB;
+CREATE TABLE nsm_user_preference (upref_id INT AUTO_INCREMENT, upref_user_id INT NOT NULL, upref_val VARCHAR(100), upref_longval LONGTEXT, upref_key VARCHAR(50) NOT NULL, upref_created DATETIME NOT NULL, upref_modified DATETIME NOT NULL, INDEX upref_search_key_idx_idx (upref_key), INDEX principal_role_id_ix_idx (upref_user_id), PRIMARY KEY(upref_id), UNIQUE KEY `upref_user_key_unique_idx` (`upref_user_id`,`upref_key`)) ENGINE = INNODB;
 CREATE TABLE nsm_user_role (usro_user_id INT, usro_role_id INT, INDEX nsm_user_role_ix_idx (usro_role_id), PRIMARY KEY(usro_user_id, usro_role_id)) ENGINE = INNODB;
 ALTER TABLE cronk ADD CONSTRAINT cronk_cronk_user_id_nsm_user_user_id FOREIGN KEY (cronk_user_id) REFERENCES nsm_user(user_id);
 ALTER TABLE cronk_category_cronk ADD CONSTRAINT cronk_category_cronk_ccc_cronk_id_cronk_cronk_id FOREIGN KEY (ccc_cronk_id) REFERENCES cronk(cronk_id);
@@ -42,7 +42,7 @@ ALTER TABLE nsm_user_role ADD CONSTRAINT nsm_user_role_usro_role_id_nsm_role_rol
 /*          Initial data import              */
  
 INSERT INTO nsm_user (user_id,user_account,user_name,user_firstname,user_lastname,user_password,user_salt,user_authsrc,user_email,user_disabled) VALUES ('1','0','root','Enoch','Root','42bc5093863dce8c150387a5bb7e3061cf3ea67d2cf1779671e1b0f435e953a1','0c099ae4627b144f3a7eaa763ba43b10fd5d1caa8738a98f11bb973bebc52ccd','internal','root at localhost.local','0');
-INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.0', NOW(), NOW());
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.3', NOW(), NOW());
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('1','IcingaHostgroup','Limit data access to specific hostgroups','IcingaDataHostgroupPrincipalTarget','icinga');
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('2','IcingaServicegroup','Limit data access to specific servicegroups','IcingaDataServicegroupPrincipalTarget','icinga');
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('3','IcingaHostCustomVariablePair','Limit data access to specific custom variables','IcingaDataHostCustomVariablePrincipalTarget','icinga');
diff --git a/etc/schema/oracle.sql b/etc/schema/oracle.sql
index 34e5f45..a00d1c3 100644
--- a/etc/schema/oracle.sql
+++ b/etc/schema/oracle.sql
@@ -20,7 +20,7 @@
 -- check for errors in create_icingaweb_objects.log
 --
 -- initial version: 2012-03-07 Thomas Dreßler
--- current version: 2012-05-10 Thomas Dreßler
+-- current version: 2013-03-17 Thomas Dreßler
 -- -- --------------------------------------------------------
 */
 set sqlprompt "&&_USER@&&_CONNECT_IDENTIFIER SQL>"
@@ -267,6 +267,8 @@ CREATE TABLE nsm_user_preference
   tablespace &DATATBS;
 alter table nsm_user_preference add constraint nsm_user_pref_pk PRIMARY KEY  (upref_id)
 	using index tablespace &IXTBS;
+alter table nsm_user_preference add constraint nsm_user_pref_userid_key_uq UNIQUE (upref_user_id, upref_key)
+  using index tablespace &IXTBS; 
   
   --use index organized table because all data is within index
 CREATE TABLE nsm_user_role
@@ -610,7 +612,7 @@ INSERT INTO nsm_target (target_id,target_name,target_description,target_class,ta
 
 INSERT INTO nsm_user (user_id,user_account,user_name,user_firstname,user_lastname,user_password,user_salt,user_authsrc,user_email,user_disabled,user_created,user_modified) VALUES ('1','0','root','Enoch','Root','42bc5093863dce8c150387a5bb7e3061cf3ea67d2cf1779671e1b0f435e953a1','0c099ae4627b144f3a7eaa763ba43b10fd5d1caa8738a98f11bb973bebc52ccd','internal','root at localhost.local','0',sysdate,sysdate);
 
-INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.0', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.3', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
 
 INSERT INTO nsm_principal (principal_id,principal_user_id,principal_type,principal_disabled) VALUES ('1','1','user','0');
 INSERT INTO nsm_principal (principal_id,principal_role_id,principal_type,principal_disabled) VALUES ('2','2','role','0');
diff --git a/etc/schema/pgsql.sql b/etc/schema/pgsql.sql
index 42f4b51..9242d41 100644
--- a/etc/schema/pgsql.sql
+++ b/etc/schema/pgsql.sql
@@ -653,7 +653,7 @@ COPY cronk_principal_cronk (cpc_principal_id, cpc_cronk_id) FROM stdin;
 --
 
 COPY nsm_db_version (id, version, modified, created) FROM stdin;
-1	icinga-web/v1.8.0	2012-10-11 11:13:07	2012-10-11 11:13:07
+1	icinga-web/v1.8.3	2013-03-25 00:00:00	2013-03-23 00:00:00
 \.
 
 
@@ -971,6 +971,13 @@ CREATE INDEX upref_search_key_idx ON nsm_user_preference USING btree (upref_key)
 
 
 --
+-- Name: upref_user_key_unique_idx; Type: INDEX; Schema: public; Owner: icinga_web; Tablespace: 
+--
+
+CREATE UNIQUE INDEX upref_user_key_unique_idx ON nsm_user_preference USING btree (upref_user_id, upref_key);
+
+
+--
 -- Name: user_name_unique; Type: INDEX; Schema: public; Owner: icinga_web; Tablespace: 
 --
 
diff --git a/etc/schema/updates/mysql/mysql_v1-8-1_to_v1-8-3.sql b/etc/schema/updates/mysql/mysql_v1-8-1_to_v1-8-3.sql
new file mode 100644
index 0000000..f0968e9
--- /dev/null
+++ b/etc/schema/updates/mysql/mysql_v1-8-1_to_v1-8-3.sql
@@ -0,0 +1,44 @@
+BEGIN;
+SET autocommit = 0;
+
+--
+-- renaming duplicate appstate in user preference data by using the newest row
+--
+DROP TABLE IF EXISTS `nsm_user_preference_trans`;
+
+-- copying current data to temp table
+CREATE TEMPORARY TABLE nsm_user_preference_trans
+SELECT * FROM nsm_user_preference;
+
+-- locking
+LOCK TABLES `nsm_user_preference` WRITE, `nsm_user_preference_trans` WRITE;
+
+-- cleaning the table
+DELETE FROM nsm_user_preference;
+
+-- inserting deduplicated data
+INSERT INTO nsm_user_preference
+SELECT
+    upref_id,
+    upref_user_id,
+    upref_val,
+    upref_longval,
+    upref_key,
+    upref_created,
+    upref_modified
+FROM nsm_user_preference_trans
+GROUP by upref_user_id, upref_key
+HAVING MAX(upref_modified);
+
+-- adding unique key for user_id and key of preference
+ALTER TABLE nsm_user_preference ADD UNIQUE KEY upref_user_key_unique_idx (upref_user_id, upref_key);
+
+-- clean up
+DROP TABLE nsm_user_preference_trans;
+UNLOCK TABLES;
+
+-- update version info
+DELETE FROM nsm_db_version;
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.3', NOW(), NOW());
+
+COMMIT;
diff --git a/etc/schema/updates/oracle/oracle_v1-8-0_to_v1-8-3.sql b/etc/schema/updates/oracle/oracle_v1-8-0_to_v1-8-3.sql
new file mode 100644
index 0000000..26f519c
--- /dev/null
+++ b/etc/schema/updates/oracle/oracle_v1-8-0_to_v1-8-3.sql
@@ -0,0 +1,41 @@
+/* update script for icinga-web on oracle version v1.8.3 */
+set echo on
+set feedback on
+/* logging */
+spool oracle_v1-8-0_to_v1-8-3.log
+
+/* define index tablespace. change this for your needs */
+define IXTBS='ICINGAWEB_IDX1';
+
+/* 
+drop existing constraint if any 
+ignore ORA-02443 nonexistent constraint warning!
+*/
+alter table nsm_user_preference drop constraint nsm_user_pref_userid_key_uq drop index;
+
+/* from now leave on error */
+whenever sqlerror exit failure
+
+
+/* delete duplicates first if any and than add unique key for preference user_id and key  #3870 */
+delete from nsm_user_preference ud
+where 
+  upref_id <
+  (select max(upref_id) from nsm_user_preference ur
+    where ud.upref_user_id=ur.upref_user_id
+      and ud.upref_key=ur.upref_key);
+alter table nsm_user_preference add constraint nsm_user_pref_userid_key_uq UNIQUE (upref_user_id, upref_key)
+  using index tablespace &IXTBS;
+
+
+/* update version info */
+DELETE FROM nsm_db_version;
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.3', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
+
+/* commit all changes as single transaction, this will not be reached on error */
+commit;
+
+/*  done */
+spool off;
+exit;
+
diff --git a/etc/schema/updates/pgsql/pgsql_v1-8-1_to_v1-8-3.sql b/etc/schema/updates/pgsql/pgsql_v1-8-1_to_v1-8-3.sql
new file mode 100644
index 0000000..0e3c0d5
--- /dev/null
+++ b/etc/schema/updates/pgsql/pgsql_v1-8-1_to_v1-8-3.sql
@@ -0,0 +1,46 @@
+BEGIN;
+
+--
+-- renaming duplicate appstate in user preference data by using the newest row
+--
+DROP TABLE IF EXISTS nsm_user_preference_trans;
+
+-- copying current data to temp table
+CREATE TEMPORARY TABLE nsm_user_preference_trans AS
+SELECT * FROM nsm_user_preference;
+
+-- locking
+LOCK TABLE nsm_user_preference, nsm_user_preference_trans IN ACCESS EXCLUSIVE MODE;
+
+-- cleaning the table
+DELETE FROM nsm_user_preference;
+
+-- inserting deduplicated data
+INSERT INTO nsm_user_preference
+SELECT
+    upref_id,
+    upref_user_id,
+    upref_val,
+    upref_longval,
+    upref_key,
+    upref_created,
+    upref_modified
+FROM nsm_user_preference_trans t
+WHERE upref_id = (
+    SELECT MAX(upref_id)
+    FROM nsm_user_preference_trans t2
+    WHERE t.upref_key = t2.upref_key
+      and t.upref_user_id = t2.upref_user_id
+);
+
+-- adding unique key for user_id and key of preference
+CREATE UNIQUE INDEX upref_user_key_unique_idx ON nsm_user_preference USING btree (upref_user_id, upref_key);
+
+-- clean up
+DROP TABLE nsm_user_preference_trans;
+
+-- update version info
+DELETE FROM nsm_db_version;
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.3', NOW(), NOW());
+
+COMMIT;
diff --git a/icinga-web.spec b/icinga-web.spec
index 7befbcb..e17122d 100644
--- a/icinga-web.spec
+++ b/icinga-web.spec
@@ -44,7 +44,7 @@
 
 Summary: Open Source host, service and network monitoring Web UI
 Name: icinga-web
-Version: 1.8.2
+Version: 1.8.3
 Release: %{revision}%{?dist}
 License: GPLv3
 Group: Applications/System
@@ -137,7 +137,7 @@ Summary: Nagios Business Process Addon Integration module for Icinga Web
 ##############################
 %prep
 ##############################
-%setup -n %{name}-%{version}
+%setup -q -n %{name}-%{version}
 
 ##############################
 %build
@@ -247,8 +247,8 @@ fi
 %files
 ##############################
 # main dirs
-%doc etc/schema doc/README.RHEL doc/AUTHORS doc/CHANGELOG-1.7 doc/CHANGELOG-1.x doc/LICENSE
 %defattr(-,root,root)
+%doc etc/schema doc/README.RHEL doc/AUTHORS doc/CHANGELOG-1.7 doc/CHANGELOG-1.x doc/LICENSE
 # packaged by subpackages
 %exclude %{_datadir}/%{name}/app/modules/BPAddon
 %exclude %{_datadir}/%{name}/app/modules/Cronks/data/xml/extensions
@@ -275,23 +275,29 @@ fi
 %files module-pnp
 ##############################
 # templates, experimental treatment as configs (noreplace)
+%defattr(-,root,root)
 %doc contrib/PNP_Integration/README contrib/PNP_Integration/INSTALL
 %doc contrib/PNP_Integration/doc contrib/nginx
-%defattr(-,root,root)
 %dir %{_datadir}/icinga-web/app/modules/Cronks/data/xml/extensions
 %config(noreplace) %attr(644,-,-) %{_datadir}/%{name}/app/modules/Cronks/data/xml/extensions/*
 
 %files module-nagiosbp
 ##############################
 # templates, experimental treatment as configs (noreplace)
-%doc contrib/businessprocess-icinga-cronk/doc
 %defattr(-,root,root)
+%doc contrib/businessprocess-icinga-cronk/doc
 %config(noreplace) %{_datadir}/%{name}/app/modules/BPAddon/config/*
 %{_datadir}/%{name}/app/modules/BPAddon
 
 ##############################
 %changelog
 ##############################
+* Mon Mar 18 2013 Markus Frosch <markus.frosch at netways.de> - 1.8.3-1
+- bump to 1.8.3
+
+* Thu Feb 15 2013 Michael Friedrich <michael.friedrich at netways.de> - 1.8.2-2
+- fix rpmlint errors/warnings
+
 * Wed Feb 11 2013 Markus Frosch <markus.frosch at netways.de> - 1.8.2-1
 - bump to 1.8.2
 
@@ -337,7 +343,7 @@ fi
 
 * Mon Feb 20 2012 Michael Friedrich <michael.friedrich at univie.ac.at> - 1.6.2-1
 - bump to 1.6.2
-- clean config cache in %post (important for upgrades) #2217
+- clean config cache in post (important for upgrades) #2217
 
 * Mon Dec 12 2011 Michael Friedrich <michael.friedrich at univie.ac.at> - 1.6.1-1
 - bump to 1.6.1
@@ -345,15 +351,15 @@ fi
 
 * Sat Oct 22 2011 Michael Friedrich <michael.friedrich at univie.ac.at> - 1.6.0-1
 - bump to 1.6.0
-- add --with-cache-dir and use %{_localstatedir}/cache/icinga-web
+- add --with-cache-dir and use _localstatedir/cache/icinga-web
 
 * Thu Sep 15 2011 Michael Friedrich <michael.friedrich at univie.ac.at> - 1.5.2-1
 - drop icinga-api dependency
 - drop BuildRequires - not needed at this stage
-- add --with-api-cmd-file, using same location as icinga rpm %{_localstatedir}/icinga/rw/icinga.cmd
-- change new config location from default $prefix/etc/conf.d to %{_sysconfdir}/icinga-web
+- add --with-api-cmd-file, using same location as icinga rpm _localstatedir/icinga/rw/icinga.cmd
+- change new config location from default $prefix/etc/conf.d to _sysconfdir/icinga-web
 - mark all config xmls as config noreplace
-- set %{_localstatedir}/log/icinga-web and use it instead of $prefix/logs
+- set _localstatedir/log/icinga-web and use it instead of $prefix/logs
 - set apache user/group to write logdir
 - reorder files to be included in the package
 

-- 
Debian packaging of icinga-web



More information about the Pkg-nagios-changes mailing list