From 122be74d39f3bd64b8f34ea5cc76d1e7e6e39ffa Mon Sep 17 00:00:00 2001
From: redray <redray@ispconfig3>
Date: Wed, 11 Mar 2009 14:30:17 -0400
Subject: [PATCH] css fix: form hint indent

---
 interface/web/sites/database_edit.php |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/interface/web/sites/database_edit.php b/interface/web/sites/database_edit.php
index afe7013..377f321 100644
--- a/interface/web/sites/database_edit.php
+++ b/interface/web/sites/database_edit.php
@@ -173,6 +173,13 @@
 			$app->tpl->setVar("database_name_prefix", $dbname_prefix);
 			$app->tpl->setVar("database_user_prefix", $dbuser_prefix);
 		}
+		
+		if($this->id > 0) {
+			//* we are editing a existing record
+			$app->tpl->setVar("edit_disabled", 'disabled="disabled"');
+		} else {
+			$app->tpl->setVar("edit_disabled", '');
+		}
 
 		parent::onShowEnd();
 	}
@@ -237,6 +244,10 @@
 		if($old_record["database_charset"] != $this->dataRecord["database_charset"]) {
 			$app->tform->errorMessage .= $app->tform->wordbook["database_charset_change_txt"].'<br />';
 		}
+		
+		//* Database username and database name shall not be empty
+		if($this->dataRecord['database_name'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_name_error_empty"].'<br />';
+		if($this->dataRecord['database_user'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_user_error_empty"].'<br />';
 
 		//* Check if the server has been changed
 		// We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
@@ -261,6 +272,10 @@
 
 	function onBeforeInsert() {
 		global $app, $conf, $interfaceConf;
+		
+		//* Database username and database name shall not be empty
+		if($this->dataRecord['database_name'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_name_error_empty"].'<br />';
+		if($this->dataRecord['database_user'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_user_error_empty"].'<br />';
 
 		//* Get the database name and database user prefix
 		$app->uses('getconf');

--
Gitblit v1.9.1