Continued work on formatting the mac address for upper or lower case.
This commit is contained in:
+16
-9
@@ -298,15 +298,22 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
|
||||
//deliver the customized config over HTTP/HTTPS
|
||||
//need to make sure content-type is correct
|
||||
if ($_REQUEST['content_type'] == 'application/octet-stream') {
|
||||
$file_name = str_replace("{\$mac}",$mac,$file);
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename="'.basename($file_name).'"');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize($file_contents));
|
||||
//format the mac address and
|
||||
$format = new provision();
|
||||
$mac = $format->format_mac($mac, $device_vendor);
|
||||
|
||||
//replace the variable name with the value
|
||||
$file_name = str_replace("{\$mac}", $mac, $file);
|
||||
|
||||
//set the headers
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename="'.basename($file_name).'"');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize($file_contents));
|
||||
}
|
||||
else {
|
||||
$cfg_ext = ".cfg";
|
||||
|
||||
Reference in New Issue
Block a user