Provision save and show user agent information

This commit is contained in:
agree 2021-04-20 16:31:39 -04:00
parent def4972da0
commit ab302ebfbb
4 changed files with 28 additions and 2 deletions

View File

@ -471,6 +471,11 @@
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "device_provisioned_agent";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$y++;
$apps[$x]['db'][$y]['table']['name'] = "v_device_lines";

View File

@ -613,6 +613,26 @@ $text['label-status']['ru-ru'] = "Статус";
$text['label-status']['sv-se'] = "Status";
$text['label-status']['uk-ua'] = "Статус";
$text['label-user_agent']['en-us'] = 'User Agent';
$text['label-user_agent']['ar-eg'] = '';
$text['label-user_agent']['de-at'] = '';
$text['label-user_agent']['de-ch'] = '';
$text['label-user_agent']['de-de'] = '';
$text['label-user_agent']['es-cl'] = '';
$text['label-user_agent']['es-mx'] = '';
$text['label-user_agent']['fr-ca'] = '';
$text['label-user_agent']['fr-fr'] = '';
$text['label-user_agent']['he-il'] = '';
$text['label-user_agent']['it-it'] = '';
$text['label-user_agent']['nl-nl'] = '';
$text['label-user_agent']['pl-pl'] = '';
$text['label-user_agent']['pt-br'] = '';
$text['label-user_agent']['pt-pt'] = '';
$text['label-user_agent']['ro-ro'] = '';
$text['label-user_agent']['ru-ru'] = '';
$text['label-user_agent']['sv-se'] = '';
$text['label-user_agent']['uk-ua'] = '';
$text['label-speed_dial_active']['en-us'] = "Speed Dial Active";
$text['label-speed_dial_active']['en-gb'] = "Speed Dial Active";
$text['label-speed_dial_active']['ar-eg'] = "";

View File

@ -416,7 +416,7 @@
echo $text['label-'.$row['device_enabled']];
}
echo " </td>\n";
echo " <td class='no-link'>".escape($row['device_provisioned_date'])." - ".escape($row['device_provisioned_method'])." - <a href='http://".escape($row['device_provisioned_ip'])."' target='_blank'>".escape($row['device_provisioned_ip'])."</a>&nbsp;</td>\n";
echo " <td class='no-link'>".escape($row['device_provisioned_date'])." - ".escape($row['device_provisioned_method'])." - <a href='http://".escape($row['device_provisioned_ip'])."' target='_blank'>".escape($row['device_provisioned_ip'])."</a> - <a title='".escape($row['device_provisioned_agent'])."' href='javascript:void(0)'>".$text['label-user_agent']."</a>&nbsp;</td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row['device_description'])."&nbsp;</td>\n";
if (permission_exists('device_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>";

View File

@ -341,13 +341,14 @@ include "root.php";
//register that we have seen the device
$sql = "update v_devices ";
$sql .= "set device_provisioned_date = :device_provisioned_date, device_provisioned_method = :device_provisioned_method, device_provisioned_ip = :device_provisioned_ip ";
$sql .= "set device_provisioned_date = :device_provisioned_date, device_provisioned_method = :device_provisioned_method, device_provisioned_ip = :device_provisioned_ip, device_provisioned_agent = :device_provisioned_agent ";
$sql .= "where domain_uuid = :domain_uuid and device_mac_address = :device_mac_address ";
$parameters['domain_uuid'] = $domain_uuid;
$parameters['device_mac_address'] = strtolower($mac);
$parameters['device_provisioned_date'] = date("Y-m-d H:i:s");
$parameters['device_provisioned_method'] = (isset($_SERVER["HTTPS"]) ? 'https' : 'http');
$parameters['device_provisioned_ip'] = $_SERVER['REMOTE_ADDR'];
$parameters['device_provisioned_agent'] = $_SERVER['HTTP_USER_AGENT'];
$database = new database;
$database->execute($sql, $parameters);
unset($parameters);