Permalink
Browse files

Some comments on what this is doing.

  • Loading branch information...
1 parent 38dbae3 commit 7b9a401ceb0ed55f551f5f429b6b88d2bf82cb8e @linickx committed May 31, 2011
Showing with 12 additions and 7 deletions.
  1. +12 −7 php/go.php
View
@@ -6,18 +6,18 @@
**/
- if (isset($_GET['k'])) {
+ if (isset($_GET['k'])) { // Mandatory Component 1 - The clients secret salt.
$ClientSalt = $_GET['k'];
settype($ClientSalt, "string");
$ClientSalt = substr($ClientSalt,0,128); // Anti-Buffer-Overflow protection... maybe?
}
- if (isset($_GET['dhcp'])) {
+ if (isset($_GET['dhcp'])) { // Optional Component - The clients IP Address
$dhcpPreference = $_GET['dhcp'];
- settype($dhcpPreference, "integer");
+ settype($dhcpPreference, "integer"); // numbers only, 1 = on ... anything else = off.
if ($dhcpPreference = 1) {
@@ -35,17 +35,22 @@
}
if (!$DHCP) {
- if (getenv(HTTP_X_FORWARDED_FOR)) {
- $IP = getenv(HTTP_X_FORWARDED_FOR);
+ if (getenv(HTTP_X_FORWARDED_FOR)) { // Proxy Server Detection/
+ $IP = getenv(HTTP_X_FORWARDED_FOR); // Proxy
} else {
- $IP = getenv(REMOTE_ADDR);
+ $IP = getenv(REMOTE_ADDR); // No Proxy.
}
}
+
+ // Mandatory Component 2 - The Clients User Agent String.
$UserAgent = getenv(HTTP_USER_AGENT);
$Numbers = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
- $UserAgent = str_replace($Numbers, '', $UserAgent);
+ $UserAgent = str_replace($Numbers, '', $UserAgent); // We strip version numbers to produce the same results after upgrades.
+
+
+ // Output.
header("Content-Type: text/plain");
echo "$ClientSalt \n";

0 comments on commit 7b9a401

Please sign in to comment.