diff --git a/e107_handlers/redirection_class.php b/e107_handlers/redirection_class.php index ddb986cdd..b32309191 100644 --- a/e107_handlers/redirection_class.php +++ b/e107_handlers/redirection_class.php @@ -314,7 +314,7 @@ class redirection { e107::getSession()->end(); } - if(NULL == $http_response_code) + if(null === $http_response_code) { header('Location: '.$url, $replace); } diff --git a/usersettings.php b/usersettings.php index 0ed230223..4449d403c 100644 --- a/usersettings.php +++ b/usersettings.php @@ -560,7 +560,18 @@ if ($dataToSave && !$promptPassword) } // End - if (!$error)... -if (!$error && !$promptPassword) { unset($_POST); } +if (!$error && !$promptPassword) +{ + if(isset($_POST) && $changedUserData['user_name']) + { + $redirect = e107::getRedirect(); + $url = e107::getUrl(); + $to = $_uid ? $url->create('user/profile/edit', array('id' => $_uid, 'name' => $changedUserData['user_name'])) : $url->create('user/myprofile/edit'); + if($message) e107::getMessage()->addSuccess($message, 'default', true); + $redirect->redirect($to); + } + unset($_POST); +} if ($error) @@ -585,6 +596,8 @@ if ($error) // --- User data has been updated here if appropriate --- +$testSessionMessage = e107::getMessage()->get(E_MESSAGE_SUCCESS, 'default', true); // only success in the session +if($testSessionMessage) $message = implode('
', $testSessionMessage); // we got raw message - array if (isset($message)) { $ns->tablerender($caption, $message);