* Authorize user. */ case 'userAuthorize': if (loginAdmin($sId, $sPassword) == TRUE_VAL) { $aUserInfo = getUserInfo($sId, true); $aUser = array('id' => $aUserInfo['id'], 'nick' => $aUserInfo['nick'], 'sex' => $aUserInfo['sex'], 'age' => $aUserInfo['age'], 'desc' => $aUserInfo['desc'], 'photo' => $aUserInfo['photo'], 'profile' => $aUserInfo['profile'], 'type' => CHAT_TYPE_ADMIN); } elseif (loginUser($sId, $sPassword) == TRUE_VAL && ($bBanned = doBan("check", $sId)) != TRUE) { $aUser = getUserInfo($sId); $aUser['id'] = $sId; $aUser['sex'] = $aUser['sex'] == 'female' ? "F" : "M"; $aUser['type'] = isUserAdmin($sId) ? CHAT_TYPE_ADMIN : CHAT_TYPE_FULL; } else { $sContents = parseXml($aXmlTemplates['result'], $bBanned ? "msgBanned" : "msgUserAuthenticationFailure", FAILED_VAL); break; } $aUser = initUser($aUser); $sContents = parseXml($aXmlTemplates['result'], "", SUCCESS_VAL); $sContents .= parseXml($aXmlTemplates['user'], $aUser['id'], USER_STATUS_NEW, $aUser['nick'], $aUser['sex'], $aUser['age'], $aUser['desc'], $aUser['photo'], $aUser['profile'], $aUser['type'], USER_STATUS_ONLINE); break; case 'banUser': $sBanned = isset($_REQUEST["banned"]) ? process_db_input($_REQUEST['banned']) : FALSE_VAL; $sUserId = getValue("SELECT `ID` FROM `" . MODULE_DB_PREFIX . "Profiles` WHERE `ID` = '" . $sId . "' LIMIT 1"); getResult(empty($sUserId) ? "INSERT INTO `" . MODULE_DB_PREFIX . "Profiles`(`ID`, `Banned`) VALUES('" . $sId . "', '" . $sBanned . "')" : "UPDATE `" . MODULE_DB_PREFIX . "Profiles` SET `Banned`='" . $sBanned . "' WHERE `ID`='" . $sId . "'"); break; case 'kickUser': getResult("UPDATE `" . MODULE_DB_PREFIX . "CurrentUsers` SET `Status`='" . USER_STATUS_KICK . "', `When`='" . time() . "' WHERE `ID`='" . $sId . "'"); break; case 'changeUserType': $sUserId = getValue("SELECT `ID` FROM `" . MODULE_DB_PREFIX . "Profiles` WHERE `ID` = '" . $sId . "' LIMIT 1"); getResult(empty($sUserId) ? "INSERT INTO `" . MODULE_DB_PREFIX . "Profiles`(`ID`, `Type`) VALUES('" . $sId . "', '" . $sType . "')" : "UPDATE `" . MODULE_DB_PREFIX . "Profiles` SET `Type`='" . $sType . "' WHERE `ID`='" . $sId . "'"); break;
function checkAuth($pass) { global $collect_user; global $collect_pass; global $mailbox; // Yate::Debug("checking passwd if '$collect_pass' == '$pass'"); if ($collect_pass == $pass) { $mailbox = $collect_user; initUser(); } else { setState("goodbye"); } $collect_pass = ""; }
<?php include 'include/lang.php'; include 'include/config.php'; include 'include/usr.class.php'; include 'include/db.php'; if (!($usr = initUser()) || !array_key_exists('id', $_GET) || !$usr->hasTown($_GET['id'])) { header("Location: index.php"); } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>myGreenTown</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <link rel = "shortcut icon" type = "image/x-icon" href = "favicon.ico" /> <link rel = "stylesheet" type = "text/css" href = "style/main.css"/> <link rel = "stylesheet" type = "text/css" href = "style/game.css"/> <link rel = "stylesheet" type = "text/css" href = "style/tech.css"/> <link rel = "stylesheet" type = "text/css" href = "http://fonts.googleapis.com/css?family=Ubuntu" /> <script type = "text/javascript" src = "sha256.js"></script> <script type = "text/javascript" src = "script/jQuery.js" > </script> <script type = "text/javascript" src = "script/mousewheel.js" > </script> <script type = "text/javascript" src = "script/json2.js" > </script> <script type = "text/javascript" src = "script/lib.js" > </script> <script type = "text/javascript" src = "script/game.js" > </script> <script type = "text/javascript">
<?php include 'include/lang.php'; include 'include/config.php'; include 'include/db.php'; include 'include/usr.class.php'; include 'include/textile.class.php'; if (!($usr = initUser())) { echo __("<h4>You cannot access this page!"); exit(0); } ?> <script type = "text/javascript"> $(".mail .msg").hide (); $("#mail_compose").hide (); $(".mail .title").click (function () { $(".msg", $(this).parent ()).toggle (); }); $("#mail_toggle").click (function () { $("#mail_body").toggle (); $("#mail_compose").toggle (); $(this).attr ("value", $("#mail_compose").is (":visible") ? "<? echo __("View Mail");?>" : "<? echo __("New mail");?>"); }); $("#clear").click (function () { $("#title").attr ("value", "");
/** * Calculate hash for VoxImplant loginWithOneTimeKey */ function calculateHash($key, $username) { $hash = md5($key . "|" . md5($username . ":voximplant.com:" . PASS)); return $hash; } if (isset($_REQUEST['key']) && isset($_REQUEST['username'])) { $result = calculateHash($_REQUEST['key'], $_REQUEST['username']); echo $result; exit; } else { if (isset($_REQUEST['action'])) { $action = $_REQUEST['action']; if (isset($_REQUEST['displayName'])) { $displayName = urlencode($_REQUEST['displayName']); } else { $displayName = "Participant"; } switch ($action) { case "JOIN_CONFERENCE": // Create user via API and return his name to SDK for login initUser($displayName); break; } } else { echo "NO_DATA"; exit; } }
<?php include_once "engine/header.php"; if (checkLoginUser($USER_TYPE_RECEPTION)) { initUser(); } else { die("Please login first. <br>Error 103"); } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <script src="jquery-1.10.2.min.js"></script> <style type="text/css"> .myButton { width: 200px; margin-left: 150px; } </style> <script> function createNewOrder(){ $('#div_neworder').css("visibility", "visible"); } function closeNewOrder(){ $('#div_neworder').css("visibility", "hidden"); } function showAssignOrder(OrderID){ $.getJSON("engine/orderdetail.php", {OrderID:OrderID}, ret_orderdetail) }
if ($action == "") { showlist(); } elseif ($action == "toaddpage") { toaddpage(); } elseif ($action == "addone") { addone(); } elseif ($action == "deleteselected") { deleteselected(); } elseif ($action == "groupusermanage") { groupusermanage(); } elseif ($action == "deletefromgroup") { deletefromgroup(); } elseif ($action == "addtogroup") { addtogroup(); } elseif ($action == "initUser") { echo initUser(); } function showlist() { global $db; global $smarty; $page_size = getPageSize(); // 每页显示的条目数 $sub_pages = getSubPages(); // 每次显示的页数 $current_page = empty($_GET["p"]) ? "1" : $_GET["p"]; // 当前被选中的页 /*$res = $db->query("SELECT a.id, a.groupname FROM wx_group_info a"); $rowList=$db->fetch_all($res);*/ // 组分页查询 $groupsql = "SELECT a.id, a.groupname FROM wx_group_info a";
$get_voting = $DB->selectRow("SELECT * FROM `mw_voting` WHERE `user_ip` LIKE '" . $_SERVER["REMOTE_ADDR"] . "' AND `site`='" . $site . "' LIMIT 1"); if (time() - $get_voting['time'] < $tab_sites['reset_time']) { output_message('validation', 'You have already voted for this site in the last 24 hours! Redirecting... <meta http-equiv=refresh content="4;url=?p=vote">'); echo "<br /><br />"; } else { if ($tab_sites != FALSE) { if ($Config->get('module_vote_onlinecheck') == 1) { $fp = @fsockopen($tab_sites['hostname'], 80, $errno, $errstr, 3); } else { $fp = True; } if ($fp) { if ($Config->get('module_vote_onlinecheck') == 1) { fclose($fp); } $DB->query("UPDATE `mw_voting` SET \r\n\t\t\t\t\t`time`='" . time() . "' \r\n\t\t\t\t WHERE `user_ip` LIKE '" . $_SERVER["REMOTE_ADDR"] . "' AND `site`='" . $site . "' LIMIT 1"); $DB->query("UPDATE `mw_account_extend` SET \r\n\t\t\t\t\t`web_points`=(`web_points` + " . $tab_sites['points'] . "), \r\n\t\t\t\t\t`date_points`=(`date_points` + " . $tab_sites['points'] . "),\r\n\t\t\t\t\t`total_votes`=(`total_votes` + 1), \r\n\t\t\t\t\t`points_earned`=(`points_earned` + " . $tab_sites['points'] . ") \r\n\t\t\t\t WHERE `account_id` = " . $user['id'] . " LIMIT 1"); output_message('info', 'Redirecting to vote site...'); echo "<script type=\"text/javascript\">setTimeout(window.open('" . $tab_sites['votelink'] . "', '_self'),0);</script>"; } else { output_message('error', 'Unable to connect to votesite. Please try again later.'); } } else { output_message('error', 'There is no vote site with this unique ID.'); } } } // We need to initiate the user everytime! $Voting = initUser();
echo $start; ?> " min="2004-01-01"/> </label></p> <p><label> End (inclusive): <input name="end" type="date" value="<?php echo $end; ?> " min="2004-01-01""/> </label></p> <p><input type="submit" /></p> </form> <?php } else { $user = initUser($username); if (!$user->exists()) { die('Username not recognised.'); } $ucArray = array('_code' => 'uc', 'ucuser' => $username, 'action' => 'query', 'list' => 'usercontribs', 'ucnamespace' => 0, 'ucprop' => 'title|sizediff', 'ucdir' => 'newer', 'ucstart' => str_replace('-', '', $start) . '000000', 'ucend' => str_replace('-', '', $end) . '235959'); $contribs = $site->listHandler($ucArray); $byPage = array(); foreach ($contribs as $contrib) { if (!isset($byPage[$contrib['title']])) { $byPage[$contrib['title']] = array(); } array_push($byPage[$contrib['title']], $contrib['sizediff']); } ksort($byPage); $netTotals = array(); $absTotals = array();
<?php if (isset($_SESSION['loggedIn'])) { if ($_SESSION['loggedIn'] == TRUE) { $projects = getUserProjects($_SESSION['id']); include 'display.html.php'; exit; } } if (isset($_POST['action']) && $_POST['action'] == 'login') { if (initUser($_POST['email'])) { if ($_SESSION['password'] == '') { $warning = 'Please Set Your Password!!!'; $_SESSION['loggedIn'] = TRUE; unset($_SESSION['password']); $projects = getUserProjects($_SESSION['id']); include 'display.html.php'; exit; } else { include $_SERVER['DOCUMENT_ROOT'] . '/includes/dbTest.inc.php'; $password = md5($_POST['password'] . 'ionic'); try { $sql = 'SELECT COUNT(*) FROM user WHERE email = :email AND password = :password'; $s = $pdo->prepare($sql); $s->bindValue(':email', $_SESSION['email']); $s->bindValue(':password', $password); $s->execute(); } catch (PDOException $e) { $error = 'Error checking existing password'; include 'error.html.php'; exit;
function reinit() { global $alldata, $objects, $player, $map, $maxobjid; global $cropvalue, $nextharvest, $nextharvestitem, $crops; global $gold, $xp, $level; global $seq, $rpcseq; $seq = 0; $rpcseq = 0; $alldata = initUser(); $worldobjects = $alldata['data']['userInfo']['world']['objects']; $player = $alldata['data']['userInfo']['player']; # $map = array(); $maxobjid = 0; $cropvalue = 0; $nextharvest = -1; foreach ($worldobjects as $i => &$obj) { $objects[$obj['id']] = $obj; unset($obj['_explicitType']); unset($obj['usesAltGraphic']); unset($obj['hasGiftRemaining']); $x = $obj['position']['x']; $y = $obj['position']['y']; # if(!isset($map[$x])) { $map[$x] = array(); } # $map[$x][$y] = $obj; $obj['tempId'] = NAN; $obj['position']['z'] = 0; $obj['direction'] = 0; $obj['deleted'] = false; if ($obj['position']['x'] == 28 && $obj['position']['y'] == 28) { $centerplot = $i; } if ($obj['id'] > $maxobjid) { $maxobjid = $obj['id']; } if ($obj['className'] == 'Plot') { if ($obj['itemName']) { $crop = $crops[$obj['itemName']]; $cropvalue += $crop['yield']; $harvesttime = floor($obj['plantTime'] / 1000) + 23 * 3600 * $crop['growtime']; if ($nextharvest == -1 || $harvesttime < $nextharvest) { $nextharvest = $harvesttime; $nextharvestitem = $obj['itemName']; } } } } $gold = $player['gold']; $xp = $player['xp']; $level = $player['level']; }