diff --git a/app/fax/fax.php b/app/fax/fax.php index d0baf34a3c..516720ebaa 100644 --- a/app/fax/fax.php +++ b/app/fax/fax.php @@ -152,12 +152,12 @@ require_once "resources/paging.php"; echo " ".$text['label-new']."  "; } if (permission_exists('fax_inbox_view')) { - $remote = ($row['fax_email_connection_host'] != '' && $row['fax_email_connection_mailbox'] != '') ? "_remote" : null; + $file = ($row['fax_email_connection_host'] != '' && $row['fax_email_connection_mailbox'] != '') ? "fax_box_remote.php" : "fax_files.php"; $box = ($row['fax_email_connection_host'] != '' && $row['fax_email_connection_mailbox'] != '') ? $row['fax_email_connection_mailbox'] : 'inbox'; - echo " ".$text['label-inbox']."  "; + echo " ".$text['label-inbox']."  "; } if (permission_exists('fax_sent_view')) { - echo " ".$text['label-sent']."  "; + echo " ".$text['label-sent']."  "; } if (permission_exists('fax_log_view')) { echo " ".$text['label-log'].""; diff --git a/app/fax/fax_file_delete.php b/app/fax/fax_file_delete.php index 54a69413ad..d311f8852d 100644 --- a/app/fax/fax_file_delete.php +++ b/app/fax/fax_file_delete.php @@ -59,5 +59,4 @@ if (strlen($id)>0) { $_SESSION['message'] = $text['message-delete']; header('Location: fax_files.php'); - ?> \ No newline at end of file diff --git a/app/fax/fax_files.php b/app/fax/fax_files.php index ad246990ae..f3110d9907 100644 --- a/app/fax/fax_files.php +++ b/app/fax/fax_files.php @@ -33,6 +33,7 @@ else { echo "access denied"; exit; } + //add multi-lingual support require_once "app_languages.php"; foreach($text as $key => $value) { @@ -134,10 +135,10 @@ else { echo "\n"; echo " \n"; echo " \n"; @@ -227,12 +228,12 @@ else { //decode the base64 if (strlen($row['fax_base64']) > 0) { - if ($_REQUEST['box'] == 'inbox') { + if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) { if (!file_exists($dir_fax_inbox.'/'.$file)) { file_put_contents($dir_fax_inbox.'/'.$file, base64_decode($row['fax_base64'])); } } - if ($_REQUEST['box'] == 'sent') { + if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) { if (!file_exists($dir_fax_sent.'/'.$file)) { //decode the base64 file_put_contents($dir_fax_sent.'/'.$file, base64_decode($row['fax_base64'])); @@ -242,7 +243,7 @@ else { } //convert the tif to pdf if (!file_exists($dir_fax_inbox.'/'.$file_name.".pdf")) { - if ($_REQUEST['box'] == 'inbox') { + if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) { chdir($dir_fax_inbox); if (is_file("/usr/local/bin/tiff2pdf")) { exec("/usr/local/bin/tiff2pdf -f -o ".$file_name.".pdf ".$dir_fax_inbox.'/'.$file_name.".tif"); @@ -251,7 +252,7 @@ else { exec("/usr/bin/tiff2pdf -f -o ".$file_name.".pdf ".$dir_fax_inbox.'/'.$file_name.".tif"); } } - if ($_REQUEST['box'] == 'sent') { + if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) { chdir($dir_fax_sent); if (is_file("/usr/local/bin/tiff2pdf")) { exec("/usr/local/bin/tiff2pdf -f -o ".$file_name.".pdf ".$dir_fax_sent.'/'.$file_name.".tif"); @@ -265,10 +266,10 @@ else { echo "\n"; echo "\n"; echo " \n"; echo " \n"; //echo " \n"; - echo " \n"; echo " \n"; echo " \n";
\n"; - if ($_REQUEST['box'] == 'inbox') { + if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) { echo " ".$text['header-inbox'].": ".$fax_name." (".$fax_extension.")\n"; } - if ($_REQUEST['box'] == 'sent') { + if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) { echo " ".$text['header-sent'].": ".$fax_name." (".$fax_extension.")\n"; } echo "
\n"; - if ($_REQUEST['box'] == 'inbox') { + if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) { echo " \n"; } - if ($_REQUEST['box'] == 'sent') { + if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) { echo " \n"; } echo " $file_name"; @@ -277,14 +278,17 @@ else { echo " \n"; if ($_REQUEST['box'] == 'inbox') { $dir_fax = $dir_fax_inbox; - $type = "fax_inbox"; } if ($_REQUEST['box'] == 'sent') { $dir_fax = $dir_fax_sent; - $type = "fax_sent"; } if (file_exists($dir_fax.'/'.$file_name.".pdf")) { - echo " \n"; + if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) { + echo " \n"; + } + if ($_REQUEST['box'] == 'sent' && permission_exists('fax_sent_view')) { + echo " \n"; + } echo " PDF"; echo " "; } @@ -296,7 +300,6 @@ else { //echo " PDF ".$row['fax_number']." ".$row['fax_file_type']." ".$row['fax_caller_id_name']." ".$row['fax_caller_id_number']." ".date("F d Y H:i:s", strtotime($row['fax_date']))."