mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
User settings page - redirect after successful update if user_name changed (prevent page not found when SEF url containing user_name is used).
This commit is contained in:
@@ -314,7 +314,7 @@ class redirection
|
|||||||
{
|
{
|
||||||
e107::getSession()->end();
|
e107::getSession()->end();
|
||||||
}
|
}
|
||||||
if(NULL == $http_response_code)
|
if(null === $http_response_code)
|
||||||
{
|
{
|
||||||
header('Location: '.$url, $replace);
|
header('Location: '.$url, $replace);
|
||||||
}
|
}
|
||||||
|
@@ -560,7 +560,18 @@ if ($dataToSave && !$promptPassword)
|
|||||||
} // End - if (!$error)...
|
} // 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)
|
if ($error)
|
||||||
@@ -585,6 +596,8 @@ if ($error)
|
|||||||
|
|
||||||
|
|
||||||
// --- User data has been updated here if appropriate ---
|
// --- 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('<br />', $testSessionMessage); // we got raw message - array
|
||||||
if (isset($message))
|
if (isset($message))
|
||||||
{
|
{
|
||||||
$ns->tablerender($caption, $message);
|
$ns->tablerender($caption, $message);
|
||||||
|
Reference in New Issue
Block a user