diff options
author | Mark Crane <mcrane@pfsense.org> | 2009-01-23 04:31:45 +0000 |
---|---|---|
committer | Mark Crane <mcrane@pfsense.org> | 2009-01-23 04:31:45 +0000 |
commit | a7bd4d599217fcb8f8c3ca368af26b34ed39e3b1 (patch) | |
tree | 15d3ca92c6c3391aa05eef59f85770bbbdcb3838 /packages/phpservice | |
parent | 9a5d2b00b3016761c6077849c6c093249b36e2b5 (diff) | |
download | pfsense-packages-a7bd4d599217fcb8f8c3ca368af26b34ed39e3b1.tar.gz pfsense-packages-a7bd4d599217fcb8f8c3ca368af26b34ed39e3b1.tar.bz2 pfsense-packages-a7bd4d599217fcb8f8c3ca368af26b34ed39e3b1.zip |
PHPService package update wording links, enable/disable entries. Add link to the wiki.
Diffstat (limited to 'packages/phpservice')
-rw-r--r-- | packages/phpservice/phpservice.inc | 14 | ||||
-rw-r--r-- | packages/phpservice/phpservice.xml | 2 | ||||
-rw-r--r-- | packages/phpservice/phpservice_php.tmp | 24 | ||||
-rw-r--r-- | packages/phpservice/phpservice_php_edit.tmp | 33 |
4 files changed, 54 insertions, 19 deletions
diff --git a/packages/phpservice/phpservice.inc b/packages/phpservice/phpservice.inc index da6ada59..1718981e 100644 --- a/packages/phpservice/phpservice.inc +++ b/packages/phpservice/phpservice.inc @@ -121,11 +121,15 @@ function phpservice_sync_package_php() $tmp .= "\n"; foreach($config['installedpackages']['phpservice']['config'] as $rowhelper) { - - $tmp .= "// name: ".$rowhelper['name']." \n"; - $tmp .= "// description: ".$rowhelper['description']." \n\n"; - $tmp .= base64_decode($rowhelper['php']); - $tmp .= "\n"; + if ($rowhelper['enabled'] != "false") { + $tmp_php = base64_decode($rowhelper['php']; + if (strlen($tmp_php) > 0) { + $tmp .= "// name: ".$rowhelper['name']." \n"; + $tmp .= "// description: ".$rowhelper['description']." \n\n"; + $tmp .= base64_decode($rowhelper['php']); + $tmp .= "\n"; + } + } } diff --git a/packages/phpservice/phpservice.xml b/packages/phpservice/phpservice.xml index 2c908be6..7fa9e61a 100644 --- a/packages/phpservice/phpservice.xml +++ b/packages/phpservice/phpservice.xml @@ -52,7 +52,7 @@ <url>/packages/phpservice/phpservice_php.php</url> </menu> <service> - <name>PHPService</name> + <name>PHP Service</name> <rcfile>phpservice.sh</rcfile> <executable>phpservice</executable> <description>PHP Service</description> diff --git a/packages/phpservice/phpservice_php.tmp b/packages/phpservice/phpservice_php.tmp index 21315780..45ecf425 100644 --- a/packages/phpservice/phpservice_php.tmp +++ b/packages/phpservice/phpservice_php.tmp @@ -59,7 +59,7 @@ include("head.inc"); <?php $tab_array = array(); - $tab_array[] = array(gettext("PHP"), false, "/packages/phpservice_php.php"); + $tab_array[] = array(gettext("Settings"), false, "/packages/phpservice/phpservice_php.php"); display_top_tabs($tab_array); ?> @@ -87,9 +87,11 @@ if ($config_change == 1) { ?> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td><p><span class="vexpl"><span class="red"><strong>PHP Service<br> - </strong></span> - PHP Service is an easy way to monitor Memory, CPU, and files and send events to the system log. + <td><p><!--<span class="vexpl"><span class="red"><strong>PHP Service<br></strong></span>--> + Is command line PHP designed to run PHP as a Service. The custom PHP code that is defined below is run over and over again inside a continuous loop. There are many possible uses such as monitoring CPU, Memory, File System Space, interacting with Snort, and many others uses that are yet to be discovered. + It can send events to the sylog that will can be viewed from the system log or remote syslog server. example: exec("logger This is a test"); + <br /><br /> + For more information see: <a href='http://doc.pfsense.org/index.php/PHPService'>http://doc.pfsense.org/index.php/PHPService</a> </p></td> </tr> </table> @@ -97,8 +99,9 @@ if ($config_change == 1) { <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td width="20%" class="listhdrr">Name</td> - <td width="25%" class="listhdr">Description</td> + <td width="30%" class="listhdrr">Name</td> + <td width="20%" class="listhdrr">Enabled</td> + <td width="40%" class="listhdr">Description</td> <td width="10%" class="list"> <table border="0" cellspacing="0" cellpadding="1"> @@ -109,7 +112,7 @@ if ($config_change == 1) { </table> </td> - </tr> + </tr> <?php @@ -124,6 +127,9 @@ if ($config_change == 1) { <td class="listr" ondblclick="document.location='phpservice_php_edit.php?id=<?=$i;?>';"> <?=$ent['name'];?> </td> + <td class="listr" ondblclick="document.location='phpservice_php_edit.php?id=<?=$i;?>';"> + <?=$ent['enabled'];?> + </td> <td class="listbg" ondblclick="document.location='phpservice_php_edit.php?id=<?=$i;?>';"> <font color="#FFFFFF"><?=htmlspecialchars($ent['description']);?> </td> @@ -144,7 +150,7 @@ if ($config_change == 1) { ?> <tr> - <td class="list" colspan="2"></td> + <td class="list" colspan="3"></td> <td class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> @@ -157,7 +163,7 @@ if ($config_change == 1) { <tr> - <td class="list" colspan="2"></td> + <td class="list" colspan="3"></td> <td class="list"></td> </tr> </table> diff --git a/packages/phpservice/phpservice_php_edit.tmp b/packages/phpservice/phpservice_php_edit.tmp index fcc163bd..070c87d1 100644 --- a/packages/phpservice/phpservice_php_edit.tmp +++ b/packages/phpservice/phpservice_php_edit.tmp @@ -43,6 +43,7 @@ if (isset($id) && $a_phpservice[$id]) { $pconfig['name'] = $a_phpservice[$id]['name']; $pconfig['php'] = base64_decode($a_phpservice[$id]['php']); + $pconfig['enabled'] = $a_phpservice[$id]['enabled']; $pconfig['description'] = $a_phpservice[$id]['description']; } @@ -56,7 +57,8 @@ if ($_POST) { $ent = array(); $ent['name'] = $_POST['name']; - $ent['php'] = base64_encode($_POST['php']); + $ent['php'] = base64_encode($_POST['php']); + $ent['enabled'] = $_POST['enabled']; $ent['description'] = $_POST['description']; if (isset($id) && $a_phpservice[$id]) { @@ -100,7 +102,7 @@ function show_advanced_config() { <?php $tab_array = array(); - $tab_array[] = array(gettext("PHP"), false, "/packages/phpservice_php.php"); + $tab_array[] = array(gettext("Settings"), false, "/packages/phpservice/phpservice_php.php"); display_top_tabs($tab_array); ?> @@ -135,7 +137,7 @@ function show_advanced_config() { <td width="22%" valign="top" class="vncell">PHP</td> <td width="78%" class="vtable"> <?php - echo "<textarea name=\"php\" id=\"php\" cols=\"70\" rows=\"7\" wrap=\"off\">".htmlspecialchars($pconfig['php'])."</textarea>\n"; + echo "<textarea name=\"php\" id=\"php\" cols=\"70\" rows=\"15\" wrap=\"off\">".htmlspecialchars($pconfig['php'])."</textarea>\n"; ?> <!-- <br> @@ -149,7 +151,30 @@ function show_advanced_config() { --> </td> </tr> - + <tr> + <td width="22%" valign="top" class="vncellreq">Enabled</td> + <td width="78%" class="vtable"> + <?php + echo " <select name='enabled' class='formfld'>\n"; + echo " <option></option>\n"; + switch (htmlspecialchars($pconfig['enabled'])) { + case "true": + echo " <option value='true' selected='yes'>true</option>\n"; + echo " <option value='false'>false</option>\n"; + break; + case "false": + echo " <option value='true'>true</option>\n"; + echo " <option value='false' selected='yes'>false</option>\n"; + + break; + default: + echo " <option value='true' selected='yes'>true</option>\n"; + echo " <option value='false'>false</option>\n"; + } + echo " </select>\n"; + ?> + </td> + </tr> <tr> <td width="25%" valign="top" class="vncellreq">Description</td> <td width="75%" class="vtable"> |