function GetUsers() { $this->init(); $userList = $this->client->GetUsers(); $this->CheckForError($userList); foreach ($userList as $user) { $luser = new Lan_users(); $luser->id = $user->id; if (0 == $luser->count()) { $luser->username = $user->username; $luser->id = $user->id; $luser->password = $user->password; $luser->email = $user->email; $luser->role = $user->role; $luser->clan = $user->clan; $luser->insert(); echo "insert"; } else { $luser->username = $user->username; $luser->id = $user->id; $luser->password = $user->password; $luser->email = $user->email; $luser->role = $user->role; $luser->clan = $user->clan; $luser->update(); echo "update"; } } }
public function pullUserInfo($id) { $sql = "SELECT user_id, user_name, user_password, user_email from e107_user where user_id = " . $id; $res = $this->getQuerySingleResult($sql); if ($res) { $luser = new Lan_users(); $luser->user_id = $id; if (0 == $luser->count()) { $luser->username = $res[1]; $luser->user_id = $res[0]; $luser->password = $res[2]; $luser->email = $res[3]; $luser->clan = $this->getProfileField($id); $luser->insert(); } else { $luser->username = $res[1]; $luser->user_id = $res[0]; $luser->password = $res[2]; $luser->email = $res[3]; $luser->clan = $this->getProfileField($id); $luser->update(); } return true; } return false; }
$client->setEncryptMode(3); try { print_r($client->CheckLogin('kayomani', '2dbf2c8b82421856957e4469a7834d86')); return; $userList = $client->GetUsers(); foreach ($userList as $user) { $luser = new Lan_users(); $luser->id = $user->id; if (0 == $luser->count()) { $luser->username = $user->username; $luser->id = $user->id; $luser->password = $user->password; $luser->email = $user->email; $luser->role = $user->role; $luser->clan = $user->clan; $luser->insert(); echo "insert"; } else { $luser->username = $user->username; $luser->id = $user->id; $luser->password = $user->password; $luser->email = $user->email; $luser->role = $user->role; $luser->clan = $user->clan; $luser->update(); echo "update"; } } } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; }
function startSession($id, $username) { setCurrentUser($id); $_SESSION['username'] = $username; // Store User IP $user = new Lan_users(); if (0 != $user->get($id)) { $user->ip = $_SERVER['REMOTE_ADDR']; $_SESSION['steamprofile'] = $user->steamprofile; $_SESSION['profilepic'] = $user->smallavatar; $user->update(); } SetupGroups(); }