diff --git a/auth/index.php b/auth/index.php
index 95d6513..41d54bc 100644
--- a/auth/index.php
+++ b/auth/index.php
@@ -7,11 +7,11 @@
Changer la clé de passe
- Vous devez être authentifié·e pour utiliser Niver
-
- Créer un compte
-
- Se connecter
+ Vous devez être authentifié·e pour utiliser Niver
+
+ Créer un compte
+
+ Se connecter
diff --git a/auth/login.php b/auth/login.php
index efb3842..e79a0f2 100755
--- a/auth/login.php
+++ b/auth/login.php
@@ -1,15 +1,15 @@
Pas de compte ? En créer un
@@ -18,34 +18,34 @@ Pas de compte ? En créer un
if (isset($_POST['username']) AND isset($_POST['password'])) {
- antiCSRF();
+ antiCSRF();
- if (!checkPasswordFormat($_POST['password']))
- exit("Le format du mot de passe n'est pas valide !");
+ if (!checkPasswordFormat($_POST['password']))
+ exit("Le format du mot de passe n'est pas valide !");
- if (!checkUsernameFormat($_POST['username']))
- exit("Le format du nom du compte n'est pas valide !");
+ if (!checkUsernameFormat($_POST['username']))
+ exit("Le format du nom du compte n'est pas valide !");
- if (checkPassword($_POST['username'], $_POST['password'])) {
+ if (checkPassword($_POST['username'], $_POST['password'])) {
- $_SESSION['username'] = htmlspecialchars($_POST['username']);
- $_SESSION['sftp_enabled'] = sftpStatus($_SESSION['username']);
+ $_SESSION['username'] = htmlspecialchars($_POST['username']);
+ $_SESSION['sftp_enabled'] = sftpStatus($_SESSION['username']);
- if (outdatedPasswordHash($_SESSION['username']))
- changePassword($_SESSION['username'], $_POST['password']);
+ if (outdatedPasswordHash($_SESSION['username']))
+ changePassword($_SESSION['username'], $_POST['password']);
- if (isset($_GET['redir'])) {
- if (preg_match("/^[0-9a-z\/-]+$/", $_GET['redir']))
- header('Location: ' . PREFIX . "/" . $_GET['redir']);
- else
- exit("ERROR : Wrong character in redir argument");
- } else {
- header('Location: ' . PREFIX);
- }
- exit;
- } else {
- echo "
Connexion impossible : mot de passe invalide";
- }
+ if (isset($_GET['redir'])) {
+ if (preg_match("/^[0-9a-z\/-]+$/", $_GET['redir']))
+ header('Location: ' . PREFIX . "/" . $_GET['redir']);
+ else
+ exit("ERROR : Wrong character in redir argument");
+ } else {
+ header('Location: ' . PREFIX);
+ }
+ exit;
+ } else {
+ echo "
Connexion impossible : mot de passe invalide";
+ }
}
diff --git a/auth/password.php b/auth/password.php
index 76ea714..660404d 100644
--- a/auth/password.php
+++ b/auth/password.php
@@ -1,45 +1,45 @@
- Vous pouvez ici changer le mot de passe permettant d'accéder à votre compte Niver.
+ Vous pouvez ici changer le mot de passe permettant d'accéder à votre compte Niver.
prepare("UPDATE users SET password = :password WHERE username = :username");
+ $stmt = $db->prepare("UPDATE users SET password = :password WHERE username = :username");
- $stmt->bindParam(':username', $username);
- $stmt->bindParam(':password', $newPassword);
+ $stmt->bindParam(':username', $username);
+ $stmt->bindParam(':password', $newPassword);
- $stmt->execute();
+ $stmt->execute();
- } else {
- echo "
Le mot de passe actuel n'est pas bon !";
- }
+ } else {
+ echo "
Le mot de passe actuel n'est pas bon !";
+ }
}
diff --git a/auth/register.php b/auth/register.php
index 68a840d..d178d19 100755
--- a/auth/register.php
+++ b/auth/register.php
@@ -4,68 +4,68 @@
if (isset($_POST['username']) AND isset($_POST['password'])) {
- antiCSRF();
+ antiCSRF();
- if (!checkPasswordFormat($_POST['password']))
- exit("Le format du mot de passe n'est pas valide !");
+ if (!checkPasswordFormat($_POST['password']))
+ exit("Le format du mot de passe n'est pas valide !");
- if (!checkUsernameFormat($_POST['username']))
- exit("Le format du nom du compte n'est pas valide !");
+ if (!checkUsernameFormat($_POST['username']))
+ exit("Le format du nom du compte n'est pas valide !");
- $username = $_POST['username'];
- $userExist = userExist($username);
- if (!$userExist) {
+ $username = $_POST['username'];
+ $userExist = userExist($username);
+ if (!$userExist) {
- $password = hashPassword($_POST['password']);
+ $password = hashPassword($_POST['password']);
- $db = new PDO('sqlite:' . DB_PATH);
+ $db = new PDO('sqlite:' . DB_PATH);
- $stmt = $db->prepare("INSERT INTO users(username, password, sftp_enabled, registration_date) VALUES(:username, :password, 0, :registration_date)");
+ $stmt = $db->prepare("INSERT INTO users(username, password, sftp_enabled, registration_date) VALUES(:username, :password, 0, :registration_date)");
- $time = date("Y-m-d H:i:s");
+ $time = date("Y-m-d H:i:s");
- $stmt->bindParam(':username', $username);
- $stmt->bindParam(':password', $password);
- $stmt->bindParam(':registration_date', $time);
+ $stmt->bindParam(':username', $username);
+ $stmt->bindParam(':password', $password);
+ $stmt->bindParam(':registration_date', $time);
- $stmt->execute();
+ $stmt->execute();
- $_SESSION['username'] = $username;
- $_SESSION['sftp_enabled'] = false;
- header('Location: ' . PREFIX . '/');
- exit;
- }
+ $_SESSION['username'] = $username;
+ $_SESSION['sftp_enabled'] = false;
+ header('Location: ' . PREFIX . '/');
+ exit;
+ }
}
?>
Déjà un compte ? Se connecter
diff --git a/bottom.inc.php b/bottom.inc.php
index 6cfbba8..b404a5c 100644
--- a/bottom.inc.php
+++ b/bottom.inc.php
@@ -1,17 +1,17 @@
-
-
-