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 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
| <?php require_once('Connections/truc_connect.php'); ?>
<?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;
}
}
mysql_select_db($database_truc_connect, $truc_connect);
$query_connect = "SELECT * FROM `user`";
$connect = mysql_query($query_connect, $truc_connect) or die(mysql_error());
$row_connect = mysql_fetch_assoc($connect);
$totalRows_connect = mysql_num_rows($connect);
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['login'])) {
$loginUsername=$_POST['login'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "ref_demande.php";
$MM_redirectLoginFailed = "index.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_truc_connect, $truc_connect);
$LoginRS__query=sprintf("SELECT login, password FROM `user` WHERE login=%s AND password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $truc_connect) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="Templates/modele_bdd.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Document sans titre</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
</style>
<link href="templates/style_pass.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
<style type="text/css">
body {
background-color: #999;
margin: 0px;
padding: 0px;
text-align: center;
}
#enveloppe {
background-color: #FFF;
width: 960px;
margin-right: auto;
margin-left: auto;
text-align: left;
}
#enveloppe #entete {
padding: 10px;
height: 100px;
width: 940px;
background-color: #FFF;
float: left;
}
#enveloppe #entete #logo {
background-color: #FFF;
height: 78px;
width: 211px;
}
#enveloppe #corps {
background-color: #FFF;
float: left;
width: 960px;
}
#enveloppe #corps #gauche {
float: left;
height: 400px;
width: 200px;
background-color: #FFF;
}
#enveloppe #corps #gauche #identification {
float: left;
width: 200px;
font-family: Tahoma, Geneva, sans-serif;
color: #4A4F55;
font-weight: bold;
}
#enveloppe #corps #gauche #identification p {
margin: 10px;
text-indent: 10px;
line-height: 30px;
padding: 30px;
}
#enveloppe #corps #gauche #navigation {
width: 200px;
height: 200px;
float: left;
}
#enveloppe #corps #gauche #navigation ul {
list-style-type: none;
padding: 0px;
margin: 5px;
line-height: 30px;
}
#enveloppe #corps #gauche #navigation ul li a {
font-size: 16px;
font-weight: bold;
color: #343E48;
background-color: #F9C000;
display: block;
text-decoration: none;
font-family: Georgia, "Times New Roman", Times, serif;
padding: 5px;
margin-top: 10px;
margin-right: 5px;
margin-bottom: 10px;
margin-left: 5px;
}
#enveloppe #corps #droite {
padding: 10px;
width: 730px;
background-color: #FFF;
margin-left: 10px;
float: left;
font-family: Georgia, "Times New Roman", Times, serif;
}
#enveloppe #corps #droite p {
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size: 14px;
}
#enveloppe #pied_de_page {
padding: 10px;
float: left;
height: 30px;
width: 940px;
background-color: #F9C000;
text-align: center;
font-size: 14px;
color: #333;
letter-spacing: 0.4em;
font-family: Georgia, "Times New Roman", Times, serif;
margin-bottom: 10px;
border: thin dotted #000;
}
#enveloppe #pied_de_page p {
margin-bottom: auto;
margin-top: 10px;
}
</style>
</head>
<body>
<div id="enveloppe">
<div id="entete">
<div id="logo">
<img src="images/logo2.jpg" width="211" height="78" />
</div>
</div>
<div id="corps">
<div id="gauche">
<div id="identification">
<p>Bienvenue sur le site du *** </p>
</div>
<div id="navigation">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
<div id="droite"><!-- InstanceBeginEditable name="contenu" -->
<p>Veuillez entrer votre login et mot de passe Agent:</p>
<p> </p>
<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
<table width="338" height="154" border="3" cellpadding="1" cellspacing="1">
<tr>
<td width="133">Login</td>
<td width="188"><input name="login" type="text" id="login" /></td>
</tr>
<tr>
<td>Mot de passe</td>
<td><input name="password" type="password" id="password" /></td>
</tr>
<tr>
<td id="send" colspan="2"><input type="submit" name="connect" id="connect" value="Se connecter" /></td>
</tr>
</table>
</form>
<p> </p>
<p><a href="type_acces.php">Changer de type d'accès</a></p>
<p> </p>
<!-- InstanceEndEditable --></div>
</div>
<div id="pied_de_page">
<p> Copyright © </p>
</div>
</div>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($connect);
?> |
Partager