mirror of
https://github.com/ZeJMaN/LBCAlerte_ynh.git
synced 2025-07-17 09:00:50 +02:00
Initial commit
Functional, without SSO
This commit is contained in:
25
sources/app/default/scripts/login.php
Normal file
25
sources/app/default/scripts/login.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
$username = "";
|
||||
$errors = array();
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
if (!isset($_POST["username"]) || !trim($_POST["username"])) {
|
||||
$errors["password"] = "Nom d'utilisateur ou mot de passe incorrecte.";
|
||||
} else {
|
||||
$username = $_POST["username"];
|
||||
}
|
||||
if (empty($errors)) {
|
||||
$password = isset($_POST["password"])?$_POST["password"]:"";
|
||||
$auth->setUsername($username)
|
||||
->setPassword(sha1($password));
|
||||
if ($auth->authenticate()) {
|
||||
if ($module == "default" && $action == "login") {
|
||||
$redirect = "./";
|
||||
} else {
|
||||
$redirect = $_SERVER["REQUEST_URI"];
|
||||
}
|
||||
header("LOCATION: ".$redirect);
|
||||
exit;
|
||||
}
|
||||
$errors["password"] = "Nom d'utilisateur ou mot de passe incorrecte.";
|
||||
}
|
||||
}
|
5
sources/app/default/scripts/logout.php
Normal file
5
sources/app/default/scripts/logout.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
$auth->clear();
|
||||
header("LOCATION: ./");
|
||||
exit;
|
11
sources/app/default/views/index.phtml
Normal file
11
sources/app/default/views/index.phtml
Normal file
@ -0,0 +1,11 @@
|
||||
<p>
|
||||
Utilisez le menu ci-dessus pour accéder à la gestion de vos alertes mails
|
||||
et des flux RSS.
|
||||
</p>
|
||||
<p>
|
||||
Vous pouvez aussi :
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/Blount/LBCAlerte/issues">rapporter des bugs</a>.</li>
|
||||
<li><a href="https://alerte.ilatumi.org/forum">utiliser le forum</a> pour obtenir de l'aide.</li>
|
||||
</ul>
|
38
sources/app/default/views/layout.phtml
Normal file
38
sources/app/default/views/layout.phtml
Normal file
@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Alerte mail pour Leboncoin.fr</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="robots" content="none">
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" href="static/styles.css?v=<?php echo APPLICATION_VERSION; ?>" />
|
||||
</head>
|
||||
<body>
|
||||
<?php if ($userAuthed) : ?>
|
||||
<header>
|
||||
<h1><a href="./">Système d'alerte Leboncoin</a></h1>
|
||||
<ul class="topmenu">
|
||||
<li<?php echo $module === "default"?' class="active"':''; ?>><a href="./?"><img src="static/images/home.png" alt="" /></a></li>
|
||||
<li<?php echo $module === "mail"?' class="active"':''; ?>><a href="?mod=mail">Mail / SMS</a></li>
|
||||
<li<?php echo $module === "rss"?' class="active"':''; ?>><a href="?mod=rss">RSS</a></li>
|
||||
<li<?php echo $module === "user"?' class="active"':''; ?>><a href="?mod=user&a=settings">Paramètres</a></li>
|
||||
<li><a href="https://alerte.ilatumi.org/forum">Forum</a></li>
|
||||
<li style="float: right;"><a href="?a=logout">Déconnexion <span>(<?php echo htmlspecialchars($userAuthed->getUsername()); ?>)</span></a></li>
|
||||
</ul>
|
||||
</header>
|
||||
<?php endif; ?>
|
||||
<div class="content">
|
||||
<?php echo $content; ?>
|
||||
</div>
|
||||
<?php if ($userAuthed) : ?>
|
||||
<footer>
|
||||
<?php if ($userAuthed->getUsername() == "admin") : ?>
|
||||
<a href="?mod=admin&a=users" style="color: #EF0000;">Administration</a> |
|
||||
<?php endif; ?>
|
||||
Version <?php echo APPLICATION_VERSION; ?>
|
||||
| <a href="https://github.com/Blount/LBCAlerte/issues">Rapporter un bug</a>
|
||||
</footer>
|
||||
<?php endif; ?>
|
||||
<script type="text/javascript" src="static/scripts.js"></script>
|
||||
</body>
|
||||
</html>
|
26
sources/app/default/views/login.phtml
Normal file
26
sources/app/default/views/login.phtml
Normal file
@ -0,0 +1,26 @@
|
||||
<form action="" method="post">
|
||||
<h2>Identifiez-vous</h2>
|
||||
<dl>
|
||||
<dt>
|
||||
<label for="username">Nom d'utilisateur</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<input type="text" id="username" name="username" value="<?php
|
||||
echo htmlspecialchars($username);
|
||||
?>" />
|
||||
<?php if (isset($errors["username"])) : ?>
|
||||
<p class="error"><?php echo $errors["username"]; ?></p>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt>
|
||||
<label for="password">Mot de passe</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<input type="password" id="password" name="password" />
|
||||
<?php if (isset($errors["password"])) : ?>
|
||||
<p class="error"><?php echo $errors["password"]; ?></p>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
</dl>
|
||||
<p><input type="submit" value="Connexion" /></p>
|
||||
</form>
|
14
sources/app/default/views/upgrade.phtml
Normal file
14
sources/app/default/views/upgrade.phtml
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Mise à jour en cours.</title>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<?php if ($userAuthed && $userAuthed->isAdmin()) : ?>
|
||||
<p><a href="">Cliquez-ici afin d'achever la mise à jour.</a></p>
|
||||
<?php else: ?>
|
||||
<p>Mise à jour en cours, veuillez patienter quelques instants …</p>
|
||||
<?php endif; ?>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user