diff --git a/TODO b/TODO index c91d51c..f304309 100755 --- a/TODO +++ b/TODO @@ -2,3 +2,11 @@ * Vérification des variables dans les classes + throw exception * tokens + ban system * TRUNCATE before CREATE TABLE in install.php + +install.php : +============= +* Link beside password field to toggle visible / not visible + +index.php : +=========== +* Edit password doesn't work diff --git a/index.php b/index.php index f4cccf9..e296ab3 100644 --- a/index.php +++ b/index.php @@ -10,6 +10,7 @@ $tpl->assign('instance_title', INSTANCE_TITLE); $tpl->assign('connection', false); $tpl->assign('notice', ''); + $tpl->assign('error', ''); session_start(); $current_user = (isset($_SESSION['current_user']) ? unserialize($_SESSION['current_user']) : false); @@ -52,7 +53,22 @@ break; case 'password': + if(!empty($_POST['password']) && !empty($_POST['password_confirm'])) { + if($_POST['password'] == $_POST['password_confirm']) { + $user = new User(); + $user->setLogin($current_user['login']); + $user->setPassword($user->encrypt($_POST['password'])); + $user->setAdmin($current_user['admin']); + $user->setId($current_user['id']); + $user->save(); + header('location: index.php'); + exit(); + } + else { + $tpl->assign('error', 'The content of the two password fields doesn\'t match.'); + } + } $tpl->draw('edit_users'); break; diff --git a/tmp/connexion.af3906cfde643ae7f290cfdc51cc9342.rtpl.php b/tmp/connexion.af3906cfde643ae7f290cfdc51cc9342.rtpl.php index 004f015..59e152d 100644 --- a/tmp/connexion.af3906cfde643ae7f290cfdc51cc9342.rtpl.php +++ b/tmp/connexion.af3906cfde643ae7f290cfdc51cc9342.rtpl.php @@ -1,10 +1,10 @@ assign( $this->var );$tpl->draw( dirname("header") . ( substr("header",-1,1) != "/" ? "/" : "" ) . basename("header") );?> -
Lire ligne doit case€ à colonne. Les liens permettent de confirmer le paiement des dettes.
-Doit\À | +Owes\To | + $value1 ){ $counter1++; ?> + ++ + |
---|---|---|
+ |
Date | -Payé par | -Participants | -Montant | -Menu | -Modifier | -Supprimer | +Paid by | +Users in | +Amount | +What ? | +Edit | +Delete |
---|---|---|---|---|---|---|---|---|---|---|---|---|
+ | + | + | + | + | Edit | +Delete | +
{$error}
+{/if} +