From 7fe908c50c8dbc5cc05f571dbe11d66141caacd4 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 14 Nov 2013 09:01:22 -0500
Subject: [PATCH] Cleaning up code to match coding guidelines

---
 interface/lib/classes/sites_database_plugin.inc.php |   59 ++++++++++++++++++++++++++++++-----------------------------
 1 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/interface/lib/classes/sites_database_plugin.inc.php b/interface/lib/classes/sites_database_plugin.inc.php
index 37cc546..d255fdc 100644
--- a/interface/lib/classes/sites_database_plugin.inc.php
+++ b/interface/lib/classes/sites_database_plugin.inc.php
@@ -31,22 +31,22 @@
 class sites_database_plugin {
 
 	public function processDatabaseInsert($form_page) {
-        global $app;
-        
+		global $app;
+
 		/*if($form_page->dataRecord["parent_domain_id"] > 0) {
 			$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($form_page->dataRecord["parent_domain_id"]));
-		
+
 			//* The Database user shall be owned by the same group then the website
 			$sys_groupid = $web['sys_groupid'];
         } else {
             $sys_groupid = $form_page->dataRecord['sys_groupid'];
         }
-        
-        
+
+
         if($form_page->dataRecord['database_user_id']) {
             // check if there has already been a database on this server with that user
             $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "')");
-            
+
             if($check && $check['cnt'] < 1) {
                 // we need to make a datalog insert for the database users that are connected to this database
                 $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "'");
@@ -60,7 +60,7 @@
         if($form_page->dataRecord['database_ro_user_id']) {
             // check if there has already been a database on this server with that user
             $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "')");
-            
+
             if($check && $check['cnt'] < 1) {
                 // we need to make a datalog insert for the database users that are connected to this database
                 $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "'");
@@ -70,22 +70,22 @@
                 }
             }
         }*/
-    }
-    
-    public function processDatabaseUpdate($form_page) {
-        global $app;
-        
-        /*$old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . $app->functions->intval($form_page->id));
-        
+	}
+
+	public function processDatabaseUpdate($form_page) {
+		global $app;
+
+		/*$old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . $app->functions->intval($form_page->id));
+
         if($form_page->dataRecord["parent_domain_id"] > 0) {
             $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($form_page->dataRecord["parent_domain_id"]));
-        
+
             //* The Database user shall be owned by the same group then the website
             $sys_groupid = $web['sys_groupid'];
         } else {
             $sys_groupid = $form_page->dataRecord['sys_groupid'];
         }
-        
+
         // check if database user has changed
         if($old_record['database_user_id'] && $old_record['database_user_id'] != $form_page->dataRecord['database_user_id'] && $old_record['database_user_id'] != $form_page->dataRecord['database_ro_user_id']) {
             // check if any database on the server still uses this one
@@ -112,11 +112,11 @@
                 }
             }
         }*/
-        
-        /*if($form_page->dataRecord['database_user_id']) {
+
+		/*if($form_page->dataRecord['database_user_id']) {
             // check if there has already been a database on this server with that user
             $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "')");
-            
+
             if($check && $check['cnt'] < 1) {
                 // we need to make a datalog insert for the database users that are connected to this database
                 $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "'");
@@ -130,7 +130,7 @@
         if($form_page->dataRecord['database_ro_user_id']) {
             // check if there has already been a database on this server with that user
             $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "')");
-            
+
             if($check && $check['cnt'] < 1) {
                 // we need to make a datalog insert for the database users that are connected to this database
                 $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "'");
@@ -140,13 +140,13 @@
                 }
             }
         }*/
-        
-    }
-    
-    public function processDatabaseDelete($primary_id) {
-        global $app;
-        
-        /*$old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . $app->functions->intval($primary_id));
+
+	}
+
+	public function processDatabaseDelete($primary_id) {
+		global $app;
+
+		/*$old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . $app->functions->intval($primary_id));
         if($old_record['database_user_id']) {
             // check if any database on the server still uses this one
             $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($old_record['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "') AND `database_id` != '" . $app->functions->intval($primary_id) . "'");
@@ -171,8 +171,9 @@
                 }
             }
         }*/
-        
-    }
+
+	}
+
 }
 
 ?>

--
Gitblit v1.9.1