Browse Source

Merge remote-tracking branch 'fusionpbx/master'

blackc2004 9 years ago
parent
commit
38fa7b6285

+ 22 - 1
core/databases/app_defaults.php

@@ -131,6 +131,9 @@ if ($domains_processed == 1) {
 			if (strlen($_SESSION['switch']['sounds']['dir']) > 0) {
 				$tmp .= correct_path("	sounds_dir = [[".$_SESSION['switch']['sounds']['dir']."]];\n");
 			}
+			if (strlen($_SESSION['switch']['phrases']['dir']) > 0) {
+				$tmp .= correct_path("	phrases_dir = [[".$_SESSION['switch']['phrases']['dir']."]];\n");
+			}
 			if (strlen($_SESSION['switch']['db']['dir']) > 0) {
 				$tmp .= correct_path("	database_dir = [[".$_SESSION['switch']['db']['dir']."]];\n");
 			}
@@ -182,7 +185,25 @@ if ($domains_processed == 1) {
 				}
 				$tmp .= "\n";
 			}
-
+			$tmp .= "--set defaults\n";
+			$tmp .= "	expire = {}\n";
+			$tmp .= "	expire[\"directory\"] = \"3600\";\n";
+			$tmp .= "	expire[\"dialplan\"] = \"3600\";\n";
+			$tmp .= "	expire[\"languages\"] = \"3600\";\n";
+			$tmp .= "	expire[\"sofia.conf\"] = \"3600\";\n";
+			$tmp .= "	expire[\"acl.conf\"] = \"3600\";\n";
+			$tmp .= "\n";
+			$tmp .= "--set xml_handler\n";
+			$tmp .= "	xml_handler = {}\n";
+			$tmp .= "	xml_handler[\"fs_path\"] = false;\n";
+			$tmp .= "\n";
+			$tmp .= "--set the debug options\n";
+			$tmp .= "	debug[\"params\"] = false;\n";
+			$tmp .= "	debug[\"sql\"] = false;\n";
+			$tmp .= "	debug[\"xml_request\"] = false;\n";
+			$tmp .= "	debug[\"xml_string\"] = false;\n";
+			$tmp .= "	debug[\"cache\"] = false;\n";
+			$tmp .= "\n";
 			$tmp .= "--additional info\n";
 			$tmp .= "	domain_count = ".count($_SESSION["domains"]).";\n";
 			$tmp .= correct_path("	temp_dir = [[".$_SESSION['server']['temp']['dir']."]];\n");

+ 15 - 1
core/default_settings/app_defaults.php

@@ -17,7 +17,7 @@
 
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2010
+	Portions created by the Initial Developer are Copyright (C) 2008-2015
 	the Initial Developer. All Rights Reserved.
 
 	Contributor(s):
@@ -30,12 +30,26 @@ if ($domains_processed == 1) {
 	//define array of settings
 		$x = 0;
 		$array[$x]['default_setting_category'] = 'domain';
+		$array[$x]['default_setting_subcategory'] = 'time_zone';
+		$array[$x]['default_setting_name'] = 'name';
+		$array[$x]['default_setting_value'] = '';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = '';
+		$x++;
+		$array[$x]['default_setting_category'] = 'domain';
 		$array[$x]['default_setting_subcategory'] = 'language';
 		$array[$x]['default_setting_name'] = 'code';
 		$array[$x]['default_setting_value'] = 'en-us';
 		$array[$x]['default_setting_enabled'] = 'true';
 		$array[$x]['default_setting_description'] = '';
 		$x++;
+		$array[$x]['default_setting_category'] = 'domain';
+		$array[$x]['default_setting_subcategory'] = 'bridge';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'outbound';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'outbound,loopback,lcr';
+		$x++;
 		$array[$x]['default_setting_category'] = 'security';
 		$array[$x]['default_setting_subcategory'] = 'password_length';
 		$array[$x]['default_setting_name'] = 'var';

+ 33 - 1
core/default_settings/default_setting_edit.php

@@ -92,6 +92,38 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 			// fix null
 			$default_setting_order = ($default_setting_order != '') ? $default_setting_order : 'null';
 
+			//update switch timezone variables
+			if ($default_setting_category == "domain" && $default_setting_subcategory == "time_zone" && $default_setting_name == "name" ) {
+				//get the action
+					$sql = "select * from v_vars ";
+					$sql .= "where var_name = 'timezone' ";
+					$prep_statement = $db->prepare(check_sql($sql));
+					$prep_statement->execute();
+					$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+					$var_action = "add";
+					foreach ($result as $row) {
+						$var_action = "update";
+					}
+					unset ($prep_statement);
+
+				//update the timezone
+					if ($var_action == "update") {
+						$sql = "update v_vars ";
+						$sql .= "set var_value = '".$default_setting_value."' ";
+						$sql .= "where var_name = 'timezone' ";
+					}
+					else {
+						$sql = "insert into v_vars ";
+						$sql .= "(var_uuid, var_name, var_value, var_cat, var_enabled) ";
+						$sql .= "values ('".uuid()."', 'timezone', '$default_setting_value', 'Defaults', 'true'); ";
+					}
+					$db->query($sql);
+					unset($sql);
+
+				//synchronize the configuration
+					save_var_xml();
+			}
+
 			if ($action == "add" && permission_exists('default_setting_add')) {
 				$sql = "insert into v_default_settings ";
 				$sql .= "(";
@@ -566,4 +598,4 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 
 //include the footer
 	require_once "resources/footer.php";
-?>
+?>

+ 73 - 4
core/domain_settings/domain_setting_edit.php

@@ -47,9 +47,10 @@ else {
 		$action = "add";
 	}
 
-if (strlen($_GET["domain_uuid"]) > 0) {
-	$domain_uuid = check_str($_GET["domain_uuid"]);
-}
+//set the domain_uuid
+	if (strlen($_GET["domain_uuid"]) > 0) {
+		$domain_uuid = check_str($_GET["domain_uuid"]);
+	}
 
 //get http post variables and set them to php variables
 	if (count($_POST) > 0) {
@@ -92,7 +93,75 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 
 	//add or update the database
 		if ($_POST["persistformvar"] != "true") {
-			$domain_setting_order = ($domain_setting_order != '') ? $domain_setting_order : 'null';
+			// fix null
+				$domain_setting_order = ($domain_setting_order != '') ? $domain_setting_order : 'null';
+
+			//update switch timezone variables
+				if ($domain_setting_category == "domain" && $domain_setting_subcategory == "time_zone" && $domain_setting_name == "name" ) {
+					//get the dialplan_uuid
+						$sql = "select * from v_dialplans ";
+						$sql .= "where domain_uuid = '".$domain_uuid."' ";
+						$sql .= "and app_uuid = '9f356fe7-8cf8-4c14-8fe2-6daf89304458' ";
+						$prep_statement = $db->prepare(check_sql($sql));
+						$prep_statement->execute();
+						$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+						foreach ($result as $row) {
+							$dialplan_uuid = $row["dialplan_uuid"];
+						}
+						unset ($prep_statement);
+
+					//get the action
+						$sql = "select * from v_dialplan_details ";
+						$sql .= "where domain_uuid = '".$domain_uuid."' ";
+						$sql .= "and dialplan_uuid = '".$dialplan_uuid."' ";
+						$sql .= "and dialplan_detail_tag = 'action' ";
+						$sql .= "and dialplan_detail_type = 'set' ";
+						$sql .= "and dialplan_detail_data like 'timezone=%' ";
+						$prep_statement = $db->prepare(check_sql($sql));
+						$prep_statement->execute();
+						$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+						$detail_action = "add";
+						foreach ($result as $row) {
+							$dialplan_detail_uuid = $row["dialplan_detail_uuid"];
+							$detail_action = "update";
+						}
+						unset ($prep_statement);
+
+					//update the timezone
+						if ($detail_action == "update") {
+							$sql = "update v_dialplan_details ";
+							$sql .= "set dialplan_detail_data = 'timezone=".$domain_setting_value."' ";
+							$sql .= "where dialplan_detail_uuid = '".$dialplan_detail_uuid."' ";
+						}
+						else {
+							$dialplan_detail_uuid = uuid();
+							$dialplan_detail_group = 0;
+							$sql = "insert into v_dialplan_details ";
+							$sql .= "(";
+							$sql .= "domain_uuid, ";
+							$sql .= "dialplan_detail_uuid, ";
+							$sql .= "dialplan_uuid, ";
+							$sql .= "dialplan_detail_tag, ";
+							$sql .= "dialplan_detail_type, ";
+							$sql .= "dialplan_detail_data, ";
+							$sql .= "dialplan_detail_inline, ";
+							$sql .= "dialplan_detail_group ";
+							$sql .= ") ";
+							$sql .= "values ";
+							$sql .= "(";
+							$sql .= "'".$domain_uuid."', ";
+							$sql .= "'".$dialplan_detail_uuid."', ";
+							$sql .= "'".$dialplan_uuid."', ";
+							$sql .= "'action', ";
+							$sql .= "'set', ";
+							$sql .= "'timezone=".$domain_setting_value."', ";
+							$sql .= "'true', ";
+							$sql .= "'".$dialplan_detail_group."' ";
+							$sql .= "); ";
+						}
+						$db->query($sql);
+						unset($sql);
+				}
 
 			//add the domain
 				if ($action == "add" && permission_exists('domain_setting_add')) {

+ 28 - 24
core/domain_settings/domains.php

@@ -75,7 +75,7 @@ else {
 				$domain->db = $db;
 				$domain->set();
 
-			// on domain change, redirect user
+			//redirect the user
 				if ($_SESSION["login"]["destination"] != '') {
 					// to default, or domain specific, login destination
 					header("Location: ".PROJECT_PATH.$_SESSION["login"]["destination"]["url"]);
@@ -87,10 +87,14 @@ else {
 		}
 	}
 
+//redirect the user
+	if (file_exists($_SERVER["DOCUMENT_ROOT"]."/app/domains/domains.php")) {
+		$href = '/app/domains/domains.php';
+	}
+
 //includes
 	require_once "resources/header.php";
 	$document['title'] = $text['title-domains'];
-
 	require_once "resources/paging.php";
 
 //get the http values and set them as variables
@@ -100,24 +104,6 @@ else {
 		$order = check_str($_GET["order"]);
 	}
 
-//show the header and the search
-	echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td width='50%' align='left' valign='top' nowrap='nowrap'><b>".$text['header-domains']."</b></td>\n";
-	echo "		<td width='50%' align='right' valign='top'>\n";
-	echo "			<form method='get' action=''>\n";
-	echo "			<input type='text' class='txt' style='width: 150px' name='search' value='$search'>";
-	echo "			<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
-	echo "			</form>\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "	<tr>\n";
-	echo "		<td align='left' valign='top' colspan='2'>\n";
-	echo "			".$text['description-domains']."<br /><br />\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "</table>\n";
-
 //prepare to page the results
 	$sql = "select count(*) as num_rows from v_domains ";
 	if (strlen($search) > 0) {
@@ -146,12 +132,12 @@ else {
 	list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
 	$offset = $rows_per_page * $page;
 
-//get the  list
+//get the domains
 	$sql = "select * from v_domains ";
 	if (strlen($search) > 0) {
 		$sql .= "where (";
-		$sql .= " 	domain_name like '%".$search."%' ";
-		$sql .= " 	or domain_description like '%".$search."%' ";
+		$sql .= "	domain_name like '%".$search."%' ";
+		$sql .= "	or domain_description like '%".$search."%' ";
 		$sql .= ") ";
 	}
 	if (strlen($order_by) == 0) {
@@ -177,6 +163,24 @@ else {
 	$row_style["0"] = "row_style0";
 	$row_style["1"] = "row_style1";
 
+//show the header and the search
+	echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
+	echo "	<tr>\n";
+	echo "		<td width='50%' align='left' valign='top' nowrap='nowrap'><b>".$text['header-domains']."</b></td>\n";
+	echo "		<td width='50%' align='right' valign='top'>\n";
+	echo "			<form method='get' action=''>\n";
+	echo "			<input type='text' class='txt' style='width: 150px' name='search' value='$search'>";
+	echo "			<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
+	echo "			</form>\n";
+	echo "		</td>\n";
+	echo "	</tr>\n";
+	echo "	<tr>\n";
+	echo "		<td align='left' valign='top' colspan='2'>\n";
+	echo "			".$text['description-domains']."<br /><br />\n";
+	echo "		</td>\n";
+	echo "	</tr>\n";
+	echo "</table>\n";
+
 	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
 	echo "<tr>\n";
 	echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
@@ -190,7 +194,6 @@ else {
 	echo "</tr>\n";
 
 	if (count($domains) > 0) {
-		global $c, $row_style, $text, $v_link_label_edit, $v_link_label_delete;
 		foreach ($domains as $domain_uuid => $domain) {
 			$tr_link = (permission_exists('domain_edit')) ? "href='domain_edit.php?id=".$domain_uuid."'" : null;
 			echo "<tr ".$tr_link.">\n";
@@ -245,4 +248,5 @@ else {
 
 //include the footer
 	require_once "resources/footer.php";
+
 ?>

+ 4 - 4
core/user_settings/app_languages.php

@@ -9,7 +9,7 @@ $text['title-user_dashboard']['pl'] = "Panel użytkowników";
 $text['title-user_dashboard']['he'] = "ממשק משתמש";
 $text['title-user_dashboard']['uk'] = "Панель користувача";
 $text['title-user_dashboard']['sv-se'] = "Användarpanel";
-$text['title-user_dashboard']['de-at'] = "Benutzer-Übersichtsseite";
+$text['title-user_dashboard']['de-at'] = "Benutzerübersicht";
 $text['title-user_dashboard']['ro'] = "Panou control utilizator";
 $text['title-user_dashboard']['fa'] = "";
 $text['title-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
@@ -359,7 +359,7 @@ $text['label-followme']['pl'] = "Podążaj za mną";
 $text['label-followme']['he'] = "עקוב אחרי";
 $text['label-followme']['uk'] = "Follow Me";
 $text['label-followme']['sv-se'] = "Följ Mig";
-$text['label-followme']['de-at'] = "Follow Me";
+$text['label-followme']['de-at'] = "Anrufweiterschaltung";
 $text['label-followme']['ro'] = "Urmează-mă";
 $text['label-followme']['fa'] = "";
 $text['label-followme']['ar-eg'] = "خدمة اتبعني";
@@ -457,7 +457,7 @@ $text['label-callforward']['pl'] = "Przekierowanie rozmowy";
 $text['label-callforward']['he'] = "עקוב אחרי";
 $text['label-callforward']['uk'] = "Переадресація дзвінків";
 $text['label-callforward']['sv-se'] = "Vidarekoppling";
-$text['label-callforward']['de-at'] = "Anrufweiterleitung";
+$text['label-callforward']['de-at'] = "Rufumleitung";
 $text['label-callforward']['ro'] = "Redirecționare apel";
 $text['label-callforward']['fa'] = "";
 $text['label-callforward']['ar-eg'] = "تحويل المكالمات";
@@ -471,7 +471,7 @@ $text['header-user_dashboard']['pl'] = "Panel użytkowników";
 $text['header-user_dashboard']['he'] = "ממשק משתמש";
 $text['header-user_dashboard']['uk'] = "Панель користувача";
 $text['header-user_dashboard']['sv-se'] = "Användarpanel";
-$text['header-user_dashboard']['de-at'] = "Benutzer-Übersichtsseite";
+$text['header-user_dashboard']['de-at'] = "Benutzerübersicht";
 $text['header-user_dashboard']['ro'] = "Panou control utilizator";
 $text['header-user_dashboard']['fa'] = "";
 $text['header-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";

+ 1 - 1
core/user_settings/app_menu.php

@@ -29,7 +29,7 @@ $apps[$x]['menu'][1]['title']['pl'] = "Panel użytkowników";
 $apps[$x]['menu'][1]['title']['he'] = "ממשק משתמש";
 $apps[$x]['menu'][1]['title']['uk'] = "Панель користувача";
 $apps[$x]['menu'][1]['title']['sv-se'] = "Användarpanel";
-$apps[$x]['menu'][1]['title']['de-at'] = "Benutzer-Übersichtsseite";
+$apps[$x]['menu'][1]['title']['de-at'] = "Benutzerübersicht";
 $apps[$x]['menu'][1]['title']['ro'] = "Panou control utilizator";
 $apps[$x]['menu'][1]['title']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
 $apps[$x]['menu'][1]['uuid'] = "92c8ffdb-3c82-4f08-aec0-82421ec41bb5";

+ 1 - 1
core/users/app_languages.php

@@ -651,7 +651,7 @@ $text['label-additional_info']['ro'] = "";
 $text['label-additional_info']['de-at'] = "Zusätzliche Information";
 $text['label-additional_info']['he'] = "מידע נוסף";
 
-$text['header-user_manager']['en-us'] = "User Manager";
+$text['header-user_manager']['en-us'] = "Users";
 $text['header-user_manager']['es-cl'] = "Administración de Usuario";
 $text['header-user_manager']['pt-pt'] = "Gestão de Utilizadores";
 $text['header-user_manager']['fr-fr'] = "Gestion des utilisateurs";

+ 3 - 3
core/users/signup.php

@@ -17,7 +17,7 @@
 
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
+	Portions created by the Initial Developer are Copyright (C) 2008-2015
 	the Initial Developer. All Rights Reserved.
 
 	Contributor(s):
@@ -298,12 +298,12 @@ if (count($_POST) > 0 && check_str($_POST["persistform"]) != "1") {
 	echo "<table border='0' $tablewidth cellpadding='0' cellspacing='0'>";
 	echo "	<tr>";
 	echo "		<td class='vncellreq' width='30%'>".$text['label-username']."</td>";
-	echo "		<td class='vtable' width='70%'><input type='text' class='formfld' autocomplete='off' name='username' value='$username'></td>";
+	echo "		<td class='vtable' width='70%'><input style='display:none;' type='password' name='autocomplete'><input type='text' class='formfld' autocomplete='off' name='username' value='$username'></td>";
 	echo "	</tr>";
 
 	echo "	<tr>";
 	echo "		<td class='vncellreq'>".$text['label-password']."</td>";
-	echo "		<td class='vtable'><input type='password' class='formfld' autocomplete='off' name='password' id='password' value='$password' onfocus='compare_passwords();' onkeyup='compare_passwords();' onblur='compare_passwords();'></td>";
+	echo "		<td class='vtable'><input style='display:none;' type='password' name='autocomplete'><input type='password' class='formfld' autocomplete='off' name='password' id='password' value='$password' onfocus='compare_passwords();' onkeyup='compare_passwords();' onblur='compare_passwords();'></td>";
 	echo "	</tr>";
 	echo "	<tr>";
 	echo "		<td class='vncellreq'>".$text['label-confirm_password']."</td>";

+ 36 - 35
core/users/users.php

@@ -17,7 +17,7 @@
 
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2013
+	Portions created by the Initial Developer are Copyright (C) 2008-2015
 	the Initial Developer. All Rights Reserved.
 
 	Contributor(s):
@@ -34,6 +34,7 @@ else {
 	exit;
 }
 
+//additional includes
 	require_once "resources/paging.php";
 
 //set the variables
@@ -41,35 +42,6 @@ else {
 	$order = check_str($_GET["order"]);
 	$search_value = check_str($_REQUEST["search_value"]);
 
-//page title and description
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<form method='post' action=''>";
-	echo "<tr>\n";
-	echo "<td align='left' width='90%' nowrap='nowrap' valign='top'><b>".$text['header-user_manager']."</b></td>\n";
-	echo "<td align='right' nowrap='nowrap'>";
-	if (permission_exists('user_all')) {
-		if ($_GET['showall'] == 'true') {
-			echo "<input type='button' class='btn' value='".$text['button-back']."' onclick=\"window.location='index.php';\">\n";
-			echo "<input type='hidden' name='showall' value='true'>";
-		}
-		else {
-			echo "<input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='index.php?showall=true';\">\n";
-		}
-	}
-	echo 	"<input type='text' class='txt' style='width: 150px; margin-right: 3px;' name='search_value' value=\"".$search_value."\">";
-	echo 	"<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
-	echo "</td>";
-	echo "</tr>\n";
-	echo "</form>";
-
-	echo "<tr>\n";
-	echo "<td align='left' colspan='4'>\n";
-	echo $text['description-user_manager']."\n";
-	echo "<br />\n";
-	echo "<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
 //get the list of superadmins
 	$superadmins = superadmin_list($db);
 
@@ -157,10 +129,39 @@ else {
 	$sql .= " limit ".$rows_per_page." offset ".$offset." ";
 	$prep_statement = $db->prepare(check_sql($sql));
 	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	$result_count = count($result);
+	$users = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+	$user_count = count($users);
 	unset ($prep_statement, $sql);
 
+//page title and description
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<form method='post' action=''>";
+	echo "<tr>\n";
+	echo "<td align='left' width='90%' nowrap='nowrap' valign='top'><b>".$text['header-user_manager']." (".$num_rows.")</b></td>\n";
+	echo "<td align='right' nowrap='nowrap'>";
+	if (permission_exists('user_all')) {
+		if ($_GET['showall'] == 'true') {
+			echo "<input type='button' class='btn' value='".$text['button-back']."' onclick=\"window.location='index.php';\">\n";
+			echo "<input type='hidden' name='showall' value='true'>";
+		}
+		else {
+			echo "<input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='index.php?showall=true';\">\n";
+		}
+	}
+	echo 	"<input type='text' class='txt' style='width: 150px; margin-right: 3px;' name='search_value' value=\"".$search_value."\">";
+	echo 	"<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
+	echo "</td>";
+	echo "</tr>\n";
+	echo "</form>";
+
+	echo "<tr>\n";
+	echo "<td align='left' colspan='4'>\n";
+	echo $text['description-user_manager']."\n";
+	echo "<br />\n";
+	echo "<br />\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
 //alternate the row style
 	$c = 0;
 	$row_style["0"] = "row_style0";
@@ -185,8 +186,8 @@ else {
 	echo "</td>\n";
 	echo "</tr>\n";
 
-	if ($result_count > 0) {
-		foreach($result as $row) {
+	if ($user_count > 0) {
+		foreach($users as $row) {
 			if (if_superadmin($superadmins, $row['user_uuid']) && !if_group("superadmin")) {
 				//hide
 			} else {
@@ -233,7 +234,7 @@ else {
 				if ($c==0) { $c=1; } else { $c=0; }
 			}
 		} //end foreach
-		unset($sql, $result, $row_count);
+		unset($sql, $users, $user_count);
 	} //end if results
 
 	echo "<tr>\n";

+ 2 - 2
core/users/usersupdate.php

@@ -462,7 +462,7 @@ if (count($_POST) > 0 && $_POST["persistform"] != "1") {
 	echo "		<td width='30%' class='vncellreq' valign='top'>".$text['label-username']."</td>";
 	echo "		<td width='70%' class='vtable'>";
 	if (if_group("admin") || if_group("superadmin")) {
-		echo "		<input type='txt' autocomplete='off' class='formfld' name='username' value='".$username."' required='required'>";
+		echo "		<input type='txt' class='formfld' name='username' value='".$username."' required='required'>";
 	}
 	else {
 		echo "		".$username;
@@ -472,7 +472,7 @@ if (count($_POST) > 0 && $_POST["persistform"] != "1") {
 
 	echo "	<tr>";
 	echo "		<td class='vncell' valign='top'>".$text['label-password']."</td>";
-	echo "		<td class='vtable'><input type='password' autocomplete='off' class='formfld' name='password' id='password' value='' onfocus='compare_passwords();' onkeyup='compare_passwords();' onblur='compare_passwords();'></td>";
+	echo "		<td class='vtable'><input style='display:none;' type='password' name='autocomplete'><input type='password' autocomplete='off' class='formfld' name='password' id='password' value='' onfocus='compare_passwords();' onkeyup='compare_passwords();' onblur='compare_passwords();'></td>";
 	echo "	</tr>";
 	echo "	<tr>";
 	echo "		<td class='vncell' valign='top'>".$text['label-confirm_password']."</td>";

+ 9 - 11
resources/functions.php

@@ -27,7 +27,7 @@
 
 	if (!function_exists('software_version')) {
 		function software_version() {
-			return '4.0.0';
+			return '4.0.1';
 		}
 	}
 
@@ -771,15 +771,13 @@ function format_string ($format, $data) {
 
 //get the format and use it to format the phone number
 	function format_phone($phone_number) {
-		if (is_numeric($phone_number)) {
-			foreach ($_SESSION["format"]["phone"] as &$format) {
-				$format_count = substr_count($format, 'x');
-				$format_count = $format_count + substr_count($format, 'R');
-				$format_count = $format_count + substr_count($format, 'r');
-				if ($format_count == strlen($phone_number)) {
-					//format the number
-					$phone_number = format_string($format, $phone_number);
-				}
+		foreach ($_SESSION["format"]["phone"] as &$format) {
+			$format_count = substr_count($format, 'x');
+			$format_count = $format_count + substr_count($format, 'R');
+			$format_count = $format_count + substr_count($format, 'r');
+			if ($format_count == strlen($phone_number)) {
+				//format the number
+				$phone_number = format_string($format, $phone_number);
 			}
 		}
 		return $phone_number;
@@ -1328,4 +1326,4 @@ function number_pad($number,$n) {
 	   }
 }
 
-?>
+?>