| | 51 | //Check for a location settings update action |
|---|
| | 52 | if(isset($_REQUEST["isymphony_update_location_settings"])) { |
|---|
| | 53 | |
|---|
| | 54 | //Update data base |
|---|
| | 55 | isymphony_location_update( trim($_REQUEST["isymphony_admin_user_name"]), |
|---|
| | 56 | trim($_REQUEST["isymphony_admin_password"]), |
|---|
| | 57 | trim($_REQUEST["isymphony_originate_timeout"]), |
|---|
| | 58 | isset($_REQUEST["isymphony_auto_reload"]) ? "1" : "0", |
|---|
| | 59 | isset($_REQUEST["isymphony_page_status_enabled"]) ? "1" : "0", |
|---|
| | 60 | trim($_REQUEST["isymphony_jabber_host"]), |
|---|
| | 61 | trim($_REQUEST["isymphony_jabber_domain"]), |
|---|
| | 62 | trim($_REQUEST["isymphony_jabber_resource"]), |
|---|
| | 63 | trim($_REQUEST["isymphony_jabber_port"])); |
|---|
| | 64 | //Flag FreePBX for reload |
|---|
| | 65 | needreload(); |
|---|
| | 66 | } |
|---|
| | 67 | |
|---|
| | 68 | //Grab location information |
|---|
| | 69 | $locationInformation = isymphony_location_get(); |
|---|
| | 70 | |
|---|
| | 71 | //Debug url additions |
|---|
| | 72 | $debugUrlAdditions = ""; |
|---|
| | 73 | |
|---|
| 64 | | if($debug && isset($_REQUEST["showdb"])) { |
|---|
| | 76 | if(isset($_REQUEST["showmoduledb"])) { |
|---|
| | 77 | |
|---|
| | 78 | $debugUrlAdditions .= "&showmoduledb=yes"; |
|---|
| | 79 | |
|---|
| | 80 | //Build location information table |
|---|
| | 81 | $databaseDisplay .= " <table> |
|---|
| | 82 | <tr> |
|---|
| | 83 | <tr><td colspan = \"9\"><h5>Location</h5></td></tr> |
|---|
| | 84 | </tr> |
|---|
| | 85 | <tr> |
|---|
| | 86 | <td>Admin User Name   </td> |
|---|
| | 87 | <td>Admin Password   </td> |
|---|
| | 88 | <td>Originate Timeout   </td> |
|---|
| | 89 | <td>Auto Reload   </td> |
|---|
| | 90 | <td>Page Status Enabled   </td> |
|---|
| | 91 | <td>Jabber Host   </td> |
|---|
| | 92 | <td>Jabber Domain   </td> |
|---|
| | 93 | <td>Jabber Resource   </td> |
|---|
| | 94 | <td>Jabber Port   </td> |
|---|
| | 95 | </tr> |
|---|
| | 96 | <tr> |
|---|
| | 97 | <td colspan = \"9\"><hr></td> |
|---|
| | 98 | </tr> |
|---|
| | 99 | <tr> |
|---|
| | 100 | <td>{$locationInformation['admin_user_name']}</td> |
|---|
| | 101 | <td>{$locationInformation['admin_password']}</td> |
|---|
| | 102 | <td>{$locationInformation['originate_timeout']}</td> |
|---|
| | 103 | <td>{$locationInformation['auto_reload']}</td> |
|---|
| | 104 | <td>{$locationInformation['page_status_enabled']}</td> |
|---|
| | 105 | <td>{$locationInformation['jabber_host']}</td> |
|---|
| | 106 | <td>{$locationInformation['jabber_domain']}</td> |
|---|
| | 107 | <td>{$locationInformation['jabber_resource']}</td> |
|---|
| | 108 | <td>{$locationInformation['jabber_port']}</td> |
|---|
| | 109 | </tr> |
|---|
| | 110 | </table>"; |
|---|
| | 209 | //Check if a request to show module debug log was made |
|---|
| | 210 | $debugLogDisplay = ""; |
|---|
| | 211 | if(isset($_REQUEST["showmoduledebuglog"])) { |
|---|
| | 212 | |
|---|
| | 213 | $debugUrlAdditions .= "&showmoduledebuglog=yes"; |
|---|
| | 214 | |
|---|
| | 215 | $debugLogDisplay .= " <tr><td colspan=\"2\"><h5>Module Debug Log<hr></h5></td></tr> |
|---|
| | 216 | <tr><td colspan=\"2\"><p>"; |
|---|
| | 217 | |
|---|
| | 218 | //Open debug log |
|---|
| | 219 | if(($debugLogFile = fopen("/var/www/html/admin/modules/isymphony/debug.txt", 'r')) !== false) { |
|---|
| | 220 | while (!feof($debugLogFile)) { |
|---|
| | 221 | $line = fgets($debugLogFile, 4096); |
|---|
| | 222 | $debugLogDisplay .= htmlspecialchars($line) . "<br>"; |
|---|
| | 223 | } |
|---|
| | 224 | fclose($debugLogFile); |
|---|
| | 225 | } |
|---|
| | 226 | |
|---|
| | 227 | $debugLogDisplay .= "</p></td></tr>"; |
|---|
| | 228 | } |
|---|
| | 229 | |
|---|
| | 230 | //Check if a request to show module error log was made |
|---|
| | 231 | if(isset($_REQUEST["showmoduleerrorlog"])) { |
|---|
| | 232 | |
|---|
| | 233 | $debugUrlAdditions .= "&showmoduleerrorlog=yes"; |
|---|
| | 234 | |
|---|
| | 235 | $debugLogDisplay .= " <tr><td colspan=\"2\"><h5>Module Error Log<hr></h5></td></tr> |
|---|
| | 236 | <tr><td colspan=\"2\"><p>"; |
|---|
| | 237 | |
|---|
| | 238 | //Open error log |
|---|
| | 239 | if(($errorLogFile = fopen("/var/www/html/admin/modules/isymphony/error.txt", 'r')) !== false) { |
|---|
| | 240 | while (!feof($errorLogFile)) { |
|---|
| | 241 | $line = fgets($errorLogFile, 4096); |
|---|
| | 242 | $debugLogDisplay .= htmlspecialchars($line) . "<br>"; |
|---|
| | 243 | } |
|---|
| | 244 | fclose($errorLogFile); |
|---|
| | 245 | } |
|---|
| | 246 | |
|---|
| | 247 | $debugLogDisplay .= "</p></td></tr>"; |
|---|
| | 248 | } |
|---|
| | 249 | |
|---|
| | 250 | //Check if a request to show server error log was made |
|---|
| | 251 | if(isset($_REQUEST["showservererrorlog"])) { |
|---|
| | 252 | |
|---|
| | 253 | $debugUrlAdditions .= "&showservererrorlog=yes"; |
|---|
| | 254 | |
|---|
| | 255 | $debugLogDisplay .= " <tr><td colspan=\"2\"><h5>Server Error Log<hr></h5></td></tr> |
|---|
| | 256 | <tr><td colspan=\"2\"><p>"; |
|---|
| | 257 | |
|---|
| | 258 | //Open error log |
|---|
| | 259 | if(($errorLogFile = fopen("/opt/isymphony/server/logs/error.txt", 'r')) !== false) { |
|---|
| | 260 | while (!feof($errorLogFile)) { |
|---|
| | 261 | $line = fgets($errorLogFile, 4096); |
|---|
| | 262 | $debugLogDisplay .= htmlspecialchars($line) . "<br>"; |
|---|
| | 263 | } |
|---|
| | 264 | fclose($errorLogFile); |
|---|
| | 265 | } |
|---|
| | 266 | |
|---|
| | 267 | $debugLogDisplay .= "</p></td></tr>"; |
|---|
| | 268 | } |
|---|
| | 269 | |
|---|
| | 270 | //Check if a request to show server core log was made |
|---|
| | 271 | if(isset($_REQUEST["showservercorelog"])) { |
|---|
| | 272 | |
|---|
| | 273 | $debugUrlAdditions .= "&showservercorelog=yes"; |
|---|
| | 274 | |
|---|
| | 275 | $debugLogDisplay .= " <tr><td colspan=\"2\"><h5>Server Core Log<hr></h5></td></tr> |
|---|
| | 276 | <tr><td colspan=\"2\"><p>"; |
|---|
| | 277 | |
|---|
| | 278 | //Open error log |
|---|
| | 279 | if(($errorLogFile = fopen("/opt/isymphony/server/logs/core-events.txt", 'r')) !== false) { |
|---|
| | 280 | while (!feof($errorLogFile)) { |
|---|
| | 281 | $line = fgets($errorLogFile, 4096); |
|---|
| | 282 | $debugLogDisplay .= htmlspecialchars($line) . "<br>"; |
|---|
| | 283 | } |
|---|
| | 284 | fclose($errorLogFile); |
|---|
| | 285 | } |
|---|
| | 286 | |
|---|
| | 287 | $debugLogDisplay .= "</p></td></tr>"; |
|---|
| | 288 | } |
|---|
| | 289 | |
|---|
| | 290 | //Check if a request to show server communication log was made |
|---|
| | 291 | if(isset($_REQUEST["showservercommunicationlog"])) { |
|---|
| | 292 | |
|---|
| | 293 | $debugUrlAdditions .= "&showservercommunicationlog=yes"; |
|---|
| | 294 | |
|---|
| | 295 | $debugLogDisplay .= " <tr><td colspan=\"2\"><h5>Server Communication Log<hr></h5></td></tr> |
|---|
| | 296 | <tr><td colspan=\"2\"><p>"; |
|---|
| | 297 | |
|---|
| | 298 | //Open error log |
|---|
| | 299 | if(($errorLogFile = fopen("/opt/isymphony/server/logs/communication.txt", 'r')) !== false) { |
|---|
| | 300 | while (!feof($errorLogFile)) { |
|---|
| | 301 | $line = fgets($errorLogFile, 4096); |
|---|
| | 302 | $debugLogDisplay .= htmlspecialchars($line) . "<br>"; |
|---|
| | 303 | } |
|---|
| | 304 | fclose($errorLogFile); |
|---|
| | 305 | } |
|---|
| | 306 | |
|---|
| | 307 | $debugLogDisplay .= "</p></td></tr>"; |
|---|
| | 308 | } |
|---|
| | 309 | |
|---|
| | 310 | //Check if a request to show server aj external log was made |
|---|
| | 311 | if(isset($_REQUEST["showserverajexternallog"])) { |
|---|
| | 312 | |
|---|
| | 313 | $debugUrlAdditions .= "&showserverajexternallog=yes"; |
|---|
| | 314 | |
|---|
| | 315 | $debugLogDisplay .= " <tr><td colspan=\"2\"><h5>Server AJ External Log<hr></h5></td></tr> |
|---|
| | 316 | <tr><td colspan=\"2\"><p>"; |
|---|
| | 317 | |
|---|
| | 318 | //Open error log |
|---|
| | 319 | if(($errorLogFile = fopen("/opt/isymphony/server/logs/asterisk-java-external.txt", 'r')) !== false) { |
|---|
| | 320 | while (!feof($errorLogFile)) { |
|---|
| | 321 | $line = fgets($errorLogFile, 4096); |
|---|
| | 322 | $debugLogDisplay .= htmlspecialchars($line) . "<br>"; |
|---|
| | 323 | } |
|---|
| | 324 | fclose($errorLogFile); |
|---|
| | 325 | } |
|---|
| | 326 | |
|---|
| | 327 | $debugLogDisplay .= "</p></td></tr>"; |
|---|
| | 328 | } |
|---|
| | 329 | |
|---|
| | 330 | //Check if a request to show server aj internal log was made |
|---|
| | 331 | if(isset($_REQUEST["showserverajinternallog"])) { |
|---|
| | 332 | |
|---|
| | 333 | $debugUrlAdditions .= "&showserverajinternallog=yes"; |
|---|
| | 334 | |
|---|
| | 335 | $debugLogDisplay .= " <tr><td colspan=\"2\"><h5>Server AJ Internal Log<hr></h5></td></tr> |
|---|
| | 336 | <tr><td colspan=\"2\"><p>"; |
|---|
| | 337 | |
|---|
| | 338 | //Open error log |
|---|
| | 339 | if(($errorLogFile = fopen("/opt/isymphony/server/logs/asterisk-java-internal.txt", 'r')) !== false) { |
|---|
| | 340 | while (!feof($errorLogFile)) { |
|---|
| | 341 | $line = fgets($errorLogFile, 4096); |
|---|
| | 342 | $debugLogDisplay .= htmlspecialchars($line) . "<br>"; |
|---|
| | 343 | } |
|---|
| | 344 | fclose($errorLogFile); |
|---|
| | 345 | } |
|---|
| | 346 | |
|---|
| | 347 | $debugLogDisplay .= "</p></td></tr>"; |
|---|
| | 348 | } |
|---|
| | 349 | |
|---|
| 203 | | $display = "<div class=\"content\"> |
|---|
| | 408 | $display = "<script language=\"javascript\"> |
|---|
| | 409 | <!-- |
|---|
| | 410 | |
|---|
| | 411 | function checkForm() { |
|---|
| | 412 | |
|---|
| | 413 | var settingsForm = document.getElementById('isymphony_settings_form'); |
|---|
| | 414 | |
|---|
| | 415 | if(settingsForm.elements['isymphony_admin_user_name'].value.length == 0) { |
|---|
| | 416 | alert('Admin User Name cannot be blank.'); |
|---|
| | 417 | return false; |
|---|
| | 418 | } |
|---|
| | 419 | |
|---|
| | 420 | if(settingsForm.elements['isymphony_admin_password'].value.length == 0) { |
|---|
| | 421 | alert('Admin Password cannot be blank.'); |
|---|
| | 422 | return false; |
|---|
| | 423 | } |
|---|
| | 424 | |
|---|
| | 425 | if(settingsForm.elements['isymphony_originate_timeout'].value.length == 0) { |
|---|
| | 426 | alert('Originate Timeout cannot be blank.'); |
|---|
| | 427 | return false; |
|---|
| | 428 | } |
|---|
| | 429 | |
|---|
| | 430 | if(settingsForm.elements['isymphony_originate_timeout'].value != parseInt(settingsForm.elements['isymphony_originate_timeout'].value)) { |
|---|
| | 431 | alert('Originate Timeout must be numeric.'); |
|---|
| | 432 | return false; |
|---|
| | 433 | } |
|---|
| | 434 | |
|---|
| | 435 | if(settingsForm.elements['isymphony_jabber_port'].value.length == 0) { |
|---|
| | 436 | alert('Jabber Port cannot be blank.'); |
|---|
| | 437 | return false; |
|---|
| | 438 | } |
|---|
| | 439 | |
|---|
| | 440 | if(settingsForm.elements['isymphony_jabber_port'].value != parseInt(settingsForm.elements['isymphony_jabber_port'].value)) { |
|---|
| | 441 | alert('Jabber Port must be numeric.'); |
|---|
| | 442 | return false; |
|---|
| | 443 | } |
|---|
| | 444 | |
|---|
| | 445 | return true; |
|---|
| | 446 | } |
|---|
| | 447 | //--> |
|---|
| | 448 | </script> |
|---|
| | 449 | |
|---|
| | 450 | <div class=\"content\"> |
|---|
| 242 | | $debugMenuAddition |
|---|
| | 489 | |
|---|
| | 490 | <form name=\"isymphony_settings_form\" id=\"isymphony_settings_form\" action=\"config.php?type=setup&display=isymphony$debugUrlAdditions\" method=\"post\" onsubmit=\"return checkForm();\"> |
|---|
| | 491 | <tr><td colspan=\"2\"><h5>Server Settings<hr></h5></td></tr> |
|---|
| | 492 | <tr> |
|---|
| | 493 | <td><a href=\"#\" class=\"info\">Admin User Name:<span>User name used to login to the administration section in the panel.</span></a></td> |
|---|
| | 494 | <td><input size=\"20\" type=\"text\" name=\"isymphony_admin_user_name\" value=\"" . htmlspecialchars($locationInformation['admin_user_name']) . "\"></td> |
|---|
| | 495 | </tr> |
|---|
| | 496 | <tr> |
|---|
| | 497 | <td><a href=\"#\" class=\"info\">Admin Password:<span>Password used to login to the administration section in the panel.</span></a></td> |
|---|
| | 498 | <td><input size=\"20\" type=\"text\" name=\"isymphony_admin_password\" value=\"" . htmlspecialchars($locationInformation['admin_password']) . "\"></td> |
|---|
| | 499 | </tr> |
|---|
| | 500 | <tr> |
|---|
| | 501 | <td><a href=\"#\" class=\"info\">Originate Timeout:<span>Number of milliseconds that the originating extension will be rung when placing a call via the panel before timing out.</span></a></td> |
|---|
| | 502 | <td><input size=\"20\" type=\"text\" name=\"isymphony_originate_timeout\" value=\"" . htmlspecialchars($locationInformation['originate_timeout']) . "\"></td> |
|---|
| | 503 | </tr> |
|---|
| | 504 | <tr> |
|---|
| | 505 | <td><a href=\"#\" class=\"info\">Auto Reload:<span>Tells the server to automatically reload the location when the dial plan is reloaded.</span></a></td> |
|---|
| | 506 | <td><input type=\"checkbox\" name=\"isymphony_auto_reload\"" . (($locationInformation['auto_reload'] == "1") ? " checked" : "") . "></td> |
|---|
| | 507 | </tr> |
|---|
| | 508 | <tr> |
|---|
| | 509 | <td><a href=\"#\" class=\"info\">Enable Page Status:<span>If checked allows you to see paging status on extensions in the panel.</span></a></td> |
|---|
| | 510 | <td><input type=\"checkbox\" name=\"isymphony_page_status_enabled\"" . (($locationInformation['page_status_enabled'] == "1") ? " checked" : "") . "></td> |
|---|
| | 511 | </tr> |
|---|
| | 512 | |
|---|
| | 513 | <tr><td colspan=\"2\"><h5>Global Jabber Settings<hr></h5></td></tr> |
|---|
| | 514 | <tr> |
|---|
| | 515 | <td><a href=\"#\" class=\"info\">Host:<span>Jabber host to be used unless otherwise overridden by the extension settings.</span></a></td> |
|---|
| | 516 | <td><input size=\"20\" type=\"text\" name=\"isymphony_jabber_host\" value=\"" . htmlspecialchars($locationInformation['jabber_host']) . "\"></td> |
|---|
| | 517 | </tr> |
|---|
| | 518 | <tr> |
|---|
| | 519 | <td><a href=\"#\" class=\"info\">Domain:<span>Jabber domain to be used unless otherwise overridden by the extension settings.</span></a></td> |
|---|
| | 520 | <td><input size=\"20\" type=\"text\" name=\"isymphony_jabber_domain\" value=\"" . htmlspecialchars($locationInformation['jabber_domain']) . "\"></td> |
|---|
| | 521 | </tr> |
|---|
| | 522 | <tr> |
|---|
| | 523 | <td><a href=\"#\" class=\"info\">Resource:<span>Jabber resource to be used unless otherwise overridden by the extension settings.</span></a></td> |
|---|
| | 524 | <td><input size=\"20\" type=\"text\" name=\"isymphony_jabber_resource\" value=\"" . htmlspecialchars($locationInformation['jabber_resource']) . "\"></td> |
|---|
| | 525 | </tr> |
|---|
| | 526 | <tr> |
|---|
| | 527 | <td><a href=\"#\" class=\"info\">Port:<span>Jabber port to be used unless otherwise overridden by the extension settings.</span></a></td> |
|---|
| | 528 | <td><input size=\"20\" type=\"text\" name=\"isymphony_jabber_port\" value=\"" . htmlspecialchars($locationInformation['jabber_port']) . "\"></td> |
|---|
| | 529 | </tr> |
|---|
| | 530 | <tr> |
|---|
| | 531 | <td colspan=\"2\"><input type=\"Submit\" name=\"isymphony_update_location_settings\" value=\"Submit Changes\"></td> |
|---|
| | 532 | </tr> |
|---|
| | 533 | </form> |
|---|
| | 534 | <tr><td colspan=\"2\"><h5>Module Debug<hr></h5></td></tr> |
|---|
| | 535 | <tr><td><a href=\"config.php?type=setup&display=isymphony&showmoduledebuglog=yes$debugUrlAdditions\">View Debug Log</a></td></tr> |
|---|
| | 536 | <tr><td><a href=\"config.php?type=setup&display=isymphony&showmoduleerrorlog=yes$debugUrlAdditions\">View Error Log</a></td></tr> |
|---|
| | 537 | <tr><td><a href=\"config.php?type=setup&display=isymphony&showmoduledb=yes$debugUrlAdditions\">View Database</a></td></tr> |
|---|
| | 538 | <tr><td colspan=\"2\"><h5>Server Debug<hr></h5></td></tr> |
|---|
| | 539 | <tr><td><a href=\"config.php?type=setup&display=isymphony&showservererrorlog=yes$debugUrlAdditions\">View Error Log</a></td></tr> |
|---|
| | 540 | <tr><td><a href=\"config.php?type=setup&display=isymphony&showservercorelog=yes$debugUrlAdditions\">View Core Log</a></td></tr> |
|---|
| | 541 | <tr><td><a href=\"config.php?type=setup&display=isymphony&showservercommunicationlog=yes$debugUrlAdditions\">View Communication Log</a></td></tr> |
|---|
| | 542 | <tr><td><a href=\"config.php?type=setup&display=isymphony&showserverajexternallog=yes$debugUrlAdditions\">View AMI External Log</a></td></tr> |
|---|
| | 543 | <tr><td><a href=\"config.php?type=setup&display=isymphony&showserverajinternallog=yes$debugUrlAdditions\">View AMI Internal Log</a></td></tr> |
|---|
| | 544 | $debugLogDisplay |
|---|