From c220da99596c4fbca3a4413dbf880dbfc8fd0121 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Fri, 24 Jan 2014 06:20:12 -0500
Subject: [PATCH] changed sql-query and make ure that the backup-sub-dir exists

---
 interface/web/client/domain_edit.php |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/interface/web/client/domain_edit.php b/interface/web/client/domain_edit.php
index 3c20ddb..07929f9 100644
--- a/interface/web/client/domain_edit.php
+++ b/interface/web/client/domain_edit.php
@@ -52,6 +52,15 @@
 $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'.lng';
 include $lng_file;
 
+if(!$app->tform->checkClientLimit('limit_domainmodule')) {
+	$app->uses('ini_parser,getconf');
+	$settings = $app->getconf->get_global_config('domains');
+	if ($settings['use_domain_module'] == 'y') {
+		$app->error($settings['new_domain_html']);
+	}
+}
+
+
 class page_action extends tform_actions {
 
 	function onShowNew() {
@@ -69,7 +78,8 @@
 
 		if($_SESSION["s"]["user"]["typ"] == 'admin') {
 			// Getting Clients of the user
-			$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
+			//$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
+			$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
 			$clients = $app->db->queryAllRecords($sql);
 			$client_select = '';
 			if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";

--
Gitblit v1.9.1