And some cleanups in the HTML code.
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
if (!$is_logged_in) {
$root_url = $configs['root_url'];
- echo "<tr>\n";
- echo " <td><a href=\"$root_url/index.php?page=login\">S'identifier</a></td>\n";
- echo " <td><a href=\"$root_url/index.php?page=register\">Créer un compte</a></td>\n";
- echo "</tr>\n";
+ echo " <tr>\n";
+ echo " <td><a href=\"$root_url/index.php?page=login\">S'identifier</a></td>\n";
+ echo " <td><a href=\"$root_url/index.php?page=register\">Créer un compte</a></td>\n";
+ echo " </tr>\n";
}
?>
<tr>
<form action="index.php" id="login" method="post">
<input type="hidden" name="form" value="login" />
<label> Email : </label>
- <input type="email"size="25" name="email" required />
+ <input type="email"size="25" name="email" required/>
<label> Mot de passe : </label>
<input type="password" size="15" name="password" required/>
<input type="submit" value="Valider">
<label> Départ : Ville -> </label>
<input type="text" size="15" name="departure_city" required/>
<label> Date -> </label>
- <input type="datetime-local" name="departure_date" value="<?php echo date('Y-m-d\TH:i'); ?>" required>
+ <input type="datetime-local" name="departure_date" value="<?php echo date('Y-m-d\TH:i'); ?>" required/>
<label> Arrivée : Ville -> </label>
<input type="text" size="15" name="arrival_city" required/>
<label> Date -> </label>
- <input type="datetime-local" name="arrival_date" value="<?php echo date('Y-m-d\TH:i'); ?>" required>
+ <input type="datetime-local" name="arrival_date" value="<?php echo date('Y-m-d\TH:i'); ?>" required/>
<input type="submit" value="Valider">
</form>
function chk_logged_in()
{
- if (isset($_SESSION['email'])) {
+ if (isset($_SESSION['email']) && isset($_SESSION['IP_address'])) {
return true;
} else {
return false;