Author: Lars Michelsen <[email protected]>
Date: Thu Jul 7 16:40:45 2011 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Thu Jul 7 16:40:45 2011 +0200
Two small bugfixes
* Bugfix: Added missing permissions for User/setOption
* Bugfix: Fixed javascript error "getSidebarWidth() not definied" when header
menu is disable by config
---
ChangeLog | 2 ++
TODO | 2 ++
share/frontend/nagvis-js/js/nagvis.js | 6 ++++++
share/server/core/classes/CoreMySQLHandler.php | 22 +++++++++++++++++++++-
share/server/core/classes/CoreSQLiteHandler.php | 22 +++++++++++++++++++++-
5 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 214848c..66a8a21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,8 @@ Core
* Bugfix: Fixed redirects after map add/rename/delete
* Bugfix: NDO backend does correct type casting to integers for stats now
(Thanks to Oliver Graf)
* Bugfix: Fixed false CRITICAL states when using NDO Backend (Thanks to
Oliver Graf)
+ * Bugfix: Added missing permissions for User/setOption
+ * Bugfix: Fixed javascript error "getSidebarWidth() not definied" when
header menu is disable by config
* Automap
* Added new context menu action "make root" to automap nodes to change the
diff --git a/TODO b/TODO
index b7551f9..74a6332 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,8 @@
This is a small file for storing quick thoughts about new features and needed
changes:
===============================================================================
+- Bei einem zu kleinen Schirm springt das Hintergrundbild unter die Sidebar
+
- Backends:
- Zusätzlich beliebige Variablen vom Backend holen lassen
Pro Objekt "Custom Vars" für Context- und Hover-Menus einbauen. Diese
werden dann pro Objekt
diff --git a/share/frontend/nagvis-js/js/nagvis.js
b/share/frontend/nagvis-js/js/nagvis.js
index 51e6b19..d76c359 100644
--- a/share/frontend/nagvis-js/js/nagvis.js
+++ b/share/frontend/nagvis-js/js/nagvis.js
@@ -54,6 +54,12 @@ var oStates = {};
var isIE = navigator.appVersion.indexOf("MSIE") != -1;
+// This is a dummy fucntion which is overwritten by the definition in
+// the header template when it is enabled.
+function getSidebarWidth() {
+ return 0;
+}
+
function date(format, timestamp) {
// http://kevin.vanzonneveld.net
// + original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)
diff --git a/share/server/core/classes/CoreMySQLHandler.php
b/share/server/core/classes/CoreMySQLHandler.php
index 91b4edf..987f185 100644
--- a/share/server/core/classes/CoreMySQLHandler.php
+++ b/share/server/core/classes/CoreMySQLHandler.php
@@ -175,8 +175,28 @@ class CoreMySQLHandler {
// Now perform the update for pre 1.5.4
if($dbVersion < 1050400)
$this->updateDb1050400();
+
+ // Now perform the update for pre 1.6b2
+ if($dbVersion < 1060022)
+ $this->updateDb1060022();
+ }
+
+ private function updateDb1060022() {
+ // Create permissions for User/setOption
+ $this->query('INSERT INTO perms (mod, act, obj) VALUES (\'User\',
\'setOption\', \'*\')');
+
+ // Assign the new permission to the managers, users, guests
+ $RES = $this->query('SELECT roleId FROM roles WHERE name=\'Managers\'
or \'Users (read-only)\' or name=\'Guests\'');
+ while($data = $this->fetchAssoc($RES))
+ $this->addRolePerm($data['roleId'], 'User', 'setOption', '*');
+
+ // Only apply the new version when this is the real release or newer
+ // (While development the version string remains on the old value)
+ if(GlobalCore::getInstance()->versionToTag(CONST_VERSION) >= 1060022)
+ $this->updateDbVersion();
}
+
private function updateDb1050400() {
// Create permissions for the multisite webservice
$this->query('INSERT INTO perms (`mod`, `act`, obj) VALUES
(\'Multisite\', \'getMaps\', \'*\')');
@@ -500,4 +520,4 @@ class CoreMySQLHandler {
$this->query('INSERT INTO perms (`mod`, `act`, obj) VALUES
(\'AutoMap\', \'doAdd\', \'*\')');
$this->query('INSERT INTO perms (`mod`, `act`, obj) VALUES
(\'MainCfg\', \'doEdit\', \'*\')');
*/
-?>
\ No newline at end of file
+?>
diff --git a/share/server/core/classes/CoreSQLiteHandler.php
b/share/server/core/classes/CoreSQLiteHandler.php
index f04ff4e..3a2dbf0 100644
--- a/share/server/core/classes/CoreSQLiteHandler.php
+++ b/share/server/core/classes/CoreSQLiteHandler.php
@@ -173,6 +173,26 @@ class CoreSQLiteHandler {
// Now perform the update for pre 1.5.4
if($dbVersion < 1050400)
$this->updateDb1050400();
+
+ // Now perform the update for pre 1.6b2
+ if($dbVersion < 1060022)
+ $this->updateDb1060022();
+ }
+
+ private function updateDb1060022() {
+ // Create permissions for User/setOption
+ $this->DB->query('INSERT INTO perms (mod, act, obj) VALUES (\'User\',
\'setOption\', \'*\')');
+
+ // Assign the new permission to the managers, users, guests
+ $RES = $this->DB->query('SELECT roleId FROM roles WHERE
name=\'Managers\' or \'Users (read-only)\' or name=\'Guests\'');
+ while($data = $this->fetchAssoc($RES))
+ $this->addRolePerm($data['roleId'], 'User', 'setOption', '*');
+
+ // Only apply the new version when this is the real release or newer
+ // (While development the version string remains on the old value)
+ if(GlobalCore::getInstance()->versionToTag(CONST_VERSION) >= 1060022)
+ $this->updateDbVersion();
+
}
private function updateDb1050400() {
@@ -463,4 +483,4 @@ class CoreSQLiteHandler {
$this->addRolePerm($data['roleId'], 'Auth', 'logout', '*');
}
}
-?>
\ No newline at end of file
+?>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins