function makeLoginPage($user = false) { // We need global Variables. global $VERSION; global $SITENAME; global $IGB; global $IS_DEMO; global $IS_BETA; global $DB; global $IGB_VISUAL; if ($IGB && $IGB_VISUAL) { $login = new table(3, true); } else { $login = new table(3, true, "width=\"400\"", "align=\"center\""); } $peeps = $DB->getCol("SELECT COUNT(id) FROM users"); if ($peeps[0] == 0) { header("Location: index.php?auth=requestaccount&admin=true"); } $login->addHeader(">> Welcome to {$VERSION}."); $login->addRow("#060622"); $login->addCol($SITENAME, array("colspan" => 3, "align" => "center", "bold" => true)); if ($user) { if ($user == "__invalidchar") { $login->addRow("redish"); $login->addCol("Only characters a-z, A-Z and 0-9 are allowed. " . array("bold" => "true", "colspan" => 3)); } else { if (isset($_SESSION['testauth'])) { $login->addRow(); $login->addCol("Please select the character you wish to login as.", array("colspan" => 3)); } else { $login->addRow("redish"); $login->addCol("Your supplied credentials are invalid, please check and try again. " . "If you cannot remember your password use the Password Recovery link below.", array("bold" => "true", "colspan" => 3)); } } } // Show login info for demo. if ($IS_DEMO) { $login->addRow("#006600"); $login->addCol("This installation of MiningBuddy runs in demo mode. Login with username demo, password demo. If you get kicked out, someone else logged in with the same account.", array("colspan" => 3, "align" => "center", "bold" => true)); } global $BLESSED; if ($BLESSED == true) { $login->addRow("#330000"); $login->addCol("Using a superior hosted slot.", array("colspan" => 3, "align" => "center", "bold" => true)); } // Beta Warning if ($IS_BETA) { $login->addRow("#904000"); $login->addCol("-beta version-", array("colspan" => 3, "align" => "center", "bold" => true)); } // User has logged in, but we need a character name. if (!isset($_SESSION[testauth])) { $login->addRow(); $login->addCol("Username:"******"<input type=\"text\" name=\"username\" value=\"{$EVE_Charname}\" maxlength=\"30\">"); } else { $login->addCol("<input type=\"text\" name=\"username\" value=\"" . stripcslashes($user) . "\" maxlength=\"30\">"); } $login->addCol("<img src=\"./images/keys.png\">", array("rowspan" => "2")); $login->addRow(); $login->addCol("Password:"******"<input type=\"password\" name=\"password\" maxlength=\"80\">", array("colspan" => "2")); $login->addRow("#060622"); $login->addCol("Please login with your credentials. If you are in need of an account, request an account below and ask your CEO to activate it for you.", array("colspan" => "3", "align" => "center")); } else { $login->addRow(); $login->addCol("Character:"); global $TEST_AUTH; $eveApiProxyUrl = "https://auth.pleaseignore.com/api/1.0/eveapi/?apikey={$TEST_AUTH}&userid=" . $_SESSION[testauth][id]; $return = file_get_contents($eveApiProxyUrl); $obj = json_decode($return, TRUE); $count = 0; $select = "<select name=\"username\" >"; $array = array(); foreach ($obj[keys] as $key) { $eveApiProxyUrl = "https://auth.pleaseignore.com/api/1.0/eveapi/account/Characters.xml.aspx?apikey={$TEST_AUTH}&userid=" . $key[api_user_id]; $return = file_get_contents($eveApiProxyUrl); try { $chars = new SimpleXMLElement($return); } catch (Exception $ex) { continue; } foreach ($chars->result[0]->rowset[0] as $row) { $character = (string) $row[name]; if ($row['corporationName'] != "B0rthole" || in_array($character, $array)) { continue; } if ($character == $user) { $selected = "selected"; } $select .= "<option {$selected} value='{$character}'>{$character}</option>"; $array[] = $character; $count++; } } //var_dump($array); $select .= "</select>"; $login->addCol($select, array("colspan" => "2")); if ($count == 0) { session_destroy(); makenotice("You do not belong here. Leave at once!", "warning", "ACCESS DENIED"); die; } //file_put_contents($_SESSION[testauth][id].".xml",print_r($list,true)); } if ($IGB && $IGB_VISUAL) { $login->addHeaderCentered("<input type=\"submit\" name=\"login\" value=\"login\">"); } else { $login->addHeaderCentered("<input type=\"image\" name=\"login\" value=\"login\" src=\"./images/login.png\">"); } $login->addRow("#060622"); $login->addCol("<a href=\"index.php?auth=lostpass\">lost password</a>"); /* $login->addCol("<a href=\"index.php?auth=requestaccount\">request account</a>", array ( "align" => "right", "colspan" => "2" )); */ $login->addCol("", array("colspan" => "2")); $page = "<br><br><br>"; if (strstr($_SERVER[QUERY_STRING], "switch")) { $page .= "<form action=\"index.php?\" method=\"post\">"; } else { $page .= "<form action=\"index.php?{$_SERVER['QUERY_STRING']}\" method=\"post\">"; } // Add special hidden forms for stupid browsers. $browserinfo = new BrowserInfo(); if (ereg("MSIE", $_SERVER[HTTP_USER_AGENT]) or $browserinfo->getBrowser() == BrowserInfo::BROWSER_FIREFOX && $browserinfo->getVersion() >= 4) { $page .= "<input type=\"hidden\" name=\"login\" value=\"login\">"; } $page .= $login->flush(); //$page .= "<input type='hidden' name='redirect' value='$_SERVER[QUERY_STRING]'"; $page .= "</form><br><br><br>"; $html = new html(); $html->addBody($page); die($html->flush()); }
function event_load_html($list, $options) { ?> <h3> Document <?php echo $list[0]->getWebId(); ?> </h3> <p> Total events: <?php echo count($list); ?> </p> <?php echo printArray($options); ?> <p>Results:</p> <ol> <? $event = count($list); for($i = 0; $i < count($list); $i++) { $item = $list[$i]; $event--; $host = $item->getRemoteHost(); $browser = new BrowserInfo($item->getUserAgent()); ?> <li> <?php echo "[" . date("Y-d-m H:i:s", $item->getRequestedAt()); if($item->getEvent() == "page_view") { echo " (" . $item->getDuration() . " s)"; } echo "] "; echo '"' . $item->getEvent() . '"'; echo " on page ". $item->getPage(); echo " (value: " . $item->getValue() . ")"; echo ' - <a href="' . $item->getReferer() . '">URL</a> - '; echo ' Remote host: <a href="location.php?ip=' . $host . '">' . $host . "</a> - "; echo $browser->getName() . " " . $browser->getVersion(); ?> </li> <?php } echo "</ol>"; }