From 01d12057e9d036fe66bf44b94896ad5fee10a737 Mon Sep 17 00:00:00 2001
From: vogelor <vogelor@ispconfig3>
Date: Sat, 01 May 2010 05:06:27 -0400
Subject: [PATCH] Added new Table for remote-actions to the installer Set the user-rights for this table in the installer

---
 install/lib/installer_base.lib.php |    9 ++++++++-
 install/sql/ispconfig3.sql         |   16 ++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 5ba03d2..0e537f6 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -333,7 +333,14 @@
             if(!$this->dbmaster->query($query)) {
                 $this->error('Unable to create database user in master database: '.$conf['mysql']['master_ispconfig_user'].' Error: '.$this->dbmaster->errorMessage);
             }
-            
+
+            $query = "GRANT SELECT, UPDATE (`action_status`, `response`) ON ".$conf['mysql']['master_database'].".`sys_remoteaction` "
+                    ."TO '".$conf['mysql']['master_ispconfig_user']."'@'".$src_host."' "
+                    ."IDENTIFIED BY '".$conf['mysql']['master_ispconfig_password']."';";
+            if(!$this->dbmaster->query($query)) {
+                $this->error('Unable to create database user in master database: '.$conf['mysql']['master_ispconfig_user'].' Error: '.$this->dbmaster->errorMessage);
+            }
+
             $query = "GRANT SELECT, INSERT , DELETE ON ".$conf['mysql']['master_database'].".`monitor_data` "
                     ."TO '".$conf['mysql']['master_ispconfig_user']."'@'".$src_host."' "
                     ."IDENTIFIED BY '".$conf['mysql']['master_ispconfig_password']."';";
diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index 709ce7a..e9db32e 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -1148,6 +1148,22 @@
   `value` varchar(255) NOT NULL
 ) ENGINE=MyISAM;
 
+
+--
+-- Tabellenstruktur für Tabelle `sys_remoteaction`
+--
+
+CREATE TABLE `sys_remoteaction` (
+  `action_id` int(11) unsigned NOT NULL auto_increment,
+  `server_id` int(11) unsigned NOT NULL,
+  `tstamp` int(11) NOT NULL,
+  `action_type` varchar(20) NOT NULL,
+  `action_param` mediumtext NOT NULL,
+  `action_status` enum('pending','ok','warning','error') NOT NULL,
+  `response` mediumtext NOT NULL,
+  PRIMARY KEY  (`action_id`)
+) ENGINE=MyISAM;
+
 -- --------------------------------------------------------
 
 -- 

--
Gitblit v1.9.1