diff options
author | Renato Botelho <renato@netgate.com> | 2015-08-24 07:42:08 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-08-24 07:42:08 -0300 |
commit | 4a3a907f0cd4f7a2f192f304156d7fe7d7e16f1a (patch) | |
tree | 73f569dbd56c3323b19fcfa7991d025941fc9e6c /config/siproxd/siproxd_registered_phones.php | |
parent | 578de02e7d40261852ab7f45a1fd314ba112116e (diff) | |
parent | f8b4503edb891500893ba86ab852de9373154b4a (diff) | |
download | pfsense-packages-4a3a907f0cd4f7a2f192f304156d7fe7d7e16f1a.tar.gz pfsense-packages-4a3a907f0cd4f7a2f192f304156d7fe7d7e16f1a.tar.bz2 pfsense-packages-4a3a907f0cd4f7a2f192f304156d7fe7d7e16f1a.zip |
Merge pull request #1010 from doktornotor/patch-7
Diffstat (limited to 'config/siproxd/siproxd_registered_phones.php')
-rw-r--r-- | config/siproxd/siproxd_registered_phones.php | 172 |
1 files changed, 85 insertions, 87 deletions
diff --git a/config/siproxd/siproxd_registered_phones.php b/config/siproxd/siproxd_registered_phones.php index a8789d7f..51eb474a 100644 --- a/config/siproxd/siproxd_registered_phones.php +++ b/config/siproxd/siproxd_registered_phones.php @@ -1,7 +1,9 @@ <?php /* siproxd_registered_phones.php + part of pfSense (https://www.pfSense.org/) Copyright (C) 2010 Jim Pingle + Copyright (C) 2015 ESF, LLC All rights reserved. Redistribution and use in source and binary forms, with or without @@ -36,8 +38,7 @@ ##|*MATCH=siproxd_registered_phones.php* ##|-PRIV -require("guiconfig.inc"); -$pgtitle = array(gettext("Status"), gettext("siproxd Registered Phones")); +require_once("guiconfig.inc"); $phonetext = file_get_contents("/var/siproxd/siproxd_registrations"); $phonedata = explode("\n", $phonetext); @@ -47,27 +48,28 @@ if (!is_array($phonedata)) { } $activephones = array(); -for ($i=0; $i < count($phonedata); $i++) { +for ($i = 0; $i < count($phonedata); $i++) { list($stars, $active, $expires) = explode(":", $phonedata[$i]); if ($active == "1") { $phone = array(); $phone["expires"] = $expires; - $phone["real"]["type"] = $phonedata[++$i]; - $phone["real"]["user"] = $phonedata[++$i]; - $phone["real"]["host"] = $phonedata[++$i]; - $phone["real"]["port"] = $phonedata[++$i]; - $phone["nat"]["type"] = $phonedata[++$i]; - $phone["nat"]["user"] = $phonedata[++$i]; - $phone["nat"]["host"] = $phonedata[++$i]; - $phone["nat"]["port"] = $phonedata[++$i]; - $phone["registered"]["type"] = $phonedata[++$i]; - $phone["registered"]["user"] = $phonedata[++$i]; - $phone["registered"]["host"] = $phonedata[++$i]; - $phone["registered"]["port"] = $phonedata[++$i]; + $phone["real"]["type"] = $phonedata[++$i]; + $phone["real"]["user"] = $phonedata[++$i]; + $phone["real"]["host"] = $phonedata[++$i]; + $phone["real"]["port"] = $phonedata[++$i]; + $phone["nat"]["type"] = $phonedata[++$i]; + $phone["nat"]["user"] = $phonedata[++$i]; + $phone["nat"]["host"] = $phonedata[++$i]; + $phone["nat"]["port"] = $phonedata[++$i]; + $phone["registered"]["type"] = $phonedata[++$i]; + $phone["registered"]["user"] = $phonedata[++$i]; + $phone["registered"]["host"] = $phonedata[++$i]; + $phone["registered"]["port"] = $phonedata[++$i]; $activephones[] = $phone; } } +$pgtitle = array(gettext("Status"), gettext("siproxd Registered Phones")); require("head.inc"); ?> @@ -77,8 +79,7 @@ require("head.inc"); <br /> <table width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td> +<tr><td> <?php $tab_array = array(); $tab_array[] = array(gettext("Settings"), false, "pkg_edit.php?xml=siproxd.xml&id=0"); @@ -86,76 +87,73 @@ require("head.inc"); $tab_array[] = array(gettext("Registered Phones"), true, "siproxd_registered_phones.php"); display_top_tabs($tab_array); ?> - </td> - </tr> - - <tr> - <td> - <div id="mainarea"> - <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0"> - <thead> - <tr> - <td colspan="16" class="listtopic"><?php echo gettext("Currently Registered Phones") . " (" . count($activephones) . ")"; ?></td> - </tr> - <tr> - <th colspan="5">Real Phone</th> - <th colspan="5">NAT Address</th> - <th colspan="4">Registered With</th> - <th colspan="2"> </th> - </tr> - <tr> - <th>Type</th> - <th>User</th> - <th>Host</th> - <th>Port</th> - <th> </th> - <th>Type</th> - <th>User</th> - <th>Host</th> - <th>Port</th> - <th> </th> - <th>Type</th> - <th>User</th> - <th>Host</th> - <th>Port</th> - <th> </th> - <th>Expires</th> - </tr> - </thead> - <?php if (count($phonedata) == 0): ?> - <tr><td colspan="16" align="center">No Phone Data Found</td></tr> - <? elseif (count($activephones) == 0): ?> - <tr><td colspan="16" align="center">No Active Phones</td></tr> - <? else: ?> - <? foreach ($activephones as $phone): ?> - <tr> - <td align="center" class="listlr"><? echo ($phone['real']['type']) ? $phone['real']['type'] : "sip"; ?></td> - <td align="center" class="listr"><? echo ($phone['real']['user']) ? $phone['real']['user'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['real']['host']) ? $phone['real']['host'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['real']['port']) ? $phone['real']['port'] : "5060"; ?></td> - - <td align="center" class="list"> </td> - <td align="center" class="listlr"><? echo ($phone['nat']['type']) ? $phone['nat']['type'] : "sip"; ?></td> - <td align="center" class="listr"><? echo ($phone['nat']['user']) ? $phone['nat']['user'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['nat']['host']) ? $phone['nat']['host'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['nat']['port']) ? $phone['nat']['port'] : "5060"; ?></td> - - <td align="center" class="list"> </td> - <td align="center" class="listlr"><? echo ($phone['registered']['type']) ? $phone['registered']['type'] : "sip"; ?></td> - <td align="center" class="listr"><? echo ($phone['registered']['user']) ? $phone['registered']['user'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['registered']['host']) ? $phone['registered']['host'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['registered']['port']) ? $phone['registered']['port'] : "5060"; ?></td> - - <td align="center" class="list"> </td> - <td align="center" class="listlr"><? echo date("m/d/Y h:i:sa", $phone['expires']); ?></td> - </tr> - <? endforeach; ?> - <? endif; ?> - </table> - </div> - </td> - </tr> - +</td></tr> + +<tr><td> + <div id="mainarea"> + <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0"> + <thead> + <tr> + <td colspan="16" class="listtopic"><?php echo gettext("Currently Registered Phones") . " (" . count($activephones) . ")"; ?></td> + </tr> + <tr> + <th colspan="5">Real Phone</th> + <th colspan="5">NAT Address</th> + <th colspan="4">Registered With</th> + <th colspan="2"> </th> + </tr> + <tr> + <th>Type</th> + <th>User</th> + <th>Host</th> + <th>Port</th> + <th> </th> + <th>Type</th> + <th>User</th> + <th>Host</th> + <th>Port</th> + <th> </th> + <th>Type</th> + <th>User</th> + <th>Host</th> + <th>Port</th> + <th> </th> + <th>Expires</th> + </tr> + </thead> + + <?php if (count($phonedata) == 0): ?> + <tr><td colspan="16" align="center">No Phone Data Found</td></tr> + <? elseif (count($activephones) == 0): ?> + <tr><td colspan="16" align="center">No Active Phones</td></tr> + <? else: ?> + <? foreach ($activephones as $phone): ?> + <tr> + <td align="center" class="listlr"><? echo ($phone['real']['type']) ? $phone['real']['type'] : "sip"; ?></td> + <td align="center" class="listr"><? echo ($phone['real']['user']) ? $phone['real']['user'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['real']['host']) ? $phone['real']['host'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['real']['port']) ? $phone['real']['port'] : "5060"; ?></td> + + <td align="center" class="list"> </td> + <td align="center" class="listlr"><? echo ($phone['nat']['type']) ? $phone['nat']['type'] : "sip"; ?></td> + <td align="center" class="listr"><? echo ($phone['nat']['user']) ? $phone['nat']['user'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['nat']['host']) ? $phone['nat']['host'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['nat']['port']) ? $phone['nat']['port'] : "5060"; ?></td> + + <td align="center" class="list"> </td> + <td align="center" class="listlr"><? echo ($phone['registered']['type']) ? $phone['registered']['type'] : "sip"; ?></td> + <td align="center" class="listr"><? echo ($phone['registered']['user']) ? $phone['registered']['user'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['registered']['host']) ? $phone['registered']['host'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['registered']['port']) ? $phone['registered']['port'] : "5060"; ?></td> + + <td align="center" class="list"> </td> + <td align="center" class="listlr"><? echo date("m/d/Y h:i:sa", $phone['expires']); ?></td> + </tr> + <? endforeach; ?> + <? endif; ?> + </table> + </div> +</td></tr> </table> <?php include("fend.inc"); ?> |