From 4f1de1c95e0a6c0a9da8f9865b960386ca040d4f Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Mon, 12 Nov 2012 11:29:10 -0500
Subject: [PATCH] - Make sure alias domain SEO redirects get written only if they don't collide with SEO redirects from parent web site.

---
 interface/lib/plugins/sites_web_domain_plugin.inc.php |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/interface/lib/plugins/sites_web_domain_plugin.inc.php b/interface/lib/plugins/sites_web_domain_plugin.inc.php
index 85a4cc0..a21c56f 100644
--- a/interface/lib/plugins/sites_web_domain_plugin.inc.php
+++ b/interface/lib/plugins/sites_web_domain_plugin.inc.php
@@ -39,21 +39,20 @@
 		Function to create the sites_web_domain rule and insert it into the custom rules           
     */
     function sites_web_domain_edit($event_name, $page_form) {
-        global $app, $conf;            
-        
+        global $app, $conf;   
         // make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it
         // also make sure that the user can not delete domain created by a admin
         if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($page_form->dataRecord["client_group_id"])) {
-            $client_group_id = intval($page_form->dataRecord["client_group_id"]);
+            $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]);
             $app->db->query("UPDATE web_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$page_form->id);
         }
         if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($page_form->dataRecord["client_group_id"])) {
-            $client_group_id = intval($page_form->dataRecord["client_group_id"]);
+            $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]);
             $app->db->query("UPDATE web_domain SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE domain_id = ".$page_form->id);
         }
         // Get configuration for the web system
         $app->uses("getconf");        
-        $web_config = $app->getconf->get_server_config(intval($page_form->dataRecord['server_id']),'web');            
+        $web_config = $app->getconf->get_server_config($app->functions->intval($page_form->dataRecord['server_id']),'web');            
         $document_root = str_replace("[website_id]",$page_form->id,$web_config["website_path"]);
 		$document_root = str_replace("[website_idhash_1]",$this->id_hash($page_form->id,1),$document_root);
 		$document_root = str_replace("[website_idhash_2]",$this->id_hash($page_form->id,1),$document_root);
@@ -64,11 +63,11 @@
         if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) {                    
             $client_group_id = $_SESSION["s"]["user"]["default_group"];
             $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = $client_group_id");
-            $client_id = intval($client["client_id"]);
+            $client_id = $app->functions->intval($client["client_id"]);
         } else {                
-            //$client_id = intval($this->dataRecord["client_group_id"]);
-            $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval($page_form->dataRecord["client_group_id"]));
-            $client_id = intval($client["client_id"]);
+            //$client_id = $app->functions->intval($this->dataRecord["client_group_id"]);
+            $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".$app->functions->intval($page_form->dataRecord["client_group_id"]));
+            $client_id = $app->functions->intval($client["client_id"]);
         }
 
         // Set the values for document_root, system_user and system_group

--
Gitblit v1.9.1