From 13e4c5a87ea3aa9e96266696c9e738e462281372 Mon Sep 17 00:00:00 2001 From: Yoselyn Castillo Date: Mon, 8 Oct 2012 16:55:29 +0200 Subject: [PATCH] Should fix bug when changing the email in the user's profile see #5556 --- main/auth/profile.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main/auth/profile.php b/main/auth/profile.php index 6f64609727..5015ba786a 100644 --- a/main/auth/profile.php +++ b/main/auth/profile.php @@ -577,7 +577,7 @@ if ($form->validate()) { //change email if ($allow_users_to_change_email_with_no_password) { - if (!empty($changeemail) && in_array('email', $available_values_to_modify)) { + if (in_array('email', $available_values_to_modify)) { $sql .= " email = '".Database::escape_string($changeemail)."',"; } if (isset($password) && in_array('password', $available_values_to_modify)) { @@ -592,9 +592,7 @@ if ($form->validate()) { if (!empty($changeemail) && !isset($password) && in_array('email', $available_values_to_modify)) { $sql .= " email = '".Database::escape_string($changeemail)."'"; } elseif (isset($password) && isset($changeemail) && in_array('email', $available_values_to_modify) && in_array('password', $available_values_to_modify)) { - if (!empty($changeemail)) { - $sql .= " email = '".Database::escape_string($changeemail)."',"; - } + $sql .= " email = '".Database::escape_string($changeemail)."',"; $password = api_get_encrypted_password($password); $sql .= " password = '".Database::escape_string($password)."'"; } elseif (isset($password) && in_array('password', $available_values_to_modify)) { @@ -744,4 +742,4 @@ if (api_get_setting('allow_social_tool') == 'true') { echo ''; $form->display(); } -Display :: display_footer(); +Display :: display_footer(); \ No newline at end of file