diff options
author | Vinicius Coque <vinicius.coque@bluepex.com> | 2010-07-20 17:37:59 -0300 |
---|---|---|
committer | Vinicius Coque <vinicius.coque@bluepex.com> | 2010-07-20 17:37:59 -0300 |
commit | 6a641e9fd5af5d6eecb661903449725c8b64de29 (patch) | |
tree | 665d2317a66ceb9a56d10623383fe47311625dae /usr | |
parent | f8ec8de4f36c2403739acf90f32d7862e17fde6b (diff) | |
parent | 42621465d0618ecf60a63517d3ba3adca0740abb (diff) | |
download | pfsense-6a641e9fd5af5d6eecb661903449725c8b64de29.zip pfsense-6a641e9fd5af5d6eecb661903449725c8b64de29.tar.gz |
Merge remote branch 'mainline/master'
Conflicts:
usr/local/www/services_captiveportal_mac_edit.php
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/services_captiveportal_mac_edit.php | 10 | ||||
-rwxr-xr-x | usr/local/www/status_rrd_graph.php | 74 | ||||
-rw-r--r-- | usr/local/www/system_advanced_notifications.php | 4 | ||||
-rw-r--r-- | usr/local/www/system_groupmanager.php | 12 |
4 files changed, 79 insertions, 21 deletions
diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index 1ac2e86..c16b228 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -130,13 +130,23 @@ if ($_POST) { $ruleno = captiveportal_get_ipfw_passthru_ruleno($oldmac); if ($ruleno) { captiveportal_free_ipfw_ruleno($ruleno); +<<<<<<< HEAD $rules = sprintf("%s %s\n", gettext("delete"), $ruleno); $rules .= gettext("delete") . " " . ++$ruleno . "\n"; $rules .= captiveportal_passthrumac_configure_entry($mac); file_put_contents("{$g['tmp_path']}/tmpmacedit{$id}", $rules); mwexec("/sbin/ipfw -q {$g['tmp_path']}/tmpmacedit{$id}"); @unlink("{$g['tmp_path']}/tmpmacedit{$id}"); +======= + $rules = "delete {$ruleno}\n"; + $rules .= "delete " . ++$ruleno . "\n"; +>>>>>>> mainline/master } + + $rules .= captiveportal_passthrumac_configure_entry($mac); + file_put_contents("{$g['tmp_path']}/tmpmacedit{$id}", $rules); + mwexec("/sbin/ipfw -q {$g['tmp_path']}/tmpmacedit{$id}"); + @unlink("{$g['tmp_path']}/tmpmacedit{$id}"); header("Location: services_captiveportal_mac.php"); exit; diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 115d12c..c0d8814 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -28,7 +28,6 @@ POSSIBILITY OF SUCH DAMAGE. */ /* - pfSense_BUILDER_BINARIES: /usr/bin/find pfSense_MODULE: system */ @@ -50,8 +49,7 @@ if(! isset($config['rrd']['enable'])) { } $rrddbpath = "/var/db/rrd/"; -/* XXX: (billm) do we have an exec() type function that does this type of thing? */ -exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases); +$databases = glob("{$rrddbpath}*.rrd"); if ($_GET['cat']) { $curcat = $_GET['cat']; @@ -115,6 +113,30 @@ if ($_GET['option']) { } } +if($curcat == "custom") { + if (is_numeric($_GET['start'])) { + if($start < ($now - (3600 * 24 * 365 * 5))) { + $start = $now - (4 * 3600); + } + $start = $_GET['start']; + } else { + $start = $now - (4 * 3600); + } +} + +if (is_numeric($_GET['end'])) { + $end = $_GET['end']; +} else { + $end = $now; +} + +/* this should never happen */ +if($end < $start) { + $end = $now; +} + +$seconds = $end - $start; + if ($_GET['style']) { $curstyle = $_GET['style']; } else { @@ -244,6 +266,8 @@ function get_dates($curperiod, $graph) { if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular"); } + if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Custom", $tabactive, "status_rrd_graph.php?cat=custom"); if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Settings", $tabactive, "status_rrd_graph_settings.php"); display_top_tabs($tab_array); @@ -263,6 +287,19 @@ function get_dates($curperiod, $graph) { <select name="option" class="formselect" style="z-index: -10;" onchange="document.form1.submit()"> <?php + if($curcat == "custom") { + foreach ($databases as $db => $database) { + $optionc = split("-", $database); + $search = array("-", ".rrd", $optionc); + $replace = array(" :: ", "", $friendly); + echo "<option value=\"{$database}\""; + $prettyprint = ucwords(str_replace($search, $replace, $database)); + if($curoption == $database) { + echo " selected "; + } + echo ">" . htmlspecialchars($prettyprint) . "</option>\n"; + } + } foreach ($ui_databases as $db => $database) { if(! preg_match("/($curcat)/i", $database)) { continue; @@ -270,11 +307,12 @@ function get_dates($curperiod, $graph) { $optionc = split("-", $database); $search = array("-", ".rrd", $optionc); $replace = array(" :: ", "", $friendly); + switch($curcat) { case "system": - $optionc = str_replace($search, $replace, $optionc[1]); - echo "<option value=\"$optionc\""; - $prettyprint = ucwords(str_replace($search, $replace, $optionc)); + $optioncf = str_replace($search, $replace, $optionc[1]); + echo "<option value=\"$optioncf\""; + $prettyprint = ucwords(str_replace($search, $replace, $optioncf)); break; default: /* Deduce a interface if possible and use the description */ @@ -292,6 +330,7 @@ function get_dates($curperiod, $graph) { echo " selected "; } echo ">" . htmlspecialchars($prettyprint) . "</option>\n"; + } ?> @@ -308,13 +347,17 @@ function get_dates($curperiod, $graph) { ?> </select> - <?=gettext("Period:");?> - <select name="period" class="formselect" style="z-index: -10;" onchange="document.form1.submit()"> - <?php - foreach ($periods as $period => $value) { - echo "<option value=\"$period\""; - if ($period == $curperiod) echo " selected"; - echo ">" . htmlspecialchars($value) . "</option>\n"; + <? + if($curcat <> "custom") { + ?> + <?=gettext("Period:");?> + <select name="period" class="formselect" style="z-index: -10;" onchange="document.form1.submit()"> + <?php + foreach ($periods as $period => $value) { + echo "<option value=\"$period\""; + if ($period == $curperiod) echo " selected"; + echo ">" . htmlspecialchars($value) . "</option>\n"; + } } ?> @@ -322,7 +365,10 @@ function get_dates($curperiod, $graph) { <?php - // echo "year $curyear, month $curmonth, week $curweek, day $curday, weekday $curweekday<br>"; + if($curcat == "custom") { + + + } foreach($graphs as $graph) { /* check which databases are valid for our category */ foreach($ui_databases as $curdatabase) { diff --git a/usr/local/www/system_advanced_notifications.php b/usr/local/www/system_advanced_notifications.php index cdd8b2d..0ee67c7 100644 --- a/usr/local/www/system_advanced_notifications.php +++ b/usr/local/www/system_advanced_notifications.php @@ -111,13 +111,13 @@ if ($_POST) { if($config['notifications']['growl']['ipaddress'] && $config['notifications']['growl']['password'] = $_POST['password']) { register_via_growl(); - notify_via_growl(gettext("This is a test message form pfSense. It is safe to ignore this message.")); + notify_via_growl(gettext("This is a test message from pfSense. It is safe to ignore this message.")); } // Send test message via smtp if(file_exists("/var/db/notices_lastmsg.txt")) unlink("/var/db/notices_lastmsg.txt"); - $savemsg = notify_via_smtp(gettext("This is a test message form pfSense. It is safe to ignore this message.")); + $savemsg = notify_via_smtp(gettext("This is a test message from pfSense. It is safe to ignore this message.")); pfSenseHeader("system_advanced_notifications.php"); exit; diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php index a167790..8b5c3c3 100644 --- a/usr/local/www/system_groupmanager.php +++ b/usr/local/www/system_groupmanager.php @@ -152,10 +152,12 @@ if ($_POST) { local_group_set($group); /* Refresh users in this group since their privileges may have changed. */ - $a_user = &$config['system']['user']; - foreach ($a_user as & $user) { - if (in_array($user['uid'], $group['member'])) - local_user_set($user); + if (is_array($group['member'])) { + $a_user = &$config['system']['user']; + foreach ($a_user as & $user) { + if (in_array($user['uid'], $group['member'])) + local_user_set($user); + } } write_config(); @@ -411,7 +413,7 @@ function presubmit() { else $grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group.png"; ?> - <tr> + <tr ondblclick="document.location='system_groupmanager.php?act=edit&id=<?=$i;?>'"> <td class="listlr"> <table border="0" cellpadding="0" cellspacing="0"> <tr> |