1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

update password in config screen

This commit is contained in:
Nicolas Lœuillet 2013-06-01 08:23:37 +02:00
parent aa8c9f2a32
commit da368cc84f
2 changed files with 32 additions and 5 deletions

View file

@ -25,11 +25,6 @@ $ref = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
if (isset($_GET['login'])) {
// Login
if (!empty($_POST['login']) && !empty($_POST['password'])) {
// echo $_SESSION['login']."<br>";
// echo $_SESSION['pass']."<br>";
// echo $_POST['login']."<br>";
// echo encode_string($_POST['password'] . $_POST['login']);
// die;
if (Session::login($_SESSION['login'], $_SESSION['pass'], $_POST['login'], encode_string($_POST['password'] . $_POST['login']))) {
logm('login successful');
$msg->add('s', 'welcome in your poche!');
@ -55,6 +50,19 @@ elseif (isset($_GET['logout'])) {
Session::logout();
MyTool::redirect();
}
elseif (isset($_GET['config'])) {
if (isset($_POST['password']) && isset($_POST['password_repeat'])) {
if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") {
logm('password updated');
$store->updatePassword(encode_string($_POST['password'] . $_SESSION['login']));
$msg->add('s', 'your password has been updated');
}
else
$msg->add('e', 'your password can\'t be empty and you have to repeat it in the second field');
}
else
$msg->add('e', 'error in your password update');
}
# Traitement des paramètres et déclenchement des actions
$view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index';