Fork of FusionPBX but with LDAP kinda working
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

234 lines
8.3 KiB

2 years ago
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <markjcrane@fusionpbx.com>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2020
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <markjcrane@fusionpbx.com>
  20. */
  21. //includes
  22. require_once "root.php";
  23. require_once "resources/require.php";
  24. require_once "resources/check_auth.php";
  25. //check permissions
  26. if (permission_exists('fax_log_view')) {
  27. //access granted
  28. }
  29. else {
  30. echo "access denied";
  31. exit;
  32. }
  33. //add multi-lingual support
  34. $language = new text;
  35. $text = $language->get();
  36. //validate the uuids
  37. if (is_uuid($_REQUEST["id"])) {
  38. $fax_log_uuid = $_REQUEST["id"];
  39. }
  40. if (is_uuid($_REQUEST["fax_uuid"])) {
  41. $fax_uuid = $_REQUEST["fax_uuid"];
  42. }
  43. //process the http post data by submitted action
  44. if ($_POST['action'] != '' && is_uuid($fax_log_uuid) && is_uuid($fax_uuid)) {
  45. $array[0]['checked'] = 'true';
  46. $array[0]['uuid'] = $fax_log_uuid;
  47. switch ($_POST['action']) {
  48. case 'delete':
  49. if (permission_exists('fax_log_delete')) {
  50. $obj = new fax;
  51. $obj->fax_uuid = $fax_uuid;
  52. $obj->delete_logs($array);
  53. }
  54. break;
  55. }
  56. header('Location: fax_logs.php?id='.urlencode($fax_uuid));
  57. exit;
  58. }
  59. //pre-populate the form
  60. if (is_uuid($fax_log_uuid) && is_uuid($fax_uuid)) {
  61. $sql = "select * from v_fax_logs ";
  62. $sql .= "where domain_uuid = :domain_uuid ";
  63. $sql .= "and fax_log_uuid = :fax_log_uuid ";
  64. $parameters['domain_uuid'] = $domain_uuid;
  65. $parameters['fax_log_uuid'] = $fax_log_uuid;
  66. $database = new database;
  67. $row = $database->select($sql, $parameters, 'row');
  68. if (is_array($row) && @sizeof($row) != 0) {
  69. $fax_log_uuid = $row["fax_log_uuid"];
  70. $fax_success = $row["fax_success"];
  71. $fax_result_code = $row["fax_result_code"];
  72. $fax_result_text = $row["fax_result_text"];
  73. $fax_file = $row["fax_file"];
  74. $fax_ecm_used = $row["fax_ecm_used"];
  75. $fax_local_station_id = $row["fax_local_station_id"];
  76. $fax_document_transferred_pages = $row["fax_document_transferred_pages"];
  77. $fax_document_total_pages = $row["fax_document_total_pages"];
  78. $fax_image_resolution = $row["fax_image_resolution"];
  79. $fax_image_size = $row["fax_image_size"];
  80. $fax_bad_rows = $row["fax_bad_rows"];
  81. $fax_transfer_rate = $row["fax_transfer_rate"];
  82. $fax_retry_attempts = $row["fax_retry_attempts"];
  83. $fax_retry_limit = $row["fax_retry_limit"];
  84. $fax_retry_sleep = $row["fax_retry_sleep"];
  85. $fax_uri = $row["fax_uri"];
  86. $fax_date = $row["fax_date"];
  87. $fax_epoch = $row["fax_epoch"];
  88. }
  89. unset($sql, $parameters, $row);
  90. }
  91. //create token
  92. $object = new token;
  93. $token = $object->create($_SERVER['PHP_SELF']);
  94. //show the header
  95. $document['title'] = $text['title-fax_logs'];
  96. require_once "resources/header.php";
  97. //show the content
  98. echo "<form method='post' name='frm' id='frm'>\n";
  99. echo "<div class='action_bar' id='action_bar'>\n";
  100. echo " <div class='heading'><b>".$text['title-fax_log']."</b></div>\n";
  101. echo " <div class='actions'>\n";
  102. echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','link'=>'fax_logs.php?id='.urlencode($fax_uuid)]);
  103. if (permission_exists('fax_log_delete')) {
  104. echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'name'=>'btn_delete','style'=>'margin-left: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
  105. }
  106. echo " </div>\n";
  107. echo " <div style='clear: both;'></div>\n";
  108. echo "</div>\n";
  109. if (permission_exists('fax_log_delete')) {
  110. echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
  111. }
  112. echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
  113. echo "<tr>\n";
  114. echo "<td width='30%' class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_success']."</td>\n";
  115. echo "<td width='70%' class='vtable'>".escape($fax_success)."</td>\n";
  116. echo "</tr>\n";
  117. echo "<tr>\n";
  118. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_result_code']."</td>\n";
  119. echo "<td class='vtable'>".escape($fax_result_code)."</td>\n";
  120. echo "</tr>\n";
  121. echo "<tr>\n";
  122. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_result_text']."</td>\n";
  123. echo "<td class='vtable'>".escape($fax_result_text)."</td>\n";
  124. echo "</tr>\n";
  125. echo "<tr>\n";
  126. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_file']."</td>\n";
  127. echo "<td class='vtable'>".escape($fax_file)."</td>\n";
  128. echo "</tr>\n";
  129. echo "<tr>\n";
  130. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_ecm_used']."</td>\n";
  131. echo "<td class='vtable'>".escape($fax_ecm_used)."</td>\n";
  132. echo "</tr>\n";
  133. echo "<tr>\n";
  134. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_local_station_id']."</td>\n";
  135. echo "<td class='vtable'>".escape($fax_local_station_id)."</td>\n";
  136. echo "</tr>\n";
  137. echo "<tr>\n";
  138. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_document_transferred_pages']."</td>\n";
  139. echo "<td class='vtable'>".$fax_document_transferred_pages."</td>\n";
  140. echo "</tr>\n";
  141. echo "<tr>\n";
  142. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_document_total_pages']."</td>\n";
  143. echo "<td class='vtable'>".escape($fax_document_total_pages)."</td>\n";
  144. echo "</tr>\n";
  145. echo "<tr>\n";
  146. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_image_resolution']."</td>\n";
  147. echo "<td class='vtable'>".escape($fax_image_resolution)."</td>\n";
  148. echo "</tr>\n";
  149. echo "<tr>\n";
  150. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_image_size']."</td>\n";
  151. echo "<td class='vtable'>".escape($fax_image_size)."</td>\n";
  152. echo "</tr>\n";
  153. echo "<tr>\n";
  154. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_bad_rows']."</td>\n";
  155. echo "<td class='vtable'>".escape($fax_bad_rows)."</td>\n";
  156. echo "</tr>\n";
  157. echo "<tr>\n";
  158. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_transfer_rate']."</td>\n";
  159. echo "<td class='vtable'>".escape($fax_transfer_rate)."</td>\n";
  160. echo "</tr>\n";
  161. echo "<tr>\n";
  162. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_retry_attempts']."</td>\n";
  163. echo "<td class='vtable'>".escape($fax_retry_attempts)."</td>\n";
  164. echo "</tr>\n";
  165. echo "<tr>\n";
  166. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_retry_limit']."</td>\n";
  167. echo "<td class='vtable'>".escape($fax_retry_limit)."</td>\n";
  168. echo "</tr>\n";
  169. echo "<tr>\n";
  170. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_retry_sleep']."</td>\n";
  171. echo "<td class='vtable'>".escape($fax_retry_sleep)."</td>\n";
  172. echo "</tr>\n";
  173. echo "<tr>\n";
  174. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_uri']."</td>\n";
  175. echo "<td class='vtable'>".escape($fax_uri)."</td>\n";
  176. echo "</tr>\n";
  177. echo "<tr>\n";
  178. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_date']."</td>\n";
  179. echo "<td class='vtable'>".escape($fax_date)."</td>\n";
  180. echo "</tr>\n";
  181. echo "<tr>\n";
  182. echo "<td class='vncell' valign='top' nowrap='nowrap'>".$text['label-fax_epoch']."</td>\n";
  183. echo "<td class='vtable'>".escape($fax_epoch)."</td>\n";
  184. echo "</tr>\n";
  185. echo "</table>";
  186. echo "<br /><br />";
  187. echo "<input type='hidden' name='id' value='".escape($fax_log_uuid)."'>\n";
  188. echo "<input type='hidden' name='fax_uuid' value='".escape($fax_uuid)."'>\n";
  189. echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
  190. echo "</form>";
  191. //include the footer
  192. require_once "resources/footer.php";
  193. ?>