Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
appnotes:authmenus [2011/05/05 14:44] genec [vesamenu.c32 current] add line ends |
appnotes:authmenus [2011/05/06 20:09] genec [vesamenu.c32 current] space; clarity |
||
---|---|---|---|
Line 20: | Line 20: | ||
| | ||
header ( "Content-type: text/plain" ); | header ( "Content-type: text/plain" ); | ||
+ | echo "#!gpxe\n"; | ||
+ | | ||
+ | $proto = "https"; | ||
+ | // Comment out/remove the following if strictly using HTTPS | ||
+ | if (!isset($_SERVER["HTTPS"])) | ||
+ | $proto = "http"; | ||
+ | | ||
+ | // This assigns the host that gPXE should use using the most logical variables | ||
+ | if ( $_SERVER["HTTP_HOST"] != "" ) { | ||
+ | $host=$_SERVER["HTTP_HOST"]; | ||
+ | } else { | ||
+ | if ( $_SERVER["SERVER_NAME"] != 0) { | ||
+ | $host=$_SERVER["SERVER_NAME"]; | ||
+ | } else { | ||
+ | $host=$_SERVER["SERVER_ADDR"]; | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | // Comment out/remove the following if you are running on a standard port | ||
+ | if (!((! isset($_SERVER["HTTPS"]) ) && ($_SERVER["SERVER_PORT"] == 80)) | ||
+ | && !(isset($_SERVER["HTTPS"]) && ($_SERVER["SERVER_PORT"] == 443)) ){ | ||
+ | if (strrpos($host, ":") == FALSE) | ||
+ | $host=$host.":".$_SERVER["SERVER_PORT"]; | ||
+ | } | ||
| | ||
$uri=$_SERVER["REQUEST_URI"]; | $uri=$_SERVER["REQUEST_URI"]; | ||
Line 29: | Line 53: | ||
echo "set 209:string bootcfg.php\n"; | echo "set 209:string bootcfg.php\n"; | ||
echo "set 210:string ". | echo "set 210:string ". | ||
- | "https://\${username:uristring}:\${password:uristring}@". | + | $proto."://\${username:uristring}:\${password:uristring}@". |
- | $_SERVER["HTTP_HOST"].$dir."\n"; | + | $host.$dir."\n"; |
echo "chain \${210:string}pxelinux.0\n"; | echo "chain \${210:string}pxelinux.0\n"; | ||
?> | ?> |