function dbQuery($queryStr) { if (!isConnected()) { connect(); } $result = mysql_query($queryStr) or die("Error: " . mysql_error() . "<br/>Query: " . $queryStr); return $result; }
public function testIsConnected() { $this->assertFalse($_SESSION['auth']); $this->assertFalse(isConnected()); $_SESSION['auth'] = true; $this->assertTrue($_SESSION['auth']); $this->assertTrue(isConnected()); }
function getUserEditorBar() { if (!isConnected()) { return false; } $strBar = isset($_SESSION['ACCOUNT_INFO']) && isset($_SESSION['ACCOUNT_INFO']['FCK_BAR']) ? $_SESSION['ACCOUNT_INFO']['FCK_BAR'] : false; if (!$strBar) { global $configFile; } if (!$strBar && !$configFile->getParam('FCK_BAR', $strBar)) { $strBar = false; } return $strBar; }
public function open() { if (!$this - isConnected()) { try { $this->handle = mysql_connect($this->host, $this->username, $this->password); mysql_select_db($this->database); if (!$this->handle) { throw new Exception('MySQL Connection Database error: ' . mysql_error()); } $this->isConnected = true; } catch (Exception $e) { echo $e->getMessage(); } } else { echo 'Error: Connection already opened'; } }
'" onmouseout="buy1.src='<?php echo $_url . "Design/xakar/images/homepage/buy.gif"; ?> '" title="buy"> <?php echo '[' . stripslashes($Account['Level_Number']) . ']' . stripslashes($Account['Account_Experience']) . '/' . stripslashes($Account['Level_Experience_Required']); ?> </a> </td> <td colspan="2" class="game_panel" valign="top" align="left"> <img src="<?php echo get_avatar($Account); ?> " width="110" height="84"/> <img class="buy1" alt="<?php echo isConnected($Account) ? 'On' : 'Off'; ?> " width="31" border="0" height="14" /> </td> </tr> <?php } } ?> </tbody> </table> </td> <td class="menu_panel" valign="top" width="30%" align="left"> <ul class="menu">
function userConnected() { session_start_once(); if (!isConnected()) { return null; } return $_SESSION["userConnected"]; }
echo '<div id="fraudCounterHolder"></div>'; /* Fraud triangle counts and score */ $level = "low"; if ($score >= 6 && $score <= 15) { $level = "medium"; } if ($score >= 15) { $level = "high"; } echo '<td class="countptd"><span class="fa fa-bookmark-o font-icon-color"> </span>' . $countPressure . '</td>'; echo '<td class="countotd"><span class="fa fa-bookmark-o font-icon-color"> </span>' . $countOpportunity . '</td>'; echo '<td class="countrtd"><span class="fa fa-bookmark-o font-icon-color"> </span>' . $countRationalization . '</td>'; echo '<td class="countctd">' . $level . '</td>'; echo '<td class="scoretd"><a href=alertData?agent=' . $agent_enc . '>' . round($score, 1) . '</a></td>'; /* Agent selection for command retrieval */ if (isConnected($row_a["heartbeat"], $row_a[2]) && $userPermissions != "view") { if (isset($_SESSION['agentchecked'])) { if ($_SESSION['agentchecked'] == $row_a["agent"]) { echo '<td class="specialtd"><a href="dashBoard?agent=' . $agent_enc . '"><img src="images/cmd-ok.svg" onmouseover="this.src=\'images/cmd-mo-ok.svg\'" onmouseout="this.src=\'images/cmd-ok.svg\'" alt="" title="" /></a></td>'; } else { echo '<td class="specialtd"><a href="dashBoard?agent=' . $agent_enc . '"><img src="images/cmd.svg" onmouseover="this.src=\'images/cmd-mo.svg\'" onmouseout="this.src=\'images/cmd.svg\'" alt="" title="" /></a></td>'; } } else { echo '<td class="specialtd"><a href="dashBoard?agent=' . $agent_enc . '"><img src="images/cmd.svg" onmouseover="this.src=\'images/cmd-mo.svg\'" onmouseout="this.src=\'images/cmd.svg\'" alt="" title="" /></a></td>'; } } else { if (isset($_SESSION['agentchecked'])) { if ($_SESSION['agentchecked'] == $row_a["agent"]) { echo '<td class="specialtd"><img src="images/cmd-ok.svg" onmouseover="this.src=\'images/cmd-mo-ok.svg\'" onmouseout="this.src=\'images/cmd-ok.svg\'" alt="Agent down" title="Agent down" /></td>'; } else { echo '<td class="specialtd"><img src="images/cmd.svg" onmouseover="this.src=\'images/cmd-mo.svg\'" onmouseout="this.src=\'images/cmd.svg\'" alt="Agent down" title="Agent down" /></td>';
<?php // *************************************************************************** /* * Auteur : Romain Maillard * Date : 25.09.2015 * Remarque: Basé sur le code d'un de mes laboratoires de BDR */ session_start(); // Inclusion fichier de fonction. require_once "include/fonction.php"; // Vérifie si l'utilisateur est déjà connecté sinon le redirige vers signin.php. if (!isConnected()) { header('Location: signout.php'); } // *************************************************************************** ?> <!DOCTYPE html> <html lang="fr"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="dist/favicon.ico"> <title>STI Mail - Home</title> <!-- Bootstrap core CSS --> <link href="dist/css/bootstrap.min.css" rel="stylesheet">
body{ background-color:' . htmlentities($_COOKIE['color']) . '; } #discussionMessage{ font-family:' . htmlentities($_COOKIE['police']) . '; } </style>'; } ?> <div id="myModal" class="modal"> <!-- Modal content --> <div class="modal-content"> <div class="modal-header"> <span class="close">×</span> <h2></h2> </div> <div class="modal-body"> </div> <div class="modal-footer"></div> </div> </div> <?php if (isConnected() and !strpos($_SERVER['PHP_SELF'], "discussion")) { echo ' <div> <button id="openContactBox">Afficher les contacts</button> </div>'; }
/* If login exist */ if ($row['mail'] == $login && $login != null) { $logOk = true; } else { $response = getJSONFromCodeError(300); } /* If password is correct with good login */ if ($logOk && $row['password'] == $password) { $passOk = true; } else { if ($logOk && $row['password'] != $password) { $response = getJSONFromCodeError(301); } } /* if all is ok */ if ($logOk && $passOk) { $id = $row['id']; $name = $row['name']; $nickname = $row['nickname']; $mail = $row['mail']; $admin = $row['admin']; $profil = $row['profil']; $isCo = isConnected(); if (!$isCo) { createSession($id, $nickname, $name, $mail, $admin, $profil); $response = getJSONFromCodeError(200); } else { $response = getJSONFromCodeError(303); } } echo json_encode($response);
/** * this function closes the db connection (if any) * * @version 1.0 * @author Andreas Morsing * @since 22.04.2005, 21:05:25 **/ function disconnect() { if (isConnected()) { $this->dbConnection->close(); } $this->Connected = false; $this->dbConnection = null; }
<?php include "Begin.php"; //En cours de connexion if (isset($_POST['email']) && isset($_POST['pwd'])) { setcookie("email", $_POST['email'], time() + 10000); setcookie("pwd", $_POST['pwd'], time() + 10000); header('Location: connexion.php'); exit; } else { if (isset($_COOKIE['email']) && isset($_COOKIE['pwd']) && isConnected()) { header('Location: profil.php'); exit; } else { if (isset($_GET['unreg'])) { echo "<p class = \"err\">Vous êtes désincrit du site. Nous espérons vous revoir bientôt !</p>"; } else { if (isset($_COOKIE['email']) && isset($_COOKIE['pwd'])) { echo "<p class = \"err\">Vos identifiants de connexion sont erronés, veuillez réessayer.</p>"; } } ?> <form action ="connexion.php" method="post"> <p>Adresse mail : <input type="email" name="email"/></p> <p>Mot de passe : <input type="password" name="pwd"/></p> <button type="submit" value="Connexion">Connexion</button><input type="button" value="Enregistrement" onClick="parent.location='inscription.php'"> </form> <?php }
<?php include "Begin.php"; $bdd = Connect_db(); if (isConnected() && isset($_GET["idEvent"])) { $SQL_Query = 'DELETE FROM Membre_Inscrit_Event WHERE Membre_email = "' . $_COOKIE['email'] . '" AND Event_Id = ' . intval($_GET["idEvent"]); $query = $bdd->prepare($SQL_Query); $query->execute(); header('location:EventDescr.php?idEvent=' . $_GET["idEvent"]); } else { echo '<script>alert(\'Nique ta mère\');</script>'; }
function getUserDetails($userID, $myID = 0) { //echo $userID.$myID; $query = "SELECT CONCAT(`first_name`,' ',`last_name`) as 'N'\n\t,church_member_id,`church_id`,`userdp` as 'DP',`email` as 'email',\n\t`phone_number` as 'phone',date_joined,about\n\n\n\tfrom\n\tchurch_members where church_member_id='{$userID}'"; $results = mysql_query($query) or die(mysql_error()); $mutualFriend = 0; if ($results && mysql_num_rows($results) >= 1) { $data = array(); while ($row = mysql_fetch_assoc($results)) { $dataItem['id'] = $row['church_member_id']; $dataItem['memberID'] = $dataItem['id']; $dataItem['cover'] = loadUserCoverPix($dataItem['id']); $dataItem['name'] = ucwords(trim($row['N'])); $dataItem['profilePic'] = $row['DP']; $dataItem['email'] = $row['email']; $dataItem['phone'] = $row['phone']; $dataItem['about-user'] = $row['about']; $dataItem['date_joined'] = ago($row['date_joined'], -1); $cid = $row['church_id']; $dataItem['churchName'] = getchurchName($cid); $dataItem['friends'] = loadFriendsCount($userID); $dataItem['CID'] = $cid; $data['connection'] = loadFriendsCount($userID); if ($userID != $myID) { $dataItem['isConnected'] = isConnected($dataItem['id'], $myID); if ($dataItem['isConnected'] == 1) { $mutualFriend = $mutualFriend + 1; } $dataItem['mutualFriends'] = countMutualFriends($dataItem['id'], $myID); } else { $dataItem['isConnected'] = -10; // This ID is mine so dont check Connection $dataItem['mutualFriends'] = 0; } $dataItem['churchprofilePic'] = getchurchlogo($cid); //$dataItem['Friends']= loadFriendsCount($userID);; $data = $dataItem; } // echo json_encode($data); return $data; } }
function isInstalled() { if (isConnected()) { App::uses('ConnectionManager', 'Model'); $dataSource = ConnectionManager::getDataSource('default'); $baseTables = ['categories' => $dataSource->config['prefix'] . 'categories', 'categories_posts' => $dataSource->config['prefix'] . 'categories_posts', 'comments' => $dataSource->config['prefix'] . 'comments', 'links' => $dataSource->config['prefix'] . 'links', 'menus' => $dataSource->config['prefix'] . 'menus', 'options' => $dataSource->config['prefix'] . 'options', 'post_meta' => $dataSource->config['prefix'] . 'post_meta', 'posts' => $dataSource->config['prefix'] . 'posts', 'posts_tags' => $dataSource->config['prefix'] . 'posts_tags', 'tags' => $dataSource->config['prefix'] . 'tags', 'user_meta' => $dataSource->config['prefix'] . 'user_meta', 'users' => $dataSource->config['prefix'] . 'users']; $installed = []; App::uses('ClassRegistry', 'Utility'); foreach ($baseTables as $table => $tablePrefix) { if (in_array($tablePrefix, $dataSource->listSources()) && count($dataSource->describe($table)) > 0 && count(ClassRegistry::init('Option')->getOptions()) > 0) { $installed[$table] = true; } else { $installed[$table] = false; } } } else { $installed['database.php'] = false; } return !in_array(false, $installed); }
<?php if (!isConnected() || !is_numeric($_GET['id']) || $_GET['id'] != getPersonneConnectee()->getPerNum()) { throw new ExceptionPerso("Bien tenté, mais vous n'avez pas les droits pour afficher cette page !", ExceptionPerso::ERR_DROITS); } ?> <h1> Changement de votre mot de passe </h1> <?php if (empty($_POST['oldPwd']) && empty($_POST['newPwd']) && empty($_POST["newPwdConfirmation"])) { include "include/pages/form/modifierPwd.form.inc.php"; } else { $pdo = new Mypdo(); $personneManager = new PersonneManager($pdo); if ($_POST["newPwd"] != $_POST["newPwdConfirmation"]) { throw new ExceptionPerso("Les mots de passe saisis ne correspondent pas.", ExceptionPerso::ERR_PERSONNE); } $retour = $personneManager->updatePwd(getPersonneConnectee()->getPerNum(), $_POST['oldPwd'], $_POST['newPwd']); if ($retour == true) { afficherMessageSucces("Votre mot de passe a été mis à jour !"); redirection(1, ACCUEIL); } else { afficherMessageSucces("Erreur lors de la mise à jour de votre mot de passe.."); redirection(10, ACCUEIL); } }
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 include 'message.php'; include 'connect.php'; include 'session.php'; error_reporting(0); $testConnect = isConnected(); if ($testConnect) { destroySession(); $response = getJSONFromCodeError(200); } else { $response = getJSONFromCodeError(302); } echo json_encode($response);
<script> changerTitre("Voter pour une citation"); </script> <h1>Voter pour une citation</h1> <?php $pdo = new Mypdo(); $citationManager = new CitationManager($pdo); $personneManager = new PersonneManager($pdo); $voteManager = new VoteManager($pdo); if (!isConnected() || !$personneManager->isEtudiant(getPersonneConnectee()->getPerNum())) { throw new ExceptionPerso("Vous n'avez pas les droits pour afficher cette page. Seul un etudiant peut ajouter une citation !", ExceptionPerso::ERR_DROITS); } if (empty($_GET['id'])) { throw new ExceptionPerso("Merci de ne pas modifier l'URL de la page", ExceptionPerso::ERR_URL); } else { $citation = $citationManager->getCitation($_GET['id']); if (empty($_POST['vot_valeur'])) { $detailsProf = $personneManager->getPersonne($citation->getCitationPerNum()); $moyenne = $voteManager->getMoyenneVote($citation->getCitationNum()); include "include/pages/form/voterCitation.form.inc.php"; } else { if ($voteManager->isPerNumDejaVote(getPersonneConnectee()->getPerNum(), $citation->getCitationNum())) { throw new ExceptionPerso("Vous avez déjà voté pour cette citation !", ExceptionPerso::ERR_VOTE); } $vote = new Vote(array('cit_num' => $citation->getCitationNum(), 'per_num' => getPersonneConnectee()->getPerNum(), 'vot_valeur' => $_POST['vot_valeur'] === "zero" ? 0 : $_POST["vot_valeur"])); $retour = $voteManager->add($vote); if ($retour != 0) { afficherMessageSucces("Votre vote a été pris en compte !"); redirection(1, LISTER_CITATIONS); } else { afficherMessageErreur("Votre vote n'a pas été pris en compte, il se peut que vous ayiez déjà voté !"); redirection(5, LISTER_CITATIONS); }
$data['profilePic'] = $row['DP']; $data['comment'] = $row['C']; $data['lessonID'] = $row['TID']; $date = ago($row['date'], -1); $data['timeStamp'] = $date; $data['comment_id'] = $row['comment_id']; $data['memberID'] = $row['SID']; $data['date_joined'] = ago($row['date_joined'], -1); $cid = $row['church_id']; $data['CID'] = $cid; $data['cover'] = "NOT_SET"; $data['friends'] = loadFriendsCount($data['memberID']); $data['churchName'] = getchurchName($cid); $data['churchprofilePic'] = getchurchlogo($cid); if ($memberID != $data['memberID']) { $data['isConnected'] = isConnected($memberID, $data['memberID']); $data['connection'] = loadFriendsCount($data['memberID']); } else { $data['isConnected'] = 5; //My records $data['connection'] = -1; } //name memberID comment_id timeStamp comment profilePic $content['DevotionComment'][] = $data; } echo json_encode($content); } else { echo 'No Comment Found.'; } // Full texts church_member_id } else {
header("Cache-Control: no-cache"); //sinon bug ie $site->loadDefaultFilters(); $site->display(SITE_PATH . 'core' . SLASH . 'templates' . SLASH . 'fckconfig.tpl'); die; case 'fckstyles.xml': header('content-type: text/xml'); $site->loadDefaultFilters(); $site->display(SITE_PATH . 'core' . SLASH . 'templates' . SLASH . 'fckstyles.tpl'); die; } /*for safety reasons, if user try to go out pages dir, go to first page*/ if (strstr('..', $page)) { $oPage = $site->getFirstPage(); } else { $oPage = $site->getPage($page, isConnected()); } } //if page has not been found, load the extra page event if (!$oPage) { $bRes = doEventAction('extrapage', array(&$page, &$site)); if ($bRes !== true) { $oPage =& $bRes; } } if (!$oPage) { header("HTTP/1.0 404 Not Found"); die(_('Page not found')); } //display the page $site->displayPage($oPage);
function query_search_engine($keyword) { if (!se_get_config('tablename', $strTable)) { return false; } if (!($cnx = connectBdd())) { return false; } $tabKeyword = split(' ', $keyword); $strK = ''; foreach ($tabKeyword as $k) { $strK .= $k . '.*'; } $strPublishedCondition = ''; if (!isConnected()) { $strPublishedCondition = ' AND published=1 '; } $sql = " SELECT *, MATCH(nom, url, texte) AGAINST('{$strK}') AS score \n\tFROM {$strTable} WHERE MATCH(nom, url, texte) AGAINST('{$keyword}') {$strPublishedCondition}\n\tORDER BY score DESC "; if (!($rest = mysql_query($sql, $cnx))) { return closeBdd(mysql_error($cnx)); } $result_search_engine = array(); while ($row = mysql_fetch_array($rest)) { $result_search_engine[] = $row; } closeBdd(); return $result_search_engine; }
<script> changerTitre("Modifier une personne"); </script> <?php if (!isConnected() || !getPersonneConnectee()->isPerAdmin()) { throw new ExceptionPerso("Vous ne pouvez pas accéder à cette page !", ExceptionPerso::ERR_DROITS); } ?> <h1>Modifier une personne enregistrée</h1> <?php if (empty($_GET['id'])) { throw new ExceptionPerso("Merci de ne pas modifier l'url !", ExceptionPerso::ERR_URL); } else { $modifFinie = false; $pdo = new Mypdo(); $personneManager = new PersonneManager($pdo); $salarieManager = new SalarieManager($pdo); $etudiantManager = new EtudiantManager($pdo); $per_num = $_GET['id']; $pwdChanged = false; if (!is_numeric($per_num)) { quitterModifierPersonne(); throw new ExceptionPerso("Vous ne pouvez pas modifier l'URL !", ExceptionPerso::ERR_PEBCAK); } $personne = $personneManager->getPersonne($per_num); if (empty($personne)) { //personne vide, le numero n'existe pas quitterModifierPersonne(); throw new ExceptionPerso("Le numero saisi ne correspond à aucune personne.", ExceptionPerso::ERR_PERSONNE); } if (empty($_POST["per_prenom"]) && empty($_POST['dep_num']) && empty($_POST['sal_telprof'])) { include "include/pages/form/modifPersonne.form.inc.php"; } else {
function show_timeline(touitos $touitos, $bd) { $tr = new TouiteRender($touitos->getId(), $bd); if (isConnected() and isOwnProfile($touitos->getPseudo())) { echo ' <div id="touite-box"> <form id="touite"> <textarea id="touiteArea" placeholder="Entrez votre message..." name="touite" maxlength="140" required></textarea> <input type="submit"> </form> </div>'; } echo '<div id="touiteList">'; $touiteAffiche = $tr->renderMessage(0); echo '</div>'; if ($touiteAffiche) { echo '<div id="loadMoreTouiteDiv"> <button id="loadMoreProfileTouite" next="1" idtouitos="' . $touitos->getId() . '">+ de touites</button> </div>'; } else { if (isOwnProfile($touitos->getPseudo())) { echo '<div class="fond nothing"><h1>Commencez à écrire un message !</h1></div>'; } else { echo '<div class="fond nothing"><h1>Cet utilisateur n\'a pas encore écrit de message !</h1></div>'; } } }
menu_arena(); echo '<table class="newsboard">'; echo '<tr>'; echo '<th>' . LanguageValidation::iMsg("label.top.level") . '</th>'; echo '<th>' . LanguageValidation::iMsg("label.top.xp") . '</th>'; echo '<th>' . LanguageValidation::iMsg("label.top.notoriety") . '</th>'; echo '<th>' . LanguageValidation::iMsg("label.top.order") . '</th>'; echo '<th>' . LanguageValidation::iMsg("label.top.pseudo") . '</th>'; echo '</tr>'; $Account_Query = list_db('top_list', array("top_members_limit" => $top_members_limit)); foreach ($Account_Query as $Account) { $xp_purcent = $Account['Account_Experience'] / $Account['Level_Experience_Required'] * 100; echo '<tr>'; echo '<td>' . stripslashes($Account['Level_Number']) . '</td>'; echo '<td>'; echo '<div title="' . stripslashes($Account['Account_Experience']) . '/' . stripslashes($Account['Level_Experience_Required']) . '" class="barre" id="xp" >'; echo '<div style="width:' . $xp_purcent . 'px;" > </div>'; echo '</div>'; echo '</td>'; echo '<td><div class="gain notoriety">' . stripslashes($Account['Account_Notoriety']) . '</div></td>'; echo '<td>' . stripslashes($Account['Order_Name']) . '</td>'; echo '<td>'; echo '<a href="' . get_link('Account', 'Forum', array('m' => $Account['Account_ID'], 'action' => 'consulter')) . '">'; echo stripslashes($Account['Account_Pseudo']); echo '</a>'; echo '</td>'; echo '<td>' . (isConnected($Account) ? LanguageValidation::iMsg("global.logged.in") : LanguageValidation::iMsg("global.logged.out")) . '</td>'; echo '</tr>'; } echo '</table>'; }
if (verif_connect()) { load_css('guild.css', 'guild'); //Si l'utilisateur ne possède pas de Guilde if (has_guild()) { menu_guild(); echo '<table class="newsboard">'; echo '<tr>'; echo '<th>Niveau</th>'; echo '<th>Expérience</th>'; echo '<th>Notorieté</th>'; echo '<th>Ordre</th>'; echo '<th>Pseudo</th>'; echo '</tr>'; $Account_Query = list_db('list_membre_guild', array('Guild_ID' => guild_data('Guild_ID'))); foreach ($Account_Query as $Account) { echo '<tr>'; echo '<td>' . stripslashes($Account['Level_Number']) . '</td>'; echo '<td>' . stripslashes($Account['Account_Experience']) . '</td>'; echo '<td>' . stripslashes($Account['Account_Notoriety']) . '</td>'; echo '<td>' . stripslashes($Account['Order_Name']) . '</td>'; echo '<td>'; echo '<a href="' . get_link('Account', 'Forum', array('m' => $Account['Account_ID'], 'action' => 'consulter')) . '">'; echo stripslashes($Account['Account_Pseudo']); echo '</a>'; echo '</td>'; echo '<td>' . (isConnected($Account) ? 'Connecté' : 'déconnecté') . '</td>'; echo '</tr>'; } echo '</table>'; } }
<?php session_start(); include_once '../lib/utilisateur.php'; if (isConnected()) { header('Location: ../vues/pagePerso.php'); } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title>Connexion forum</title> </head> <body> <div id="wrap"> <div id="main"> <?php include_once 'layouts/header.php'; $pseudo = ''; if (isset($_COOKIE['pseudo'])) { $pseudo = $_COOKIE['pseudo']; } ?> <div class="container"> <h3>Connection au forum dédié aux chats</h3>
*/ function isConnected($update_date, $now) { $date_1 = strtotime($update_date); $date_2 = strtotime($now); $dife = $date_2 - $date_1; $minutesstr = $dife / 60; $minutes = (int) $minutesstr; if ($minutes < 0) { $minutes = $minutes * -1; } return $minutes < 1; } include "inc/open-db-connection.php"; function filter($variable) { return addcslashes(mysql_real_escape_string($variable), ',<>'); } $_SESSION['id_uniq_command'] = null; $agent = filter($_GET['agent']); $agent_dec = base64_decode(base64_decode(filter($_GET['agent']))); $query = "SELECT agent,heartbeat,now() FROM t_agents WHERE agent = \"" . $agent_dec . "\""; $result_a = mysql_query($query); if ($row_a = mysql_fetch_array($result_a)) { if (isConnected($row_a["heartbeat"], $row_a[2])) { echo '<img src="images/on.png" border="0">'; } else { echo '<img src="images/off.png" border="0">'; } } include "inc/close-db-connection.php";
} ?> <table class="sortable" > <tr> <th> Nom de l'enseignant </th> <th> Libellé </th> <th> Date</th> <th> Moyenne des notes </th> <?php if (isConnected() && $personneManager->isEtudiant(getPersonneConnectee()->getPerNum())) { ?> <th>Noter</th> <?php } if (isConnected() && getPersonneConnectee()->isPerAdmin()) { ?> <th> Déposé par </th> <th> Validé par </th> <th> Modération </th> <th> Supprimer </th> <?php } ?> </tr> <?php foreach ($citations as $citation) { include "include/pages/tab/afficherUneCitation.tab.inc.php"; } ?> </table> <?php
<?php // init session if (!isset($_SESSION)) { session_start(); } // init functions include_once 'includes/autoload.php'; // init vars $app['param'] = getConfig("prod"); $app['users'] = loadJson($app['param']['db_path_users']); $app['pages'] = loadJson($app['param']['db_path_pages']); $app['tasks'] = loadJson($app['param']['db_path_tasks']); $app['trans'] = loadTranslation(getLang()); // get page $page = getActualRoute(); // secure all pages if ($page != 'login' && !isConnected()) { redirect('login'); } // load header include_once 'views/header.php'; // load content of page try { loadPhpFileByPageName($page); } catch (\Exception $e) { loadPhpFileByPageName("erreur"); } // load footer include_once 'views/footer.php';