function register_request() { global $prefixe_salt, $suffixe_salt; extract(addslashes_r(stripslashes_r($_POST))); $Date = date('Y-m-d H:i:s'); $IP = getRealIpAddr(); $filter = uniqid(); $pswd = password_encode($prefixe_salt . $filter . $suffixe_salt, $Password); $key = uniqid(); insert_db('Caranille_Accounts', array('Account_Pseudo' => strip_tags($Pseudo), 'Account_Password' => strip_tags($pswd), 'Account_Salt' => $filter, 'Account_Email' => $Email, 'Account_Sexe' => $Sexe, 'Account_Inscription' => $Date, 'Account_Last_IP' => $IP, 'Account_HP_Remaining' => 100, 'Account_Key' => $key, 'Account_valid' => 0, 'Account_Level' => 1, 'Account_Order' => 1, 'Account_Reason' => 'None', 'Account_Status' => "Authorized", 'Account_Access' => "Member", 'Account_Guild_ID' => 0, 'Account_HP_Bonus' => 0, 'Account_MP_Remaining' => 10, 'Account_MP_Bonus' => 0, 'Account_Strength_Bonus' => 0, 'Account_Magic_Bonus' => 0, 'Account_Agility_Bonus' => 0, 'Account_Defense_Bonus' => 0, 'Account_Experience' => 0, 'Account_Golds' => 0, 'Account_Notoriety' => 0, 'Account_Chapter' => 1, 'Account_Mission' => 1, 'Account_Step' => 2)); $user_record = get_db('request_account', $_POST); return $user_record; }
} if (empty($mg)) { $exist = db($SignupFile, $email); if (isset($exist)) { $mg[] = $lang['alert_user_email_exist']; } } if (empty($mg)) { $exist = db($SignupFile, $username); if (isset($exist)) { $mg[] = $lang['alert_user_exist']; } } if (isset($password)) { $pass = $password; $password = password_encode($key, $password); } @($lname = !get_magic_quotes_gpc() ? $lname : stripslashes($lname)); @($username = !get_magic_quotes_gpc() ? $username : stripslashes($username)); if (empty($mg)) { @($fp = fopen("{$AdminFolder}/db/signup/id.dat", "r+")) or die($lang["error_open_file"]); $id = fgets($fp, 10); if ($id == "") { $id = 0; } $id++; fseek($fp, 0); fputs($fp, $id); fclose($fp); $id = str_pad((int) $id, "2", "0", STR_PAD_LEFT); $data = $id . '|' . $item_id . '|' . $dd . '|' . $lname . '|' . $username . '|' . $email . '|' . $password . '|0|' . $pfw_ip . '|';
function register_admin() { global $bdd, $prefixe_salt, $suffixe_salt; extract(addslashes_r($_POST)); echo "{$Password} === {$Password_Confirm}<br/>"; if ($Password === $Password_Confirm) { $Date = date('Y-m-d H:i:s'); $IP = getRealIpAddr(); $filter = uniqid(); $pswd = password_encode($prefixe_salt . $filter . $suffixe_salt, $Password); //echo "saisie : $Password<br/>clé : ($prefixe_salt - $filter - $suffixe_salt)=>crypté : $pswd<br/>"; $decode = password_decode($prefixe_salt . $filter . $suffixe_salt, $pswd); //echo " ctrl :: $decode <br/>"; insert_db('Caranille_Accounts', array('Account_Pseudo' => $Pseudo, 'Account_Password' => $pswd, 'Account_Salt' => $filter, 'Account_Email' => $Email, 'Account_Last_Connection' => $Date, 'Account_Last_IP' => $IP, 'Account_HP_Remaining' => 100, 'Account_Level' => 1, 'Account_Order' => 1, 'Account_Valid' => 1, 'Account_Reason' => 'None', 'Account_Status' => "Authorized", 'Account_Access' => "Admin", 'Account_ID' => 1, 'Account_Guild_ID' => 0, 'Account_HP_Bonus' => 0, 'Account_MP_Remaining' => 10, 'Account_MP_Bonus' => 0, 'Account_Strength_Bonus' => 0, 'Account_Magic_Bonus' => 0, 'Account_Agility_Bonus' => 0, 'Account_Defense_Bonus' => 0, 'Account_Experience' => 0, 'Account_Golds' => 0, 'Account_Notoriety' => 0, 'Account_Chapter' => 1, 'Account_Mission' => 1)); config_game($Email); return true; } return false; }
function dologin() { extract($_POST); $name = trim($name); $password = trim($password); if (strlen($password) < 6 || strlen($password) > 20) { json_return(400, '密码长度不符合要求'); } // if(!check_verify($checkCode, 2)){ //验证验证码 // json_return(400,'验证码错误'); // } if (preg_match('/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/', $name)) { //邮箱登录 $pass = $this->User->field('password,user_id,user_en_id,nickname')->where("email = '%s'", array($name))->find(); //正确的密码 if ($pass['password'] == password_encode($password)) { session('nickname', $pass['nickname']); session('user_en_id', $pass['user_en_id']); session('user_id', $pass['user_id']); json_return(200, '正确'); } else { json_return(400, '用户名或密码错误'); } } else { //用户名登录 $pass = $this->User->field('password,user_id,user_en_id,nickname')->where("user_name = '%s'", array($name))->find(); //正确的密码 if ($pass['password'] == password_encode($password)) { session('nickname', $pass['nickname']); session('user_en_id', $pass['user_en_id']); session('user_id', $pass['user_id']); json_return(200, '正确'); } else { json_return(400, '用户名或密码错误'); } } }
$baseline = "compte inconnu"; } } else { $baseline = "email invalide"; } } else { $baseline = "formulaire incomplet"; } } else { $baseline = "formulaire invalide"; } } if (request_confirm('Valid')) { $baseline = 'Restitution de votre mot de passe'; print_r($_RESQUEST); if (!empty($_GET)) { extract(addslashes_r($_GET)); } if (!empty($_POST)) { extract(addslashes_r($_POST)); } $user = get_db('valid_account', $_REQUEST); if (!empty($user)) { $Password = password_decode($prefixe_salt . $user['Account_Salt'] . $suffixe_salt, $user['Account_Password']); $filter = uniqid(); $pswd = password_encode($prefixe_salt . $filter . $suffixe_salt, $Password); update_db('Caranille_Accounts', array('Account_ID' => $user['Account_ID'], 'Account_Password' => $pswd, 'Account_Salt' => $filter)); $user_record = get_db('request_account', $user); valid_renew_email($user_record); } }
$loots = list_db('foreign_list', array('table' => 'Caranille_Inventory', 'ID' => 'Inventory_Account_ID', 'value' => $Account["Account_ID"])); if (!empty($loots)) { list_html($loots, "Caranille_Inventory", "Accounts", array('Inventory_Item_ID', 'Inventory_Item_Quantity', 'Inventory_Item_Equipped'), false, false); } $loots = list_db('foreign_list', array('table' => 'Caranille_Inventory_Invocations', 'ID' => 'Inventory_Invocation_Account_ID', 'value' => $Account["Account_ID"])); if (!empty($loots)) { list_html($loots, "Caranille_Inventory_Invocations", "Accounts", array('Inventory_Invocation_Invocation_ID'), false, false); } $loots = list_db('foreign_list', array('table' => 'Caranille_Inventory_Magics', 'ID' => 'Inventory_Magic_Account_ID', 'value' => $Account["Account_ID"])); if (!empty($loots)) { list_html($loots, "Caranille_Inventory_Magics", "Accounts", array('Inventory_Magic_Magic_ID'), false, false); } } } if (request_confirm('End_Edit')) { if (valid_post_db('Caranille_Accounts')) { // reencodage du mot de passe avec une nouvelle clé $_POST['Account_Salt'] = uniqid(); $_POST['Account_Password'] = password_encode($prefixe_salt . $_POST['Account_Salt'] . $suffixe_salt, $_POST['Account_Password']); update_db('Caranille_Accounts', addslashes_r($_POST)); echo 'Le compte a bien été modifié'; } else { echo 'Tous les champs n\'ont pas été remplis'; } } if (request_confirm('Delete')) { delete_db('Caranille_Accounts', $_POST); echo 'Le compte a bien été supprimé'; } //print_r($_POST); }
function connexion($Pseudo, $Password) { global $baseline, $prefixe_salt, $suffixe_salt, $MMORPG_Access; $login = get_db('request_account', $_POST); $pswd = password_encode($prefixe_salt . $login['Account_Salt'] . $suffixe_salt, $Password); $restore = password_decode($prefixe_salt . $login['Account_Salt'] . $suffixe_salt, $login['Account_Password']); if ($login['Account_Password'] === $pswd && $restore === $Password) { if ($login['Account_Valid'] == '1') { if (!isConnected($login)) { get_user($Pseudo); if (verif_auth()) { init_equipement_session(); get_perso($Pseudo); get_equipement($Pseudo); get_Guild($Pseudo); clear_battle(); $ID = user_data('Account_ID'); $Date = date('Y-m-d H:i:s'); $IP = getRealIpAddr(); $Last_Connection = user_data('Account_Last_Connection'); $Last_IP = user_data('Account_Last_IP'); update_db('Caranille_Accounts', array('Account_Last_Connection' => $Date, 'Account_Last_IP' => $IP, 'Account_ID' => $ID)); if ($Last_IP !== $IP) { $message = "ATTENTION!!!" . "\n"; $message .= "Votre dernière connexion ne provient pas de la même adresse IP." . "\n"; $message .= "Cela peut signifier qu'une autre personne se soit précédemment connectée avec votre compte." . "\n"; $message .= "Si par contre vous vous êtes connecté depuis un autre poste veuillez ignorer ce message."; $message .= "\n\n"; $message .= "Pour information voici un détail de votre dernière connexion:." . "\n"; $message .= "- Date de connexion: {$Last_Connection} " . "\n"; $message .= "- Adresse IP: {$Last_IP} " . "\n"; } if ($MMORPG_Access === "Yes") { $baseline = 'Connection Réussi<br /><br />'; $baseline .= '<a href="' . get_link('Main', 'Public') . '">Commencer à jouer</a>'; } elseif ($MMORPG_Access === "No" && verif_access("Admin", true)) { $baseline = 'Connection Réussi<br /><br />'; $baseline .= '<a href="' . get_link('Main', 'Admin') . '">Administration</a>'; } else { $baseline = 'Le jeu est actuellement fermé, merci de revenir plus tard'; session_destroy(); } return true; } return 2; } return 3; } return 4; } return 5; }
<?php $record = false; if (request_confirm('Valid')) { if (verifier_token(600, get_link('Email_Valid', 'User'), 'Valid')) { extract(addslashes_r($_POST)); if (request_confirm('Pseudo') && request_confirm('Password') && request_confirm('Email')) { if (filter_var($Email, FILTER_VALIDATE_EMAIL) !== false) { if ($Password == $Password_Confirm) { $account = get_db('request_account', $_POST); if (!empty($account)) { if ($account['Account_Valid'] === 0) { $pswd = password_encode($prefixe_salt . $account['Account_Salt'] . $suffixe_salt, $Password); $restore = password_decode($prefixe_salt . $account['Account_Salt'] . $suffixe_salt, $account['Account_Password']); if ($account['Account_Password'] === $pswd && $restore === $Password) { $key = uniqid(); update_db('Caranille_Accounts', array('Account_Key' => $key, 'Account_ID' => $account['Account_ID'])); $user_record = get_db($req_pseudo); if (!empty($user_record)) { register_email($user_record); } } else { $baseline = "mot de passe éronné"; } } else { $baseline = "ce compte est dejà validé"; } } else { $baseline = "compte inconnu"; } } else {
<?php // print_r($_POST); //On commence par s'assurer que le membre est connecté if (verif_connect()) { if (request_confirm('Finish')) { extract(addslashes_r($_POST)); if (verifier_token(60, get_link('Profil', 'User'), 'Character-Password')) { $return = ""; if ($New_Password == $New_Password_Confirmation) { // reencodage du mot de passe avec une nouvelle clé $r['Account_ID'] = user_data('Account_ID'); $r['Account_Salt'] = uniqid(); $r['Account_Password'] = password_encode($prefixe_salt . $r['Account_Salt'] . $suffixe_salt, $New_Password); if (update_db('Caranille_Accounts', addslashes_r($r))) { $_return .= 'Votre mot de passe à bien été modifié'; $_return .= '<form method="POST" action="' . get_link("Character", "Game") . '"><br />'; $_return .= '<input type="submit" name="Cancel" value="Retour">'; $_return .= '</form>'; } } else { $_return .= 'Les deux mots de passe ne sont pas identiques'; $_return .= '<form method="POST" action="' . get_link("Character", "Game") . '"><br />'; $_return .= '<input type="submit" name="Cancel" value="Retour">'; $_return .= '</form>'; } } else { $_return .= "erreur sur le token"; } } if (request_confirm('sent')) {