aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-04-28 00:03:10 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-04-28 00:03:10 +0000
commit665ef04603f8b9f1b1b222f907e2c35207e25339 (patch)
tree8d77be28fee5084fa4f420f051bef33da23e09db
parentdeb4fcb23a39d56c9aa6efe49f28323885ad89bd (diff)
downloadpfsense-packages-665ef04603f8b9f1b1b222f907e2c35207e25339.tar.gz
pfsense-packages-665ef04603f8b9f1b1b222f907e2c35207e25339.tar.bz2
pfsense-packages-665ef04603f8b9f1b1b222f907e2c35207e25339.zip
Cleanup Disable/Enable Carp button to left.
Requested-by: hoba
-rw-r--r--packages/carp_status.php36
1 files changed, 11 insertions, 25 deletions
diff --git a/packages/carp_status.php b/packages/carp_status.php
index f6f085b6..2bcb7efa 100644
--- a/packages/carp_status.php
+++ b/packages/carp_status.php
@@ -35,20 +35,10 @@ function gentitle_pkg($pgname) {
return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname;
}
-/* grab the current status of carp */
-$status = `/sbin/sysctl net.inet.carp.allow`;
-$status = str_replace("\n","",$status);
-$status = str_replace(" ","",$status);
-$status = split(":", $status);
-
-$carp_counter=0;
+$status = get_carp_status();
if($_POST['disablecarp'] <> "") {
- $status = `/sbin/sysctl net.inet.carp.allow`;
- $status = str_replace("\n","",$status);
- $status = str_replace(" ","",$status);
- $status = split(":", $status);
- if($status[1] == "1") {
- $savemsg = "{$carp_counter} items have been disabled.";
+ if($status == true) {
+ $savemsg = "{$carp_counter} ip's have been disabled.";
$carp_counter=find_number_of_created_carp_interfaces();
for($x=0; $x<$carp_counter; $x++)
mwexec("/sbin/ifconfig carp{$x} delete");
@@ -60,11 +50,7 @@ if($_POST['disablecarp'] <> "") {
}
}
-/* grab the current status of carp */
-$status = `/sbin/sysctl net.inet.carp.allow`;
-$status = str_replace("\n","",$status);
-$status = str_replace(" ","",$status);
-$status = split(":", $status);
+$status = get_carp_status();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
@@ -93,17 +79,17 @@ include("fbegin.inc");
</td></tr>
<tr><td class="tabcont">
-<table width="100%" border="0" cellpadding="6" cellspacing="0">
-<tr>
<?php
- if($status[1] == "0") {
- echo "<td colspan=\"6\"><center><input type=\"submit\" name=\"disablecarp\" id=\"disablecarp\" value=\"Enable Carp\"></td>";
+ if($status == false) {
+ echo "<input type=\"submit\" name=\"disablecarp\" id=\"disablecarp\" value=\"Enable Carp\">";
} else {
- echo "<td colspan=\"6\"><center><input type=\"submit\" name=\"disablecarp\" id=\"disablecarp\" value=\"Disable Carp\"></td>";
+ echo "<input type=\"submit\" name=\"disablecarp\" id=\"disablecarp\" value=\"Disable Carp\">";
}
?>
-
-</tr>
+
+<p>
+
+<table width="100%" border="0" cellpadding="6" cellspacing="0">
</tr>
<tr>
<td class="listhdrr"><b><center>Carp Interface</center></b></td>