summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-02-18 22:16:48 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-02-18 22:16:48 +0000
commite17ce934fd58b9cdfa63209d81fd66673bd9fb87 (patch)
tree2e64e880f54694adaa6f2f81ca6f8b1ae3a3791b
parentaf0506f4930d41765889c156a7141cffc5de5844 (diff)
downloadpfsense-e17ce934fd58b9cdfa63209d81fd66673bd9fb87.zip
pfsense-e17ce934fd58b9cdfa63209d81fd66673bd9fb87.tar.gz
Allow $myurl in the url of the tabs .. $myurl is translated to getenv("HTTP_HOST") on the fly
-rwxr-xr-xusr/local/www/pkg.php13
-rwxr-xr-xusr/local/www/pkg_edit.php14
2 files changed, 21 insertions, 6 deletions
diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php
index 806b473..d46e995 100755
--- a/usr/local/www/pkg.php
+++ b/usr/local/www/pkg.php
@@ -116,10 +116,17 @@ if ($pkg['tabs'] <> "") {
foreach($pkg['tabs']['tab'] as $tab) {
$active = "tabinact";
if(isset($tab['active'])) $active = "tabact";
- $url = "";
+ $urltmp = "";
$title = $tab['text'];
- if($tab['url'] <> "") $url = $tab['url'];
- if($tab['xml'] <> "") $url = "pkg_edit.php?xml=" . $tab['xml'];
+ if($tab['url'] <> "") $urltmp = $tab['url'];
+ if($tab['xml'] <> "") $urltmp = "pkg_edit.php?xml=" . $tab['xml'];
+
+ $toeval = "\$myurl = \"" . getenv("HTTP_HOST") . "\"; \n";
+ eval($toeval);
+ // eval url so that above $myurl item can be processed if need be.
+ $toeval = "\$url = \"" . $urltmp . "\"; \n";
+ eval($toeval);
+
if($active == "tabinact") {
echo "<li class=\"{$active}\">";
echo "<a href=\"";
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php
index d5a184f..b97ee7c 100755
--- a/usr/local/www/pkg_edit.php
+++ b/usr/local/www/pkg_edit.php
@@ -235,10 +235,18 @@ if ($pkg['tabs'] <> "") {
foreach($pkg['tabs']['tab'] as $tab) {
$active = "tabinact";
if(isset($tab['active'])) $active = "tabact";
- $url = "";
+
+ $urltmp = "";
$title = $tab['text'];
- if($tab['url'] <> "") $url = $tab['url'];
- if($tab['xml'] <> "") $url = "pkg_edit.php?xml=" . $tab['xml'];
+ if($tab['url'] <> "") $urltmp = $tab['url'];
+ if($tab['xml'] <> "") $urltmp = "pkg_edit.php?xml=" . $tab['xml'];
+
+ $toeval = "\$myurl = \"" . getenv("HTTP_HOST") . "\"; \n";
+ eval($toeval);
+ // eval url so that above $myurl item can be processed if need be.
+ $toeval = "\$url = \"" . $urltmp . "\"; \n";
+ eval($toeval);
+
if($active == "tabinact") {
echo "<li class=\"{$active}\">";
echo "<a href=\"";
OpenPOWER on IntegriCloud