From 7ee55f6682afcbb1de2969f7bfb191c3c19f2873 Mon Sep 17 00:00:00 2001
From: latham <latham@ispconfig3>
Date: Thu, 19 May 2011 18:02:46 +0000
Subject: [PATCH] Various Fixes. Add missing function for email quota

---
 install/sql/ispconfig3.sql                    |  5 ++--
 install/tpl/system.ini.master                 |  4 +--
 .../monitor_core_module.inc.php               | 27 ++++++++++++++++++-
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index 55daa1194f..f233b5e928 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -1073,10 +1073,11 @@ CREATE TABLE `sys_user` (
   `typ` varchar(16) NOT NULL default 'user',
   `active` tinyint(1) NOT NULL default '1',
   `language` varchar(2) NOT NULL default 'de',
-  `groups` varchar(255) NOT NULL default '',
+  `groups` TEXT NOT NULL default '',
   `default_group` int(11) unsigned NOT NULL default '0',
   `client_id` int(11) unsigned NOT NULL default '0',
-
+  `id_rsa` VARCHAR( 2000 ) NOT NULL default '',
+  `ssh_rsa` VARCHAR( 600 ) NOT NULL default '', 
   PRIMARY KEY  (`userid`)
 ) ENGINE=MyISAM AUTO_INCREMENT=1;
 
diff --git a/install/tpl/system.ini.master b/install/tpl/system.ini.master
index 8b305ac09b..d89a09833a 100644
--- a/install/tpl/system.ini.master
+++ b/install/tpl/system.ini.master
@@ -9,7 +9,7 @@
 [mail]
 enable_custom_login=n
 mailboxlist_webmail_link=y
-webmail_url=
+webmail_url=/webmail
 
 [monitor]
 
@@ -20,7 +20,7 @@ ftpuser_prefix=[CLIENTNAME]
 shelluser_prefix=[CLIENTNAME]
 webdavuser_prefix=[CLIENTNAME]
 dblist_phpmyadmin_link=y
-phpmyadmin_url=
+phpmyadmin_url=/phpmyadmin
 webftp_url=
 
 [tools]
diff --git a/server/mods-available/monitor_core_module.inc.php b/server/mods-available/monitor_core_module.inc.php
index 185702a1c4..a0410c88fa 100644
--- a/server/mods-available/monitor_core_module.inc.php
+++ b/server/mods-available/monitor_core_module.inc.php
@@ -86,7 +86,7 @@ class monitor_core_module {
 		/*
 		 * Calls the single Monitoring steps 
 		 */
-        //*  $this->_monitorEmailQuota(); in process
+//		$this->_monitorEmailQuota();
 		$this->_monitorHDQuota();
 		$this->_monitorServer();
 		$this->_monitorOsVer();
@@ -115,6 +115,31 @@ class monitor_core_module {
 		$this->_monitorSysLog();
 	}
 
+    private function _monitorEmailQuota() {
+        global $app;
+
+        /*
+         * First we get the Monitoring-data from the tools
+         */
+        $res = $this->_tools->monitorEmailQuota();
+
+        /*
+         * Insert the data into the database
+         */
+        $sql = 'INSERT INTO monitor_data (server_id, type, created, data, state) ' .
+                'VALUES (' .
+                $res['server_id'] . ', ' .
+                "'" . $app->dbmaster->quote($res['type']) . "', " .
+                'UNIX_TIMESTAMP(), ' .
+                "'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
+                "'" . $res['state'] . "'" .
+                ')';
+        $app->dbmaster->query($sql);
+
+        /* The new data is written, now we can delete the old one */
+        $this->_delOldRecords($res['type'], $res['server_id']);
+    }
+
 	private function _monitorHDQuota() {
 		global $app;
 
-- 
GitLab