From cdaae64a7431af2bf6cb3c916f0e6bfbdd3fd93b Mon Sep 17 00:00:00 2001
From: vogelor <vogelor@ispconfig3>
Date: Sat, 01 May 2010 07:11:31 -0400
Subject: [PATCH] The Interface now supports the first remote-action : do OS-Update

---
 install/lib/installer_base.lib.php |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 20eb61a..0e537f6 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -1,7 +1,7 @@
 <?php
 
 /*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+Copyright (c) 2007-2010, Till Brehm, projektfarm Gmbh
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification,
@@ -154,7 +154,7 @@
 				caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null", 
                         __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql');
 			} else {
-				caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -p'".$conf['mysql']['admin_password']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null", 
+				caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -p'".$conf['mysql']['admin_password']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
                         __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql');
 			}
 			$db_tables = $this->db->getTables();
@@ -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']."';";
@@ -1388,8 +1395,28 @@
 		exec('mv /usr/local/ispconfig/server/scripts/run-getmail.sh /usr/local/bin/run-getmail.sh');
 		if(is_user('getmail')) exec('chown getmail /usr/local/bin/run-getmail.sh');
 		exec('chmod 744 /usr/local/bin/run-getmail.sh');
-		
-		
+
+		//* Add Log-Rotation
+		if (is_dir('/etc/logrotate.d')){
+			unlink('/etc/logrotate.d/logispc3');
+			$fh = fopen('/etc/logrotate.d/logispc3', 'w');
+			fwrite($fh,
+					"/var/log/ispconfig/ispconfig.log { \n" .
+					"	weekly \n" .
+					"	missingok \n" .
+					"	rotate 4 \n" .
+					"	compress \n" .
+					"	delaycompress \n" .
+					"} \n" .
+					"/var/log/ispconfig/cron.log { \n" .
+					"	weekly \n" .
+					"	missingok \n" .
+					"	rotate 4 \n" .
+					"	compress \n" .
+					"	delaycompress \n" .
+					"}");
+			fclose($fh);
+		}
 	}
 	
 	public function configure_dbserver()

--
Gitblit v1.9.1