Ver código fonte

Change device_mac_address to device_address (#9)

* Update device_logs.php

* Update device_log_edit.php

* Update app_languages.php

* Update app_config.php
FusionPBX 1 ano atrás
pai
commit
7326dbe2bb
4 arquivos alterados com 61 adições e 60 exclusões
  1. 2 1
      app_config.php
  2. 47 47
      app_languages.php
  3. 7 7
      device_log_edit.php
  4. 5 5
      device_logs.php

+ 2 - 1
app_config.php

@@ -65,7 +65,8 @@
 		$apps[$x]['db'][$y]['fields'][$z]['search_by'] = 'false';
 		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the http content body.';
 		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_mac_address';
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "device_address";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "device_mac_address";
 		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
 		$apps[$x]['db'][$y]['fields'][$z]['search_by'] = 'true';
 		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the device mac address.';

+ 47 - 47
app_languages.php

@@ -169,53 +169,53 @@
 		$text['description-timestamp']['ja-jp'] = 'http コンテンツの本文を入力します。';
 		$text['description-timestamp']['ko-kr'] = 'http 콘텐츠 본문을 입력하세요.';
 
-		$text['label-device_mac_address']['en-us'] = 'Device Address';
-		$text['label-device_mac_address']['en-gb'] = 'Device Address';
-		$text['label-device_mac_address']['ar-eg'] = 'عنوان الجهاز';
-		$text['label-device_mac_address']['de-at'] = 'Geräteadresse';
-		$text['label-device_mac_address']['de-ch'] = 'Geräteadresse';
-		$text['label-device_mac_address']['de-de'] = 'Geräteadresse';
-		$text['label-device_mac_address']['es-cl'] = 'Dirección del dispositivo';
-		$text['label-device_mac_address']['es-mx'] = 'Dirección del dispositivo';
-		$text['label-device_mac_address']['fr-ca'] = "Adresse de l'appareil";
-		$text['label-device_mac_address']['fr-fr'] = "Adresse de l'appareil";
-		$text['label-device_mac_address']['he-il'] = 'כתובת מכשיר';
-		$text['label-device_mac_address']['it-it'] = 'Indirizzo del dispositivo';
-		$text['label-device_mac_address']['nl-nl'] = 'Apparaatadres';
-		$text['label-device_mac_address']['pl-pl'] = 'Adres urządzenia';
-		$text['label-device_mac_address']['pt-br'] = 'Endereço do dispositivo';
-		$text['label-device_mac_address']['pt-pt'] = 'Endereço do dispositivo';
-		$text['label-device_mac_address']['ro-ro'] = 'Adresa dispozitivului';
-		$text['label-device_mac_address']['ru-ru'] = 'Адрес устройства';
-		$text['label-device_mac_address']['sv-se'] = 'Enhetsadress';
-		$text['label-device_mac_address']['uk-ua'] = 'Адреса пристрою';
-		$text['label-device_mac_address']['zh-cn'] = '设备地址';
-		$text['label-device_mac_address']['ja-jp'] = 'デバイスアドレス';
-		$text['label-device_mac_address']['ko-kr'] = '장치 주소';
-
-		$text['description-device_mac_address']['en-us'] = 'Enter the device mac address.';
-		$text['description-device_mac_address']['en-gb'] = 'Enter the device mac address.';
-		$text['description-device_mac_address']['ar-eg'] = 'أدخل عنوان MAC MAC.';
-		$text['description-device_mac_address']['de-at'] = 'Geben Sie die Geräte -MAC -Adresse ein.';
-		$text['description-device_mac_address']['de-ch'] = 'Geben Sie die Geräte -MAC -Adresse ein.';
-		$text['description-device_mac_address']['de-de'] = 'Geben Sie die Geräte -MAC -Adresse ein.';
-		$text['description-device_mac_address']['es-cl'] = 'Ingrese la dirección MAC del dispositivo.';
-		$text['description-device_mac_address']['es-mx'] = 'Ingrese la dirección MAC del dispositivo.';
-		$text['description-device_mac_address']['fr-ca'] = "Entrez l'adresse mac de l'appareil";
-		$text['description-device_mac_address']['fr-fr'] = "Entrez l'adresse mac de l'appareil";
-		$text['description-device_mac_address']['he-il'] = 'הזן את כתובת ה- MAC של המכשיר.';
-		$text['description-device_mac_address']['it-it'] = 'Immettere lindirizzo MAC del dispositivo.';
-		$text['description-device_mac_address']['nl-nl'] = 'Voer het MAC -adres van het apparaat in.';
-		$text['description-device_mac_address']['pl-pl'] = 'Wprowadź adres MAC urządzenia.';
-		$text['description-device_mac_address']['pt-br'] = 'Wprowadź adres MAC urządzenia.';
-		$text['description-device_mac_address']['pt-pt'] = 'Digite o endereço MAC do dispositivo.';
-		$text['description-device_mac_address']['ro-ro'] = 'Introduceți adresa MAC a dispozitivului.';
-		$text['description-device_mac_address']['ru-ru'] = 'Введите MAC -адрес устройства.';
-		$text['description-device_mac_address']['sv-se'] = 'Ange enhetens MAC -adress.';
-		$text['description-device_mac_address']['uk-ua'] = 'Введіть MAC -адресу пристрою.';
-		$text['description-device_mac_address']['zh-cn'] = '输入设备 MAC 地址。';
-		$text['description-device_mac_address']['ja-jp'] = 'デバイスの MAC アドレスを入力します。';
-		$text['description-device_mac_address']['ko-kr'] = '장치의 MAC 주소를 입력하세요.';
+		$text['label-device_address']['en-us'] = 'Device Address';
+		$text['label-device_address']['en-gb'] = 'Device Address';
+		$text['label-device_address']['ar-eg'] = 'عنوان الجهاز';
+		$text['label-device_address']['de-at'] = 'Geräteadresse';
+		$text['label-device_address']['de-ch'] = 'Geräteadresse';
+		$text['label-device_address']['de-de'] = 'Geräteadresse';
+		$text['label-device_address']['es-cl'] = 'Dirección del dispositivo';
+		$text['label-device_address']['es-mx'] = 'Dirección del dispositivo';
+		$text['label-device_address']['fr-ca'] = "Adresse de l'appareil";
+		$text['label-device_address']['fr-fr'] = "Adresse de l'appareil";
+		$text['label-device_address']['he-il'] = 'כתובת מכשיר';
+		$text['label-device_address']['it-it'] = 'Indirizzo del dispositivo';
+		$text['label-device_address']['nl-nl'] = 'Apparaatadres';
+		$text['label-device_address']['pl-pl'] = 'Adres urządzenia';
+		$text['label-device_address']['pt-br'] = 'Endereço do dispositivo';
+		$text['label-device_address']['pt-pt'] = 'Endereço do dispositivo';
+		$text['label-device_address']['ro-ro'] = 'Adresa dispozitivului';
+		$text['label-device_address']['ru-ru'] = 'Адрес устройства';
+		$text['label-device_address']['sv-se'] = 'Enhetsadress';
+		$text['label-device_address']['uk-ua'] = 'Адреса пристрою';
+		$text['label-device_address']['zh-cn'] = '设备地址';
+		$text['label-device_address']['ja-jp'] = 'デバイスアドレス';
+		$text['label-device_address']['ko-kr'] = '장치 주소';
+
+		$text['description-device_address']['en-us'] = 'Enter the device mac address.';
+		$text['description-device_address']['en-gb'] = 'Enter the device mac address.';
+		$text['description-device_address']['ar-eg'] = 'أدخل عنوان MAC MAC.';
+		$text['description-device_address']['de-at'] = 'Geben Sie die Geräte -MAC -Adresse ein.';
+		$text['description-device_address']['de-ch'] = 'Geben Sie die Geräte -MAC -Adresse ein.';
+		$text['description-device_address']['de-de'] = 'Geben Sie die Geräte -MAC -Adresse ein.';
+		$text['description-device_address']['es-cl'] = 'Ingrese la dirección MAC del dispositivo.';
+		$text['description-device_address']['es-mx'] = 'Ingrese la dirección MAC del dispositivo.';
+		$text['description-device_address']['fr-ca'] = "Entrez l'adresse mac de l'appareil";
+		$text['description-device_address']['fr-fr'] = "Entrez l'adresse mac de l'appareil";
+		$text['description-device_address']['he-il'] = 'הזן את כתובת ה- MAC של המכשיר.';
+		$text['description-device_address']['it-it'] = 'Immettere lindirizzo MAC del dispositivo.';
+		$text['description-device_address']['nl-nl'] = 'Voer het MAC -adres van het apparaat in.';
+		$text['description-device_address']['pl-pl'] = 'Wprowadź adres MAC urządzenia.';
+		$text['description-device_address']['pt-br'] = 'Wprowadź adres MAC urządzenia.';
+		$text['description-device_address']['pt-pt'] = 'Digite o endereço MAC do dispositivo.';
+		$text['description-device_address']['ro-ro'] = 'Introduceți adresa MAC a dispozitivului.';
+		$text['description-device_address']['ru-ru'] = 'Введите MAC -адрес устройства.';
+		$text['description-device_address']['sv-se'] = 'Ange enhetens MAC -adress.';
+		$text['description-device_address']['uk-ua'] = 'Введіть MAC -адресу пристрою.';
+		$text['description-device_address']['zh-cn'] = '输入设备 MAC 地址。';
+		$text['description-device_address']['ja-jp'] = 'デバイスの MAC アドレスを入力します。';
+		$text['description-device_address']['ko-kr'] = '장치의 MAC 주소를 입력하세요.';
 
 		$text['label-request_scheme']['en-us'] = 'Request Scheme';
 		$text['label-request_scheme']['en-gb'] = 'Request Scheme';

+ 7 - 7
device_log_edit.php

@@ -58,7 +58,7 @@
 		$device_log_uuid = $_POST["device_log_uuid"] ?? null;
 		$device_uuid = $_POST["device_uuid"] ?? null;
 		$timestamp = $_POST["timestamp"] ?? '';
-		$device_mac_address = $_POST["device_mac_address"] ?? '';
+		$device_address = $_POST["device_address"] ?? '';
 		$request_scheme = $_POST["request_scheme"] ?? '';
 		$http_host = $_POST["http_host"] ?? '';
 		$server_port = $_POST["server_port"] ?? '';
@@ -106,7 +106,7 @@
 			$msg = '';
 			//if (strlen($device_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-device_uuid']."<br>\n"; }
 			if (strlen($timestamp) == 0) { $msg .= $text['message-required']." ".$text['label-timestamp']."<br>\n"; }
-			if (strlen($device_mac_address) == 0) { $msg .= $text['message-required']." ".$text['label-device_mac_address']."<br>\n"; }
+			if (strlen($device_address) == 0) { $msg .= $text['message-required']." ".$text['label-device_address']."<br>\n"; }
 			if (strlen($request_scheme) == 0) { $msg .= $text['message-required']." ".$text['label-request_scheme']."<br>\n"; }
 			if (strlen($http_host) == 0) { $msg .= $text['message-required']." ".$text['label-http_host']."<br>\n"; }
 			if (strlen($server_port) == 0) { $msg .= $text['message-required']." ".$text['label-server_port']."<br>\n"; }
@@ -140,7 +140,7 @@
 			$array['device_logs'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
 			$array['device_logs'][0]['device_uuid'] = $device_uuid;
 			$array['device_logs'][0]['timestamp'] = $timestamp;
-			$array['device_logs'][0]['device_mac_address'] = $device_mac_address;
+			$array['device_logs'][0]['device_address'] = $device_address;
 			$array['device_logs'][0]['request_scheme'] = $request_scheme;
 			$array['device_logs'][0]['http_host'] = $http_host;
 			$array['device_logs'][0]['server_port'] = $server_port;
@@ -186,7 +186,7 @@
 		if (is_array($row) && sizeof($row) != 0) {
 			$device_uuid = $row["device_uuid"];
 			$timestamp = $row["timestamp"];
-			$device_mac_address = $row["device_mac_address"];
+			$device_address = $row["device_address"];
 			$request_scheme = $row["request_scheme"];
 			$http_host = $row["http_host"];
 			$server_port = $row["server_port"];
@@ -257,12 +257,12 @@
 
 	echo "<tr>\n";
 	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-device_mac_address']."\n";
+	echo "	".$text['label-device_address']."\n";
 	echo "</td>\n";
 	echo "<td class='vtable' style='position: relative;' align='left'>\n";
-	echo "	<input class='formfld' type='text' name='device_mac_address' maxlength='255' value='".escape($device_mac_address)."'>\n";
+	echo "	<input class='formfld' type='text' name='device_address' maxlength='255' value='".escape($device_address)."'>\n";
 	echo "<br />\n";
-	echo $text['description-device_mac_address']."\n";
+	echo $text['description-device_address']."\n";
 	echo "</td>\n";
 	echo "</tr>\n";
 

+ 5 - 5
device_logs.php

@@ -114,7 +114,7 @@
 	}
 	if (isset($search)) {
 		$sql .= "and (";
-		$sql .= "	lower(device_mac_address) like :search ";
+		$sql .= "	lower(device_address) like :search ";
 		$sql .= "	or lower(request_scheme) like :search ";
 		$sql .= "	or lower(http_host) like :search ";
 		$sql .= "	or lower(server_port) like :search ";
@@ -148,7 +148,7 @@
 	$sql .= "timestamp, \n";
 	$sql .= "to_char(timezone(:time_zone, timestamp), 'DD Mon YYYY') as date_formatted, \n";
 	$sql .= "to_char(timezone(:time_zone, timestamp), 'HH12:MI:SS am') as time_formatted, \n";
-	$sql .= "device_mac_address, \n";
+	$sql .= "device_address, \n";
 	$sql .= "request_scheme, \n";
 	$sql .= "http_host, \n";
 	$sql .= "server_port, \n";
@@ -170,7 +170,7 @@
 	$sql .= "and l.domain_uuid = d.domain_uuid \n";
 	if (isset($search)) {
 		$sql .= "and ( \n";
-		$sql .= "	lower(device_mac_address) like :search \n";
+		$sql .= "	lower(device_address) like :search \n";
 		$sql .= "	or lower(request_scheme) like :search \n";
 		$sql .= "	or lower(http_host) like :search \n";
 		$sql .= "	or lower(server_port) like :search \n";
@@ -263,7 +263,7 @@
 	}
 	echo "<th class='left'>".$text['label-date']."</th>\n";
 	echo "<th class='left hide-md-dn'>".$text['label-time']."</th>\n";
-	echo th_order_by('device_mac_address', $text['label-device_mac_address'], $order_by, $order);
+	echo th_order_by('device_address', $text['label-device_address'], $order_by, $order);
 	echo "<th class='left hide-sm-dn'>".$text['label-request_scheme']."</th>\n";
 	echo "<th class='left hide-md-dn'>".$text['label-http_host']."</th>\n";
 	echo "<th class='left hide-md-dn'>".$text['label-server_port']."</th>\n";
@@ -296,7 +296,7 @@
 			}
 			echo "	<td>".escape($row['date_formatted'])."</td>\n";
 			echo "	<td class='left hide-md-dn'>".escape($row['time_formatted'])."</td>\n";
-			echo "	<td>".escape($row['device_mac_address'])."</td>\n";
+			echo "	<td>".escape($row['device_address'])."</td>\n";
 			echo "	<td class='left hide-sm-dn'>".escape($row['request_scheme'])."</td>\n";
 			echo "	<td class='left hide-md-dn'>".escape($row['http_host'])."</td>\n";
 			echo "	<td class='left hide-md-dn'>".escape($row['server_port'])."</td>\n";