function is_admin() { if (is_in() && user_data('email') == '*****@*****.**') { return true; } return false; }
function logged_in_redirect() { if (logged_in() === true) { $session_user_id = $_SESSION['user_id']; $user_data = user_data($session_user_id, 'user_id', 'username', 'password'); if (admin_access($user_data['username']) === false) { header('Location: index.php'); exit; } } }
function news_comment_form($News) { $form = '<form method="POST" action="' . get_link('Comments', 'Public') . '">'; $form .= call_bbcode_editor("Comment_Message"); //$form .= '<textarea name="Comment_Message" ID="message" rows="10" cols="50"></textarea><br/><br/>'; $form .= '<input type="hidden" name="Comment_News_ID" value="' . stripslashes_r($News['News_ID']) . '"/>'; $form .= '<input type="hidden" name="News_ID" value="' . stripslashes_r($News['News_ID']) . '"/>'; $form .= '<input type="hidden" name="Comment_Date" value="' . date('Y-m-d H:i:s') . '"/>'; $form .= '<input type="hidden" name="Comment_Account_Pseudo" value="' . user_data('Account_Pseudo') . '"/>'; $form .= '<input type="hidden" name="token" value="' . generer_token('Comment-' . $News['News_ID']) . '" />'; $form .= '<input type="submit" name="End_Add" value="Terminer">'; $form .= '</form>'; return $form; }
function recover($mode, $email) { $mode = sanitize($mode); $email = sanitize($email); $user_data = user_data(user_id_from_email($email), 'user_id', 'first_name', 'username'); if ($mode === 'username') { email($email, 'Your username', "Hello " . $userdata['firstname'] . "\n\nYour username is " . $userdata['firstname'] . "\n\n-our company"); } elseif ($mode === 'password') { $generated_password = substr(md5(rand(999, 999999)), 0, 8); //change_password($user_data['user_id'], $generated_password); //update_user($user_data['user_id'], array('password_recover' => '1')); email($email, 'Your password recovery', "Hello " . $userdata['firstname'] . "\n\nYour new password is: " . $generated_password . "\n\n-our company"); } }
function recover($mode, $email) { $mode = sanitize($mode); $email = sanitize($email); $user_data = user_data(user_id_from_email($email), 'first_name', 'username'); if ($mode == 'username') { email($email, 'Your username recvory', "Hello" . $user_data['first_name'] . ",\n\nYour username is:" . $user_data['username'] . "\n\n-stumbleupon"); } else { if ($mode == 'password') { $generated_password = substr(md5(rand(999, 999999)), 0, 8); change_password($user_data['user_id'], $generated_password); update_user($user_data['user_data'], array('password_recover' => '1')); email($email, 'Your password recvory', "Hello" . $user_data['first_name'] . ",\n\nYour New Password is:" . $generated_password . "\n\n-StumbleUpon"); } } }
function recover($mode, $email) { $mode = sanitize($mode); $email = sanitize($email); $user_data = user_data(user_id_from_email($email), 'user_id', 'first_name', 'username'); if ($mode == 'username') { email($email, 'Your username', "Hello " . $user_data['first_name'] . ", \n \n Your username is: " . $user_data['username'] . ",\n\n -dwcl"); } else { if ($mode == 'password') { //password $generated_password = substr(md5(rand(999, 999999)), 0, 8); change_password($user_data['user_id'], $generated_password); email($email, 'Your Password', "Hello " . $user_data['first_name'] . ", \n \n Your new is: " . $generated_password . ",\n\n -dwcl"); } } }
function recover($mode, $email) { $user_data = user_data(user_id_from_email($email), 'user_id', 'first_name', 'username'); if ($mode == 'username') { // recover username email($email, 'Your username', "Hello " . $user_data['first_name'] . ",\n\nYour username is: " . $user_data['username'] . "\n\n-sparklet"); } else { if ($mode == 'password') { // recover password $generated_password = substr(md5(rand(999, 999999)), 0, 8); // die($generated_password); change_password($user_data['user_id'], $generated_password); update_user($user_data['user_id'], array('password_recover' => '1')); email($email, 'Your password recovery', "Hello " . $user_data['first_name'] . ",\n\nYour new password is: " . $generated_password . "\n\n-sparklet"); } } }
function recover($mode, $email) { $mode = sanitize($mode); $email = sanitize($email); $user_data = user_data(user_id_from_email($email), 'user_id', 'first_name'); if ($mode == 'username') { email($email, 'Your username', " Hello " . $userdata['first_name'] . ",\n\nYour username is : " . $user_data['username'] . "\n\n-Utkal Placement"); } else { if ($mode == 'password') { $temp_password = substr(md5(rand(9999, 999999)), 0, 8); change_password($user_data['user_id'], $temp_password); update_user($user_data['user_id'], array('password_recover' => '1')); email($email, 'Your password Recovery', " Hello " . $userdata['first_name'] . ",\n\nYour new password is : " . $temp_password . "\n\nPlease log in to change this.\n\n-Utkal Placement"); } } //$temp_pass= md5($temp_pass); //mysql_query("UPDATE `users` SET `pass_temp` = '$temp_pass' WHERE `email` = '$email'"); }
function recover($mode, $email) { // recupereaza numele de utilizator sau parola - $mode poate lua valoarea de 'username' sau 'password' include 'core/db/db_connection.php'; $mode = sanitize($mode); $email = sanitize($email); $user_data = user_data(get_user_id_from_email($email), 'user_id', 'first_name', 'username'); if ($mode == 'username') { email($email, 'Your username', "\n\t\t\t\tHello " . $user_data['first_name'] . ", <br><br>\n\t\t\t\tYour username is " . $user_data['username'] . " <br><br>\n\t\t\t\t-worldtour team\n\t\t\t"); } else { if ($mode == 'password') { $generated_password = substr(md5(rand(777, 7777)), 0, 7); // generam o parola random de 7 caractere pe care o criptam cu md5 change_password($user_data['user_id'], $generated_password); update_user($user_data['user_id'], array('pwd_recovery' => '1')); // folosim un 'flag' asupra contului pentru a forta utilizatorul sa-si schimbe parola generata de noi prima oara cand se logheaza email($email, 'Password recovery', "\n\t\t\t\tHello " . $user_data['first_name'] . ", <br><br>\n\t\t\t\tYour new password is " . $generated_password . "<br><br>\n\t\t\t\tKindly note that this is a temporary password and you are required to change it on your first log in. <br><br>\n\t\t\t\t-worldtour team\n\t\t\t"); } } }
function recover($mode, $email) { $mode = sanitize($mode); $email = sanitize($email); $user_id = user_id_from_email($email); $user_data = user_data($user_id, 'user_id', 'first_name', 'username'); if ($mode === 'username') { //recover username sendMail("{$email}", "MCA-website username recovery mail", "Hello " . $user_data['first_name'] . ", \n\n Your username for mca page is " . $user_data['username'] . "\n\n~MCA, IIT Bombay"); } else { if ($mode === 'password') { //recover password $generated_password = substr(md5(rand(999, 999999)), 0, 8); change_password($user_data['user_id'], $generated_password); //changing password with new genrated password //this is to force user to change password after resetting password mysql_query("UPDATE `users` SET `password_recover` = 1 WHERE `user_id` = {$user_id}"); sendMail("{$email}", "MCA-website password reset mail", "Hello " . $user_data['first_name'] . ", \n\n Your password for mca page is reset and the new password is " . $generated_password . ". Please change your password after logging in.\n\n~MCA, IIT Bombay"); } } }
function ajout_forum_form($map_cat) { $list_rank = list_db('guild_list_rank', array('Guild_ID' => user_data('Account_Guild_ID'))); foreach ($list_rank as $l) { $values[$l['Rank_ID']] = $l['Rank_Name']; } set_values_db("Caranille_Forums", "Auth_View", $values); set_values_db("Caranille_Forums", "Auth_Post", $values); set_values_db("Caranille_Forums", "Auth_Topic", $values); set_values_db("Caranille_Forums", "Auth_Annonce", $values); set_values_db("Caranille_Forums", "Auth_Modo", $values); if (has_guild_acces('forum')) { $form = '<form method="POST" action="' . get_link("Main", "Guild") . '">'; $form .= '<h2>Ajout de Forum</h2>'; $form .= '<input type="hidden" name="Forum_Guild_ID" value="' . user_data('Account_Guild_ID') . '"/>'; $form .= '<table style="width:100%">'; $form .= '<tr>'; $form .= '<td style="width:50%">'; $form .= line_db("Caranille_Forums", "Forum_Name"); $form .= 'Catégorie : <select name="Forum_Cat_ID">'; foreach ($map_cat as $ID => $nom) { $form .= '<option value="' . $ID . '">' . $nom . '</option>'; } $form .= '</select>'; $form .= line_db("Caranille_Forums", "Auth_View"); $form .= line_db("Caranille_Forums", "Auth_Post"); $form .= line_db("Caranille_Forums", "Auth_Topic"); $form .= line_db("Caranille_Forums", "Auth_Annonce"); $form .= line_db("Caranille_Forums", "Auth_Modo"); $form .= '</td>'; $form .= '<td style="width:50%">' . call_bbcode_editor("Forum_Desc", "", "guild-forum") . '</td>'; $form .= '</tr>'; $form .= '<tr>'; $form .= '<td><input type="submit" name="End_Add_Forum" value="Terminer"/></td>'; $form .= '</tr>'; $form .= '</table>'; $form .= '</form>'; return $form; } }
?> <!--<textarea cols="70" rows="7" id="message" name="message"></textarea></fieldset>--> </fieldset> <p> <input type="submit" name="submit" value="Editer !" /> <input type="reset" name = "Effacer" value = "Effacer"/></p> </form> <?php } break; //Fin de ce cas :o ?> <?php case "delete": //Si on veut supprimer le post //Ensuite on vérifie que le membre a le droit d'être ici (soit le créateur soit un modo/admin) if (verif_Access($Auth_Modo, true) || $Post_Createur === user_data('Account_ID')) { echo '<h1>Suppression</h1>'; echo '<p>Êtes vous certains de vouloir supprimer ce post ?</p>'; echo '<p><a href="' . get_link('Post', 'Forum', array('action' => 'delete', 'p' => $post)) . '">Oui</a> ou <a href="' . get_link('Main', 'Forum') . '">Non</a></p>'; } break; ?> <?php default: //Si jamais c'est aucun de ceux là c'est qu'il y a eu un problème :o echo '<p>Cette action est impossible</p>'; } //Fin du switch
} } require_once 'database/connect.php'; require_once 'function/general.php'; require_once 'function/users.php'; require_once 'function/cache.php'; require_once 'function/mail.php'; require_once 'function/token.php'; require_once 'function/itemparser/itemlistparser.php'; if (isset($_SESSION['token'])) { $_SESSION['old_token'] = $_SESSION['token']; } Token::generate(); if (user_logged_in() === true) { $session_user_id = getSession('user_id'); $user_data = user_data($session_user_id, 'id', 'name', 'password', 'email', 'premdays'); $user_znote_data = user_znote_account_data($session_user_id, 'ip', 'created', 'points', 'cooldown'); } $errors = array(); // Log IP if ($config['log_ip']) { $visitor_config = $config['ip_security']; $flush = $config['flush_ip_logs']; if ($flush != false) { $timef = $time - $flush; if (getCache() < $timef) { $timef = $time - $visitor_config['time_period']; mysql_delete("DELETE FROM znote_visitors_details WHERE time <= '{$timef}'"); setCache($time); } }
// How many replies? $replies = intval(get_replies($row['reply'])); // Lets update it $replies = $replies + 1; // Woooo~ Last id for redirecting~ $page_numbers = $replies / 20 - 1; $n = ceil($page_numbers); if ($n == -1) { $n = 0; } else { $n = abs($n); } // Build topic url $post_url = "{$config['url_path']}/read.php?id={$row['reply']}&page={$n}"; // Topic starter data $post_author = user_data($row['starter_id']); ?> <tr> <td nowrap="nowrap" width="40%" class="item"> <a href="<?php echo $post_url; ?> "> <?php echo $content; ?> </a> </td> <td nowrap="nowrap" align="center" class="item"> <?php echo $post_author['styled_name'];
if ($_GET['reply'] != 0) { /** * Validate reply with alpha */ if (alpha($_GET['reply'], 'numeric')) { $reply = $_GET['reply']; // Get topic data $topic = topic($reply, 'subject'); if ($topic) { // Title $title = lang('replying_to') . ": {$topic['subject']}"; // Our Subject $_POST['subject'] = "Re: {$topic['subject']}"; if ($_GET['q'] && alpha($_GET['q'], 'numeric')) { $quote_data = topic($_GET['q'], 'message,starter_id'); $quote_user_data = user_data($quote_data['starter_id']); $quote_data['message'] = br2nl(stripslashes(parse($quote_data['message'], false))); $content = '[quote=' . $quote_user_data['username'] . ']' . $quote_data['message'] . '[/quote]'; } } else { $reply = 0; // New topic $title = lang('posting_new_topic'); } } else { $reply = 0; // New topic $title = lang('posting_new_topic'); } } else { $reply = 0;
echo lang('category'); ?> </td> </tr> <?php if (is_array($topics)) { foreach ($topics as $row) { // reset $status = ""; $list = ""; // Trim subject $subject = substru(trim(htmlspecialchars($row['subject'], ENT_QUOTES, 'UTF-8')), 0, $config['max_length']) . "…"; // Build topic url $topic_url = "{$config['url_path']}/read.php?id={$row['id']}"; // Topic starter data $topic_author = user_data($row['starter_id']); // Topic status if ($row['closed']) { $status = 'closed, '; } if ($row['sticky']) { $status .= 'sticky'; } $categories = category(); // Create the delete list foreach ($categories as $acat) { if ($acat['id'] == $row['category']) { continue; } if ($page) { $apage = "&page={$page}";
} //далаем разметку по oy for ($i=0; $i<=10; $i++) { imageline($im, $dx, $ysize - $dy - $i*$ystep, $xsize-$dx, $ysize - $dy - $i*$ystep, $silver); imageString($im, 1, 0, $ysize - $dy - $i*$ystep, $i*$max/10, $black); } //сами оси imageline($im, $dx, $dy, $dx, $ysize-$dy, $black); imageline($im, $dx, $ysize-$dy, $xsize-$dx, $ysize-$dy, $black); $i=1; foreach ($users as $user){ user_data($user, $i,$shopcoins_class); $i++; } ImagePNG($im); ImageDestroy($im); } die(); function user_data($user, $num,$shopcoins_class){ global $timenow, $max, $ysize, $dx, $dy, $im; $color[1] = ImageColorAllocate($im, 0, 0, 204); $color[2] = ImageColorAllocate($im, 255, 0, 0); $color[3] = ImageColorAllocate($im, 0, 204, 102); $color[4] = ImageColorAllocate($im, 204, 204, 0);
<?php session_start(); ob_start(); // Turn off when live error_reporting(0); require 'database/dbConnect.php'; require 'functions/general.php'; require 'functions/users.php'; require 'functions/post.php'; if (logged_in() === true) { $session_user_id = $_SESSION['user_id']; // This function call will literally allow you to ge any of the above from the db $user_data = user_data($session_user_id, 'user_id', 'username', 'password', 'first_name', 'last_name', 'email'); // This will output whatever you pass in :D } $errors = array();
<?php session_start(); //error_reporting(0); require 'database/connect.php'; require 'functions/general.php'; require 'functions/users.php'; if (logged_in()) { $session_serial = $_SESSION['serial']; $user_data = user_data($session_serial, 'serial', 'name', 'email', 'user_name', 'password', 'school', 'level'); if (!user_active($user_data['user_name'])) { session_destroy(); header("Location: index.php"); } } $errors = array();
echo perso_data('Strength_Total'); ?> <br /> <span class="important">Magie</span> : <?php echo $_SESSION['Magic_Total']; ?> <br /> <span class="important">Agilité</span> : <?php echo $_SESSION['Agility_Total']; ?> <br /> <span class="important">Défense</span> : <?php echo $_SESSION['Defense_Total']; ?> <br /> <br /> <span class="important">PO</span> : <div class="gain gold"><?php echo user_data('Account_Golds'); ?> </div><br /> <span class="important">Notoriété</span> : <div class="gain notoriety"><?php echo user_data('Account_Notoriety'); ?> </div><br /><br /> <?php } } }
$config['db'] = array('host' => 'localhost', 'username' => 'root', 'password' => '', 'dbname' => 'medium'); try { $db = new PDO('mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'], $config['db']['username'], $config['db']['password']); } catch (PDOException $e) { echo $e->getMessage(); } require 'functions/general.php'; require 'functions/users.php'; require 'functions/posthandler.php'; // echo $current_file = basename(__FILE__); $current_file = explode('/', $_SERVER['SCRIPT_NAME']); $current_file = end($current_file); // print_r($current_file); if (logged_in() === true) { $session_user_id = $_SESSION['user_id']; $user_data = user_data($session_user_id, 'user_id', 'username', 'password', 'first_name', 'last_name', 'email', 'password_recover', 'type', 'allow_email', 'profile'); // echo $user_data['username']; if (user_active($user_data['username']) === false) { session_destroy(); header('Location: index.php'); exit; } if ($current_file !== 'changepassword.php' && $user_data['password_recover'] == 1) { header('Location: changepassword.php?force'); exit; } } else { $session_user_id = 0; } // echo $user_data['type']; $errors = array();
<?php include 'connect.php'; include 'core.php'; if (logged_in()) { $session_user_id = $_SESSION['user_id']; //User data for the session of logged in user $user_data = user_data($session_user_id, 'id', 'username', 'firstname', 'lastname', 'type'); ?> <?php //Gather posted form data and insert into the correct columns in the module table if (isset($_POST['addmoduledata'])) { $instructor = $user_data['username']; $modulename = $_POST['modulename']; $modulecode = $_POST['modulecode']; $moduleinst = $_POST['instructor']; $modulename = mysql_real_escape_string($modulename); $modulecode = mysql_real_escape_string($modulecode); if (empty($modulename) || empty($modulecode)) { header('Location:addModule.php?ThoseFieldsAreRequired!'); } else { //Create module mysql_query("INSERT INTO `module` (`id`, `modulename`, `modulecode`, `instructor`) VALUES\n\t\t\t\t('', '{$modulename}', '{$modulecode}', '{$instructor}')") or die(mysql_error()); header('Location:module.php'); } }
function user_detail($fld) { return user_data($fld, site_user); }
<?php include 'core/init.php'; include 'includes/overall/headder.php'; if (isset($_GET['username']) === true && empty($_GET['username']) === false) { $username = $_GET['username']; if (user_exists($username) === true) { $user_id = user_id_from_username($username); $profile_data = user_data($user_id, 'first_name', 'last_name', 'email', 'profile'); ?> <div id=""> <h1 class="pag-head"><?php echo $profile_data['first_name']; ?> 's Profile</h1> <p><?php echo $profile_data['email']; ?> </p> </div> <div class="profpic"> <?php if (empty($profile_data['profile']) === false) { echo '<img src="', $profile_data['profile'], '" alt="', $user_data['first_name'], '\'s profile image">'; } ?> </div> <?php } else {
</tr> <?php foreach ($query as $data) { extract(stripslashes_r($data)); //On commence à afficher le pseudo du créateur du message : //On vérifie les droits du Account //(partie du code commentée plus tard) echo '<tr><td><strong> <a href="./voirprofil.php?m=' . $Account_ID . '&action=consulter"> ' . $Account_pseudo . '</a></strong></td>'; /* Si on est l'auteur du message, on affiche des liens pour Modérer celui-ci. Les modérateurs pourront aussi le faire, il faudra donc revenir sur ce code un peu plus tard ! */ $d = new datetime($Post_Time); if (user_data('Account_ID') == $Post_Createur) { echo '<td id=p_' . $Post_ID . '>Posté à ' . $d->format('H\\hi \\l\\e d M y') . ' <a href="' . get_link('Poster', 'Guild', array('action' => 'delete', 'p' => $Post_ID)) . '"><span alt="Supprimer" title="Supprimer ce message" >✗</span></a> <a href="' . get_link('Poster', 'Guild', array('action' => 'edit', 'p' => $Post_ID)) . '"><span alt="Editer" title="Editer ce message" >✓</span></a></td></tr>'; } else { echo '<td> Posté à ' . $d->format('H\\hi \\l\\e d M y') . ' </td></tr>'; } $d = new datetime($Account_Inscription); //Détails sur le Account qui a posté echo '<tr><td> <img src="./images/avatars/' . $Account_Avatar . '" alt="" /> <br />Membre inscrit le ' . $d->format('d/m/Y') . ' <br />Messages : ' . $Account_Post . '<br /> Localisation : ' . $Account_localisation . '</td>';
function recover($mode, $email) { $mode = sanitize($mode); $email = sanitize($email); $user_data = user_data(user_id_email($email), 'user_id', 'firstname', 'password', 'username'); if ($mode == 'username') { mail($email, 'your username', 'hello ' . $user_data['firstname'] . '\\n\\nyour username is ' . $user_data['username'] . '\\n\\n ~HELP PORTAL KIET', 'From: HELP PORTAL KIET'); } else { if ($mode = 'password') { //password is a sha1 hash so take care of it $generated_password = substr(sha1(rand(999, 999999)), 0, 8); change_password($user_data['user_id'], $generated_password); mail($email, 'your username', 'hello ' . $user_data['firstname'] . '\\n\\nyour password is ' . $user_data['password'] . '\\n\\nPlesae change password at first login\\n\\n ~HELP PORTAL KIET', 'From: HELP PORTAL KIET'); } } }
<?php if (user_data('Account_Roaster_Accept') !== 2) { ?> <?php echo LanguageValidation::iMsg("label.game.roaster"); ?> <input type="radio" name="Roaster" value="1" <?php echo user_data('Account_Roaster_Accept') == 1 ? "checked" : ""; ?> /> <?php echo LanguageValidation::iMsg("global.yes"); ?> <input type="radio" name="Roaster" value="0" <?php echo user_data('Account_Roaster_Accept') == 0 ? "checked" : ""; ?> /> <?php echo LanguageValidation::iMsg("global.no"); ?> <input type="submit" name="chara-design" value="<?php echo LanguageValidation::nMsg("btn.roaster.accept"); ?> "/><?php echo LanguageValidation::eMsg("btn.roaster.accept"); ?> <?php } else { echo "<div>en groupe</div>";
if (user_data('Account_HP_Remaining') <= 0) { $full_life = perso_data('HP_Total'); $end_battle = true; $return = get_link("Main", "Public"); // echec dans un donjon ou une mission, on l'emmene à l'hopital..... if ($_SESSION['Dungeon_Battle'] == 1 || $_SESSION['Mission_Battle'] == 1) { $Town_Price_INN = htmlspecialchars(addslashes($information_Town['Town_Price_INN'])); user_set('Account_Golds', user_data('Account_Golds') - $Town_Price_INN); $HP_recup = $full_life; } if ($_SESSION['Arena_Battle'] == 1) { $message = "Vous avez perdu le combat"; $message .= "Votre défaite dans l'arène vous fait perdre 1 points de notorieté<br />"; $HP_recup = $full_life * ($percent_life_restore_arena / 100); debug_log("HP_recup::{$HP_recup} = {$full_life}*({$percent_life_restore_chapter}/100)<br/>"); user_set('Account_Notoriety', user_data('Account_Notoriety') - 1); $Player_ID = monster_data('ID'); exec_db("UPDATE Caranille_Accounts SET Account_Notoriety= Account_Notoriety + 1 WHERE Account_ID= {$Player_ID}"); } if ($_SESSION['Dungeon_Battle'] == 1) { $Town_Price_INN = htmlspecialchars(addslashes($information_Town['Town_Price_INN'])); $message = 'Vous êtes morts...<br />Vous avez été emmené d\'urgence à l\'auberge et les soins vous ont été facturé ' . $Town_Price_INN . ' Pièce d\'or<br />'; $HP_recup = $full_life; } if ($_SESSION['Chapter_Battle'] == 1) { $HP_recup = $full_life * ($percent_life_restore_chapter / 100); debug_log("HP_recup::{$HP_recup} = {$full_life}*({$percent_life_restore_chapter}/100)"); $_final .= $Chapter_Level['Chapter_Defeate']; } if ($_SESSION['Mission_Battle'] == 1) { $Town_Price_INN = htmlspecialchars(addslashes($information_Town['Town_Price_INN']));
if (!Token::isValid($_POST['token'])) { $errors[] = 'Token is invalid.'; } $required_fields = array('current_password', 'new_password', 'new_password_again'); foreach ($_POST as $key => $value) { if (empty($value) && in_array($key, $required_fields) === true) { $errors[] = 'You need to fill in all fields.'; break 1; } } $pass_data = user_data($session_user_id, 'password'); //$pass_data['password']; // $_POST[''] // .3 compatibility if ($config['TFSVersion'] == 'TFS_03' && $config['salt'] === true) { $salt = user_data($session_user_id, 'salt'); } if (sha1($_POST['current_password']) === $pass_data['password'] || $config['TFSVersion'] == 'TFS_03' && $config['salt'] === true && sha1($salt['salt'] . $_POST['current_password']) === $pass_data['password']) { if (trim($_POST['new_password']) !== trim($_POST['new_password_again'])) { $errors[] = 'Your new passwords do not match.'; } else { if (strlen($_POST['new_password']) < 6) { $errors[] = 'Your new passwords must be at least 6 characters.'; } else { if (strlen($_POST['new_password']) > 32) { $errors[] = 'Your new passwords must be less than 33 characters.'; } } } } else { $errors[] = 'Your current password is incorrect.';
function bousole($carte = "Map") { ?> <form class="boussole" method="post"> <input type="submit" name="deplacement" value="-1|0" class="arrow topleft"/> <input type="submit" name="deplacement" value="0|1" class="arrow up"/> <input type="submit" name="deplacement" value="-1|0" class="arrow left"/> <div id="position"> <?php if ($carte == "Map") { echo user_data("Account_PosX") . "-" . user_data("Account_PosY"); } ?> <?php if ($carte == "Town") { $recup = get_db("SELECT Position_PosX,Position_PosY FROM Caranille_Position WHERE Position_Account_ID = '" . user_data('Account_ID') . "' and Position_Town_ID = '" . $_SESSION['Town_ID'] . "' limit 1"); echo $recup['Position_PosX'] . "-" . $recup['Position_PosX']; } ?> </div><input type="submit" name="deplacement" value="1|0" class="arrow right"/> <input type="submit" name="deplacement" value="0|-1" class="arrow down"/> <input type="hidden" name="token" value="<?php echo generer_token('deplacement-' . $carte); ?> " /> </form> <?php }