diff --git a/interface/web/dns/dns_dkim_edit.php b/interface/web/dns/dns_dkim_edit.php
index 1735473a04aefed768b991beb1a2569173d0a08d..a0bd4f8fc4372f4a6924f5133a94e01a2e3e44ef 100644
--- a/interface/web/dns/dns_dkim_edit.php
+++ b/interface/web/dns/dns_dkim_edit.php
@@ -58,11 +58,11 @@ class page_action extends tform_actions {
 
 			// Get the limits of the client
 			$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
 
 			// Check if the user may add another record.
 			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = ?", $client_group_id);
 				if($tmp["number"] >= $client["limit_dns_record"]) {
 					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
 				}
@@ -75,7 +75,7 @@ class page_action extends tform_actions {
 	function onSubmit() {
 		global $app, $conf;
 		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ".$app->tform->getAuthSQL('r'), $app->functions->intval($_POST["zone"]));
 		// Check if Domain belongs to user
 		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
 
@@ -83,10 +83,10 @@ class page_action extends tform_actions {
 		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
 			// Get the limits of the client
 			$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
 			// Check if the user may add another record.
 			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = ?", $client_group_id);
 				if($tmp["number"] >= $client["limit_dns_record"]) {
 					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
 				}
@@ -101,12 +101,12 @@ class page_action extends tform_actions {
 		$this->dataRecord['name']='default._domainkey.'.$this->dataRecord['name'];
 
 		// Update the serial number  and timestamp of the RR record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ?", $this->id);
 		$this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
 		$this->dataRecord["stamp"] = date('Y-m-d H:i:s');
 
 		// check for duplicate entry
-		$check=$app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ".$this->dataRecord["zone"]." AND type = '".$this->dataRecord["type"]."' AND data ='".$this->dataRecord["data"]."' AND name = '".$this->dataRecord['name']."'");
+		$check=$app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ? AND type = ? AND data = ? AND name = ?", $this->dataRecord['zone'], $this->dataRecord['type'], $this->dataRecord['data'], $this->dataRecord['name']);
 		if ($check!='') $app->tform->errorMessage .= $app->tform->wordbook["record_exists_txt"];
 		if (empty($this->dataRecord['data'])) $app->tform->errorMessage .= $app->tform->wordbook["dkim_disabled_txt"];
 		parent::onSubmit();
@@ -116,7 +116,7 @@ class page_action extends tform_actions {
 		global $app, $conf;
 
 		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = ? AND ".$app->tform->getAuthSQL('r'), $app->functions->intval($this->dataRecord['zone']));
 		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
 
 		//* Update the serial number of the SOA record
@@ -129,7 +129,7 @@ class page_action extends tform_actions {
 		global $app, $conf;
 
 		//* Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ? AND ".$app->tform->getAuthSQL('r'), $app->functions->intval($this->dataRecord["zone"]));
 		$soa_id = $app->functions->intval($_POST["zone"]);
 		$serial = $app->validate_dns->increase_serial($soa["serial"]);
 		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
diff --git a/interface/web/dns/dns_dkim_get.php b/interface/web/dns/dns_dkim_get.php
index 157f894fe4e8d672f19106e15ca1187a9aee6a06..1bfa5111fca1edef79db85e57271055f1e1bc205 100644
--- a/interface/web/dns/dns_dkim_get.php
+++ b/interface/web/dns/dns_dkim_get.php
@@ -82,9 +82,9 @@ $_POST=getRealPost();
 
 if (ctype_digit($_POST['zone'])) {
 	// Get the parent soa record of the domain
-	$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->db->quote($_POST['zone'])."' AND ".$app->tform->getAuthSQL('r'));
+	$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ".$app->tform->getAuthSQL('r'), $_POST['zone']);
 
-	$public_key=$app->db->queryOneRecord("SELECT dkim_public FROM mail_domain WHERE domain = '".substr_replace($soa['origin'],'',-1)."' AND dkim = 'Y' AND ".$app->tform->getAuthSQL('r'));		
+	$public_key=$app->db->queryOneRecord("SELECT dkim_public FROM mail_domain WHERE domain = ? AND dkim = 'Y' AND ".$app->tform->getAuthSQL('r'), substr_replace($soa['origin'],'',-1));
 
 	$public_key=pub_key($public_key);
 
diff --git a/interface/web/dns/dns_wizard.php b/interface/web/dns/dns_wizard.php
index 1d295ec714de873fd8e350d116e5566a550b91b5..33f468e25e39f6974b2d2b83d2bfe98ca18d2776 100644
--- a/interface/web/dns/dns_wizard.php
+++ b/interface/web/dns/dns_wizard.php
@@ -248,7 +248,7 @@ if($_POST['create'] == 1) {
 		$public_key=$app->db->queryOneRecord("SELECT dkim_public FROM mail_domain WHERE domain = '".$app->db->quote($_POST['domain'])."' AND dkim = 'y' AND ".$app->tform->getAuthSQL('r'));
 		if ($public_key!='') {
 			$dns_record=str_replace(array("\r\n", "\n", "\r", "-----BEGIN PUBLIC KEY-----", "-----END PUBLIC KEY-----"), '', $public_key['dkim_public']);
-			$tpl_content = str_replace('TXT|'.$_POST['domain'].'.|{DKIM}', 'TXT|default._domainkey.'.$_POST['domain'].'.|v=DKIM1; t=s; p='.$dns_record, $tpl_content);
+			$tpl_content = str_replace('TXT|'.$_POST['domain'].'|{DKIM}', 'TXT|default._domainkey.'.$_POST['domain'].'.|v=DKIM1; t=s; p='.$dns_record, $tpl_content);
 		}
 	}
 
diff --git a/interface/web/mail/mail_user_edit.php b/interface/web/mail/mail_user_edit.php
index 690683ad808ff12131bf9c5fdd6268a3e79a559f..8bc76b3f38df9478d76d0736d47a14f487b22d81 100644
--- a/interface/web/mail/mail_user_edit.php
+++ b/interface/web/mail/mail_user_edit.php
@@ -323,8 +323,8 @@ class page_action extends tform_actions {
 
 		//* Change backup options when user mail backup options have been changed
 		if(isset($this->dataRecord['backup_interval']) && ($this->dataRecord['backup_interval'] != $this->oldDataRecord['backup_interval'] || $this->dataRecord['backup_copies'] != $this->oldDataRecord['backup_copies'])) {
-			$backup_interval = $this->dataRecord['backup_interval'];
-			$backup_copies = $this->dataRecord['backup_copies'];
+			$backup_interval = $app->db->quote($this->dataRecord['backup_interval']);
+			$backup_copies = $app->functions->intval($this->dataRecord['backup_copies']);
 			$app->db->datalogUpdate('mail_user', "backup_interval = '$backup_interval', backup_copies = '$backup_copies'", 'mailuser_id', $rec['mailuser_id']);
 			unset($backup_copies);
 			unset($backup_interval);
diff --git a/interface/web/sites/database_edit.php b/interface/web/sites/database_edit.php
index 6ae8856ec5b92055c594deb14a8e4d178cc0aa1e..1fe08423bb722ad9bde8127cf7564cdabd0930f3 100644
--- a/interface/web/sites/database_edit.php
+++ b/interface/web/sites/database_edit.php
@@ -73,7 +73,7 @@ class page_action extends tform_actions {
 
 			// Get the limits of the client
 			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT db_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			$client = $app->db->queryOneRecord("SELECT db_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
 
 			// Set the webserver to the default server of the client
 			$tmp = $app->db->queryAllRecords("SELECT server_id, server_name FROM server WHERE server_id IN ($client[db_servers])");
@@ -96,7 +96,7 @@ class page_action extends tform_actions {
 
 			// Get the limits of the client
 			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT client.client_id, limit_web_domain, db_servers, contact_name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			$client = $app->db->queryOneRecord("SELECT client.client_id, limit_web_domain, db_servers, contact_name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
 
 			// Set the webserver to the default server of the client
 			$tmp = $app->db->queryAllRecords("SELECT server_id, server_name FROM server WHERE server_id IN ($client[db_servers])");
@@ -150,6 +150,7 @@ class page_action extends tform_actions {
 			$app->tpl->setVar("edit_disabled", 1);
 			$app->tpl->setVar("server_id_value", $this->dataRecord["server_id"]);
 			$app->tpl->setVar("database_charset_value", $this->dataRecord["database_charset"]);
+			$app->tpl->setVar("limit_database_quota", $this->dataRecord["database_quota"]);
 		} else {
 			$app->tpl->setVar("edit_disabled", 0);
 		}
@@ -171,9 +172,31 @@ class page_action extends tform_actions {
 			// When the record is updated
 			if($this->id > 0) {
 				// restore the server ID if the user is not admin and record is edited
-				$tmp = $app->db->queryOneRecord("SELECT server_id FROM web_database WHERE database_id = ".$app->functions->intval($this->id));
+				$tmp = $app->db->queryOneRecord("SELECT server_id FROM web_database WHERE database_id = ?", $app->functions->intval($this->id));
 				$this->dataRecord["server_id"] = $tmp["server_id"];
 				unset($tmp);
+				//* Check client quota
+				if ($client['limit_database_quota'] >= 0) {
+					//* get the database prefix
+					$app->uses('getconf,tools_sites');
+					$global_config = $app->getconf->get_global_config('sites');
+					$dbname_prefix = $app->tools_sites->replacePrefix($global_config['dbname_prefix'], $this->dataRecord);
+					//* get quota from other databases
+					$tmp = $app->db->queryOneRecord("SELECT sum(database_quota) as db_quota FROM web_database WHERE sys_groupid = ? AND database_name <> ?", $client_group_id, $dbname_prefix.$this->dataRecord['database_name']);
+					$used_quota = $app->functions->intval($tmp['db_quota']);
+					$new_db_quota = $app->functions->intval($this->dataRecord["database_quota"]);
+					if(($used_quota + $new_db_quota > $client['limit_database_quota']) || ($new_db_quota < 0 && $client['limit_database_quota'] >= 0)) {
+						$max_free_quota = floor($client['limit_database_quota'] - $used_quota);
+						if($max_free_quota < 0) {
+							$max_free_quota = 0;
+						}
+						$app->tform->errorMessage .= $app->tform->lng("limit_database_quota_free_txt").": ".$max_free_quota." MB<br>";
+						$this->dataRecord['database_quota'] = $max_free_quota;
+					}
+					unset($tmp);
+					unset($global_config);
+					unset($dbname_prefix);
+				}
 				// When the record is inserted
 			} else {
 				$client['db_servers_ids'] = explode(',', $client['db_servers']);
@@ -185,15 +208,15 @@ class page_action extends tform_actions {
 
 				// Check if the user may add another database
 				if($client["limit_database"] >= 0) {
-					$tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE sys_groupid = $client_group_id");
+					$tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE sys_groupid = ?", $client_group_id);
 					if($tmp["number"] >= $client["limit_database"]) {
 						$app->error($app->tform->wordbook["limit_database_txt"]);
 					}
 				}
 
-				// Check client quota
-				 if ($client['limit_database_quota'] >= 0) {
-					$tmp = $app->db->queryOneRecord("SELECT sum(database_quota) as db_quota FROM web_database WHERE sys_groupid = $client_group_id");
+				//* Check client quota
+				if ($client['limit_database_quota'] >= 0) {
+					$tmp = $app->db->queryOneRecord("SELECT sum(database_quota) as db_quota FROM web_database WHERE sys_groupid = ?", $client_group_id);
 					$db_quota = $tmp['db_quota'];
 					$new_db_quota = $app->functions->intval($this->dataRecord["database_quota"]);
 					if(($db_quota + $new_db_quota > $client['limit_database_quota']) || ($new_db_quota < 0 && $client['limit_database_quota'] >= 0)) {
@@ -300,7 +323,7 @@ class page_action extends tform_actions {
                 }
 				*/
 
-				if($this->dataRecord['remote_access'] != 'y'){
+				if(isset($this->dataRecord['remote_access']) && $this->dataRecord['remote_access'] != 'y'){
 					$this->dataRecord['remote_ips'] = $server_config['ip_address'];
 					$this->dataRecord['remote_access'] = 'y';
 				} else {
@@ -387,7 +410,7 @@ class page_action extends tform_actions {
                 }
 				*/
 
-				if($this->dataRecord['remote_access'] != 'y'){
+				if(isset($this->dataRecord['remote_access']) && $this->dataRecord['remote_access'] != 'y'){
 					$this->dataRecord['remote_ips'] = $server_config['ip_address'];
 					$this->dataRecord['remote_access'] = 'y';
 				} else {
diff --git a/interface/web/sites/database_quota_stats.php b/interface/web/sites/database_quota_stats.php
new file mode 100644
index 0000000000000000000000000000000000000000..f7e5da5817bca3613b99de6cb76ce24cf58399cf
--- /dev/null
+++ b/interface/web/sites/database_quota_stats.php
@@ -0,0 +1,79 @@
+<?php
+require_once '../../lib/config.inc.php';
+require_once '../../lib/app.inc.php';
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$list_def_file = "list/database_quota_stats.list.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+//* Check permissions for module
+$app->auth->check_module_permissions('mail');
+
+$app->load('listform_actions','functions');
+
+$tmp_rec =  $app->db->queryOneRecord("SELECT data from monitor_data WHERE type = 'database_size' ORDER BY created DESC");
+$monitor_data = array();
+$tmp_array = unserialize($tmp_rec['data']);
+
+foreach($tmp_array as $database_name => $data) {
+	$db_name = $data['database_name'];
+
+	$temp = $app->db->queryOneRecord("SELECT client.username, web_database.database_quota FROM web_database, sys_group, client WHERE web_database.sys_groupid = sys_group.groupid AND sys_group.client_id = client.client_id AND web_database.database_name = ?'", $db_name);
+
+	$monitor_data[$db_name]['database_name'] = $data['database_name'];
+	$monitor_data[$db_name]['client']=$temp['username'];
+	$monitor_data[$db_name]['used'] = $data['size'];
+	$monitor_data[$db_name]['quota']=$temp['database_quota'];
+
+	unset($temp);
+}
+
+class list_action extends listform_actions {
+
+	function prepareDataRow($rec) {
+		global $app, $monitor_data;
+
+		$rec = $app->listform->decode($rec);
+
+		//* Alternating datarow colors
+		$this->DataRowColor = ($this->DataRowColor == '#FFFFFF') ? '#EEEEEE' : '#FFFFFF';
+		$rec['bgcolor'] = $this->DataRowColor;
+
+		$database_name = $rec['database_name'];
+
+		$rec['database'] = isset($monitor_data[$database_name]['database_name']) ? $monitor_data[$database_name]['database_name'] : array(1 => 0);
+		$rec['client'] = isset($monitor_data[$database_name]['client']) ? $monitor_data[$database_name]['client'] : array(1 => 0);
+		$rec['used'] = isset($monitor_data[$database_name]['used']) ? $monitor_data[$database_name]['used'] : array(1 => 0);
+		$rec['quota'] = isset($monitor_data[$database_name]['quota']) ? $monitor_data[$database_name]['quota'] : array(1 => 0);
+
+		if (!is_numeric($rec['used'])) $rec['used']=$rec['used'][1];
+
+		if($rec['quota'] == 0){
+			$rec['quota'] = $app->lng('unlimited');
+			$rec['percentage'] = '';
+		} else {
+			$rec['percentage'] = round(100 * $rec['used'] / ( $rec['quota']*1024*1024) ).'%';
+			$rec['quota'] .= ' MB';
+		}
+
+		if ($rec['used'] > 0) $rec['used'] = $app->functions->formatBytes($rec['used']);
+
+		$rec['id'] = $rec[$this->idx_key];
+		return $rec;
+
+	}
+
+}
+
+$list = new list_action;
+$list->SQLExtWhere = "";
+
+$list->onLoad();
+
+?>
diff --git a/interface/web/sites/lib/lang/en_database_quota_stats_list.lng b/interface/web/sites/lib/lang/en_database_quota_stats_list.lng
new file mode 100644
index 0000000000000000000000000000000000000000..1276a258c8ceb2406b93b0eb7c6327fd0e7aa403
--- /dev/null
+++ b/interface/web/sites/lib/lang/en_database_quota_stats_list.lng
@@ -0,0 +1,7 @@
+<?php
+$wb["database_txt"] = 'Database';
+$wb["client_txt"] = 'Client';
+$wb["used_txt"] = 'Used space';
+$wb["quota_txt"] = 'Quota';
+$wb["percentage_txt"] = 'Used in %';
+?>
diff --git a/interface/web/sites/lib/module.conf.php b/interface/web/sites/lib/module.conf.php
index 0a61e06a1df8c3c2933a65dba62fad7cec229c31..e47a184f4f7045a057df172ea6daffef655758b2 100644
--- a/interface/web/sites/lib/module.conf.php
+++ b/interface/web/sites/lib/module.conf.php
@@ -184,6 +184,11 @@ $items[] = array(   'title'   => 'Website quota (Harddisk)',
 	'link'    => 'sites/user_quota_stats.php',
 	'html_id' => 'user_quota_stats');
 
+$items[] = array(   'title'   => 'Database quota',
+	'target'  => 'content',
+	'link'    => 'sites/database_quota_stats.php',
+	'html_id' => 'databse_quota_stats');
+
 $module['nav'][] = array(   'title' => 'Statistics',
 	'open'  => 1,
 	'items' => $items);
diff --git a/interface/web/sites/list/database_quota_stats.list.php b/interface/web/sites/list/database_quota_stats.list.php
new file mode 100644
index 0000000000000000000000000000000000000000..65fe6e9b73b572ac0aa3c946451f54e7286d5776
--- /dev/null
+++ b/interface/web/sites/list/database_quota_stats.list.php
@@ -0,0 +1,52 @@
+<?php
+
+// Name of the list
+$liste["name"]     = "database_quota_stats";
+
+// Database table
+$liste["table"]    = "web_database";
+
+// Index index field of the database table
+$liste["table_idx"]   = "database_id";
+
+// Search Field Prefix
+$liste["search_prefix"]  = "search_";
+
+// Records per page
+$liste["records_per_page"]  = "15";
+
+// Script File of the list
+$liste["file"]    = "database_quota_stats.php";
+
+// Script file of the edit form
+$liste["edit_file"]   = "database_edit.php";
+
+// Paging Template
+$liste["paging_tpl"]  = "templates/paging.tpl.htm";
+
+// Enable auth
+$liste["auth"]    = "yes";
+
+// mark columns for php sorting (no real mySQL columns)
+$liste["phpsort"] = array('used_sort', 'files');
+
+
+/*****************************************************
+* Suchfelder
+*****************************************************/
+
+//$liste["item"][] = array( 'field'  => "domain",
+$liste["item"][] = array( 'field'  => "database_name",
+	'datatype' => "VARCHAR",
+	'filters'   => array( 0 => array( 'event' => 'SHOW',
+			'type' => 'IDNTOUTF8')
+	),
+	'formtype' => "TEXT",
+	'op'  => "like",
+	'prefix' => "%",
+	'suffix' => "%",
+	'width'  => "",
+	'value'  => ""
+);
+
+?>
diff --git a/interface/web/sites/templates/database_quota_stats_list.htm b/interface/web/sites/templates/database_quota_stats_list.htm
new file mode 100644
index 0000000000000000000000000000000000000000..caa20b704d48e2bb5c51a27d6e95169e8b0ed3d1
--- /dev/null
+++ b/interface/web/sites/templates/database_quota_stats_list.htm
@@ -0,0 +1,54 @@
+<h2><tmpl_var name="list_head_txt"></h2>
+
+<div class="panel panel_list_database_quota_stats">
+
+	 <div class="pnl_listarea">
+		 <fieldset><legend><tmpl_var name="list_head_txt"></legend>
+			 <table class="list">
+				<thead>
+				<tr class="caption">
+					<th class="tbl_col_database tbl_col_nosort" scope="col"><tmpl_var name="database_txt"></th>
+					<th class="tbl_col_client tbl_col_nosort" scope="col"><tmpl_var name="client_txt"></th>
+					<th class="tbl_col_used_sort" scope="col"><tmpl_var name="used_txt"></th>
+					<th class="tbl_col_quota tbl_col_nosort" scope="col"><tmpl_var name="quota_txt"></th>
+					<th class="tbl_col_percentage tbl_col_nosort" scope="col"><tmpl_var name="percentage_txt">
+					<th class="tbl_col_limit" scope="col">{tmpl_var name='search_limit'}</th>
+				</tr>
+				<tr class="filter">
+					<td class="tbl_col_database"><input type="text" name="search_database_name" value="{tmpl_var name='search_database_name'}" /></td>
+					<td class="tbl_col_client">&nbsp;</td>
+					<td class="tbl_col_used">&nbsp;</td>
+					<td class="tbl_col_quota">&nbsp;</td>
+					<td class="tbl_col_percentage">&nbsp;</td>
+					<td class="tbl_col_buttons">
+						<button type="button" class="button icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onclick="submitForm('pageForm','sites/database_quota_stats.php');"><span>{tmpl_var name="filter_txt"}</span></button>
+					</td>
+				</tr>
+				</thead>
+				<tbody>
+					<tmpl_loop name="records">
+						<tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
+							<td class="tbl_col_database"><a href="#" onclick="loadContent('sites/database_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="database"}</a></td>
+							<td class="tbl_col_client"><a href="#" onclick="loadContent('sites/database_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="client"}</a></td>
+							<td class="tbl_col_used"><a href="#" onclick="loadContent('sites/database_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="used"}</a></td>
+							<td class="tbl_col_quota"><a href="#" onclick="loadContent('sites/database_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="quota"}</a></td>
+							<td class="tbl_col_percentage"><a href="#" onclick="loadContent('sites/database_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="percentage"}</a></td>
+							<td class="tbl_col_buttons"></td>
+						</tr>
+					</tmpl_loop>
+					<tmpl_unless name="records">
+						<tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
+							<td colspan="7">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
+						</tr>
+					</tmpl_unless>
+				</tbody>
+				<tfoot>
+					<tr>
+						<td class="tbl_footer tbl_paging" colspan="7"><tmpl_var name="paging"></td>
+					</tr>
+				</tfoot>
+			</table>
+		</fieldset>
+	</div>
+
+</div>
diff --git a/server/conf/mail/db_quota_notification_de.txt b/server/conf/mail/db_quota_notification_de.txt
index 1405fc4f91db2358b05a31587552a3660714db8b..b290428aacb4bed18e94a900fdafdd2c69623779 100644
--- a/server/conf/mail/db_quota_notification_de.txt
+++ b/server/conf/mail/db_quota_notification_de.txt
@@ -7,7 +7,7 @@ Subject: Datenbank-Speicherhinweis
 
 Ihre Datenbank {database_name} hat den verfuegbaren Speicherplatz (nahezu) ausgeschoepft.
 
-Datenbank:						{databbase_name}
+Datenbank:						{database_name}
 Belegter Speicherplatz:			{used}
 Verfuegbarer Speicherplatz:		{quota}
 Belegter Speicherplatz in %:	{ratio}
diff --git a/server/conf/mail/db_quota_notification_en.txt b/server/conf/mail/db_quota_notification_en.txt
index cd5d71604b6c3b65db1cd2768c2fd228c08bfdde..e98b7253c0e52c581d104f741d7e0913dae39bd9 100644
--- a/server/conf/mail/db_quota_notification_en.txt
+++ b/server/conf/mail/db_quota_notification_en.txt
@@ -7,7 +7,7 @@ Subject: Database quota notification
 
 The database {database_name} is near or over quota.
 
-Database:		{databbase_name}
+Database:		{database_name}
 Used space:		{used}
 Quota:			{quota}
 Usage ratio:	{ratio}
diff --git a/server/conf/mail/db_quota_ok_notification_de.txt b/server/conf/mail/db_quota_ok_notification_de.txt
index ad88ef1b432255c3f5fa3fe522966ce2e14f1637..39feac4ed8e0f3e44539ee0b918a33bc00caeff8 100644
--- a/server/conf/mail/db_quota_ok_notification_de.txt
+++ b/server/conf/mail/db_quota_ok_notification_de.txt
@@ -7,7 +7,7 @@ Subject: Datenbank-Speicherhinweis
 
 Der belegte Speicherplatz Ihrer Datenbank {database_name} ist wieder ok.
 
-Datenbank:						{databbase_name}
+Datenbank:						{database_name}
 Belegter Speicherplatz:			{used}
 Verfuegbarer Speicherplatz:		{quota}
 Belegter Speicherplatz in %:	{ratio}
diff --git a/server/scripts/ispconfig_update.php b/server/scripts/ispconfig_update.php
index 1001f4f5a229945886a23a858a02a522cdd5e506..3512de9e93d827580828f7f5a245ce102cfdb77e 100644
--- a/server/scripts/ispconfig_update.php
+++ b/server/scripts/ispconfig_update.php
@@ -93,7 +93,7 @@ $method = simple_query('Select update method', array('stable', 'svn'), 'stable')
 if($method == 'stable') {
 	$new_version = @file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt') or die('Unable to retrieve version file.');
 	$new_version = trim($new_version);
-	if(version_compare($new_version, ISPC_APP_VERSION, '>') {
+	if(version_compare($new_version, ISPC_APP_VERSION, '>')) {
 		passthru('/usr/local/ispconfig/server/scripts/update_from_tgz.sh');
 		exit;
 	} else {