From b6d1a1f125e44fe6af1c8eff7635e6d509abe262 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 14 Apr 2013 18:19:01 +0200 Subject: [PATCH] tabwidth --- mod/settings.php | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/mod/settings.php b/mod/settings.php index 3d3688e29b..ca688d1a9f 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -300,8 +300,8 @@ function settings_post(&$a) { if((x($_POST,'npassword')) || (x($_POST,'confirm'))) { $newpass = $_POST['npassword']; - $confirm = $_POST['confirm']; - $oldpass = hash('whirlpool', $_POST['opassword']); + $confirm = $_POST['confirm']; + $oldpass = hash('whirlpool', $_POST['opassword']); $err = false; if($newpass != $confirm ) { @@ -312,15 +312,15 @@ function settings_post(&$a) { if((! x($newpass)) || (! x($confirm))) { notice( t('Empty passwords are not allowed. Password unchanged.') . EOL); $err = true; - } + } - // check if the old password was supplied correctly before - // changing it to the new value - $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user())); - if( $oldpass != $r[0]['password'] ) { - notice( t('Wrong password.') . EOL); - $err = true; - } + // check if the old password was supplied correctly before + // changing it to the new value + $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user())); + if( $oldpass != $r[0]['password'] ) { + notice( t('Wrong password.') . EOL); + $err = true; + } if(! $err) { $password = hash('whirlpool',$newpass); @@ -403,17 +403,17 @@ function settings_post(&$a) { if($email != $a->user['email']) { $email_changed = true; - // check for the correct password - $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user())); - $password = hash('whirlpool', $_POST['password']); - if ($password != $r[0]['password']) { - $err .= t('Wrong Password') . EOL; - $email = $a->user['email']; - } - // check the email is valid - if(! valid_email($email)) - $err .= t(' Not valid email.'); - // ensure new email is not the admin mail + // check for the correct password + $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user())); + $password = hash('whirlpool', $_POST['password']); + if ($password != $r[0]['password']) { + $err .= t('Wrong Password') . EOL; + $email = $a->user['email']; + } + // check the email is valid + if(! valid_email($email)) + $err .= t(' Not valid email.'); + // ensure new email is not the admin mail if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0)) { $err .= t(' Cannot change to that email.'); $email = $a->user['email']; -- 2.39.5