summaryrefslogtreecommitdiffstats
path: root/usr/local/www/pkg_edit.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-01-12 17:17:35 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-01-12 17:17:35 +0000
commitd21337019d129a70daec96570f8357017a41a78e (patch)
tree49c27d11d7ff4f3d97113494b31b6af59dd38b87 /usr/local/www/pkg_edit.php
parentd51f86e05d95089c7a7e0ebac305e6b750314cfa (diff)
downloadpfsense-d21337019d129a70daec96570f8357017a41a78e.zip
pfsense-d21337019d129a70daec96570f8357017a41a78e.tar.gz
Add variable substitutions: $wanip, $lanip to wizard and pkg_edit facilities.
Diffstat (limited to 'usr/local/www/pkg_edit.php')
-rwxr-xr-xusr/local/www/pkg_edit.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php
index eb88a9d..fe95a3a 100755
--- a/usr/local/www/pkg_edit.php
+++ b/usr/local/www/pkg_edit.php
@@ -444,6 +444,7 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper) {
}
function fixup_string($string) {
+ global $config;
// fixup #1: $myurl -> http[s]://ip_address:port/
$https = "";
$port = "";
@@ -453,7 +454,17 @@ function fixup_string($string) {
if($config['system']['webguiproto'] == "https") $https = "s";
$myurl = "http" . $https . "://" . getenv("HTTP_HOST") . $urlportport;
$newstring = str_replace("\$myurl", $myurl, $string);
- // fixup #2: fix'er'up here.
+ $string = $newstring;
+ // fixup #2: $wanip
+ $curwanip = get_current_wan_address();
+ $newstring = str_replace("\$wanip", $curwanip, $string);
+ $string = $newstring;
+ // fixup #3: $lanip
+ $lancfg = $config['interfaces']['lan'];
+ $lanip = $lancfg['ipaddr'];
+ $newstring = str_replace("\$lanip", $lanip, $string);
+ $string = $newstring;
+ // fixup #4: fix'r'up here.
return $newstring;
}
OpenPOWER on IntegriCloud