1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
| <?php require_once('../Connections/local.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_clients = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_clients = $_SESSION['MM_Username'];
}
mysql_select_db($database_local, $local);
$query_clients = sprintf("SELECT * FROM clients WHERE nom = %s", GetSQLValueString($colname_clients, "text"));
$clients = mysql_query($query_clients, $local) or die(mysql_error());
$row_clients = mysql_fetch_assoc($clients);
$totalRows_clients = mysql_num_rows($clients);
$colname_suivi = "-1";
if (isset($_GET['motdepasse'])) {
$colname_suivi = $_GET['motdepasse'];
}
mysql_select_db($database_local, $local);
$query_suivi = sprintf("SELECT * FROM clients WHERE motdepasse = %s", GetSQLValueString($colname_suivi, "text"));
$suivi = mysql_query($query_suivi, $local) or die(mysql_error());
$row_suivi = mysql_fetch_assoc($suivi);
$colname_suivi = "-1";
if (isset($_GET['motdepasse'])) {
$colname_suivi = $_GET['motdepasse'];
}
mysql_select_db($database_local, $local);
$query_suivi = sprintf("SELECT * FROM clients WHERE motdepasse = %s", GetSQLValueString($colname_suivi, "text"));
$suivi = mysql_query($query_suivi, $local) or die(mysql_error());
$row_suivi = mysql_fetch_assoc($suivi);
$query_suivi = "SELECT * FROM clients WHERE nom = 'nom'";
$suivi = mysql_query($query_suivi, $local) or die(mysql_error());
$row_suivi = mysql_fetch_assoc($suivi);
$totalRows_suivi = mysql_num_rows($suivi);
$colname_suivi = "-1";
if (isset($_SESSION['nom'])) {
$colname_suivi = $_SESSION['nom'];
}
mysql_select_db($database_local, $local);
$query_suivi = sprintf("SELECT * FROM clients WHERE nom = %s", GetSQLValueString($colname_suivi, "text"));
$suivi = mysql_query($query_suivi, $local) or die(mysql_error());
$row_suivi = mysql_fetch_assoc($suivi);
$colname_suivi = "-1";
if (isset($_GET['nom'])) {
$colname_suivi = $_GET['nom'];
}
mysql_select_db($database_local, $local);
$query_suivi = sprintf("SELECT * FROM clients WHERE nom = %s", GetSQLValueString($colname_suivi, "text"));
$suivi = mysql_query($query_suivi, $local) or die(mysql_error());
$row_suivi = mysql_fetch_assoc($suivi);
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Suivi</title>
<link href="../style/reset.css" rel="stylesheet" type="text/css">
<link href="../style/css page.css" rel="stylesheet" type="text/css">
<link href="style/style suivi.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="header">
<img src="../images/batideal.jpg" width="156" height="155" alt="batideal">
</div>
<div class="centre">
<p>Poussez la porte de la concrétisation de vos projets du bâtiment.</p>
<br>
<p></p>
<br><br><br><br>
<form action="" method="POST">
<table width="400px" border="0">
<tr>
<td>Nom :</td>
<td><?php echo $row_clients['nom']; ?></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Mot de passe :</td>
<td><?php echo $row_clients['motdepasse']; ?></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>
</div>
</body>
</html>
<?php
mysql_free_result($clients);
?> |
Partager