From e9d5c95afbb562c6e1e5677013906b220070295b Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Tue, 28 Jul 2015 05:29:38 -0400
Subject: [PATCH] - backported patches:     - make sure umlautdomains can be found in lists.     - sorting by database name did not work in database quota list.     - IDN: use standard from 2008 (which also works with "ß").

---
 interface/web/sites/templates/database_quota_stats_list.htm |    2 +-
 interface/web/client/client_edit.php                        |    2 +-
 server/lib/classes/functions.inc.php                        |    4 ++--
 interface/lib/classes/functions.inc.php                     |    4 ++--
 interface/web/login/lib/module.conf.php                     |    1 +
 interface/lib/classes/listform.inc.php                      |   14 ++++++++++++++
 6 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php
index 43eec67..e5f0560 100644
--- a/interface/lib/classes/functions.inc.php
+++ b/interface/lib/classes/functions.inc.php
@@ -301,7 +301,7 @@
 
 		if($encode == true) {
 			if(function_exists('idn_to_ascii')) {
-				$domain = idn_to_ascii($domain);
+				$domain = idn_to_ascii($domain, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
 			} elseif(file_exists(ISPC_CLASS_PATH.'/idn/idna_convert.class.php')) {
 				/* use idna class:
                  * @author  Matthias Sommerfeld <mso@phlylabs.de>
@@ -318,7 +318,7 @@
 			}
 		} else {
 			if(function_exists('idn_to_utf8')) {
-				$domain = idn_to_utf8($domain);
+				$domain = idn_to_utf8($domain, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
 			} elseif(file_exists(ISPC_CLASS_PATH.'/idn/idna_convert.class.php')) {
 				/* use idna class:
                  * @author  Matthias Sommerfeld <mso@phlylabs.de>
diff --git a/interface/lib/classes/listform.inc.php b/interface/lib/classes/listform.inc.php
index b1233a0..8f5bd86 100644
--- a/interface/lib/classes/listform.inc.php
+++ b/interface/lib/classes/listform.inc.php
@@ -197,6 +197,20 @@
 				$table = $i['table'];
 
 				$searchval = $_SESSION['search'][$list_name][$search_prefix.$field];
+				// IDN
+				if($searchval != ''){
+					foreach($i['filters'] as $searchval_filter) {
+						if($searchval_filter['event'] == 'SHOW') {
+							switch ($searchval_filter['type']) {
+							case 'IDNTOUTF8':
+								$searchval = $app->functions->idn_encode($searchval);
+								//echo $searchval;
+								break;
+							}
+						}
+					}
+				}
+		
 				// format user date format to MySQL date format 0000-00-00
 				if($i['datatype'] == 'DATE' && $this->lng('conf_format_dateshort') != 'Y-m-d'){
 					$dateformat = preg_replace("@[^Ymd]@", "", $this->lng('conf_format_dateshort'));
diff --git a/interface/web/client/client_edit.php b/interface/web/client/client_edit.php
index bbeb822..7bc9ecd 100644
--- a/interface/web/client/client_edit.php
+++ b/interface/web/client/client_edit.php
@@ -249,7 +249,7 @@
 		$modules = $conf['interface_modules_enabled'];
 		if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] > 0) $modules .= ',client';
 		$startmodule = (stristr($modules, 'dashboard'))?'dashboard':'client';
-		$usertheme = $this->dataRecord["usertheme"];
+		$usertheme = (isset($this->dataRecord["usertheme"]) && $this->dataRecord["usertheme"] != ''? $this->dataRecord["usertheme"] : 'default');
 		$type = 'user';
 		$active = 1;
 		$language = $this->dataRecord["language"];
diff --git a/interface/web/login/lib/module.conf.php b/interface/web/login/lib/module.conf.php
index 0936235..19feac1 100644
--- a/interface/web/login/lib/module.conf.php
+++ b/interface/web/login/lib/module.conf.php
@@ -3,4 +3,5 @@
 $module["title"]   = "top_menu_login";
 $module["template"]  = "module.tpl.htm";
 $module["startpage"]  = "login/index.php";
+$module["nav"] = array();
 ?>
diff --git a/interface/web/sites/templates/database_quota_stats_list.htm b/interface/web/sites/templates/database_quota_stats_list.htm
index a41a199..31a19ea 100644
--- a/interface/web/sites/templates/database_quota_stats_list.htm
+++ b/interface/web/sites/templates/database_quota_stats_list.htm
@@ -8,7 +8,7 @@
 <table class="table">
 				<thead class="dark form-group-sm">
 				<tr>
-					<th data-column="database"><tmpl_var name="database_txt"></th>
+					<th data-column="database_name"><tmpl_var name="database_txt"></th>
 					<th data-column="server_name"><tmpl_var name="server_name_txt"></th>
 					<th data-column="client"><tmpl_var name="client_txt"></th>
 					<th data-column="used"><tmpl_var name="used_txt"></th>
diff --git a/server/lib/classes/functions.inc.php b/server/lib/classes/functions.inc.php
index 5632a58..ec07a83 100644
--- a/server/lib/classes/functions.inc.php
+++ b/server/lib/classes/functions.inc.php
@@ -353,7 +353,7 @@
 
 		if($encode == true) {
 			if(function_exists('idn_to_ascii')) {
-				$domain = idn_to_ascii($domain);
+				$domain = idn_to_ascii($domain, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
 			} elseif(file_exists(ISPC_CLASS_PATH.'/idn/idna_convert.class.php')) {
 				/* use idna class:
                  * @author  Matthias Sommerfeld <mso@phlylabs.de>
@@ -370,7 +370,7 @@
 			}
 		} else {
 			if(function_exists('idn_to_utf8')) {
-				$domain = idn_to_utf8($domain);
+				$domain = idn_to_utf8($domain, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
 			} elseif(file_exists(ISPC_CLASS_PATH.'/idn/idna_convert.class.php')) {
 				/* use idna class:
                  * @author  Matthias Sommerfeld <mso@phlylabs.de>

--
Gitblit v1.9.1