6947: fix redirection problem when updating profile

skala
Noel Dieschburg 15 years ago
parent e56e3ceee2
commit 0b59d7e3fb
  1. 10
      main/auth/profile.php
  2. 10
      main/inc/local.inc.php

@ -285,7 +285,7 @@ if (is_profile_editable() && api_get_setting('profile', 'password') == 'true') {
// user must enter identical password twice so we can prevent some user errors
$form->addRule(array('password1', 'password2'), get_lang('PassTwo'), 'compare');
if (CHECK_PASS_EASY_TO_FIND) {
$form->addRule('password1', get_lang('PassTooEasy').': '.api_generate_password(), 'callback', 'api_check_password');
$form->addRule('password1', get_lang('CurrentPasswordEmptyOrIncorrect'), 'callback', 'api_check_password');
}
}
@ -734,10 +734,10 @@ if ($form->validate()) {
}
// re-init the system to take new settings into account
$uidReset = true;
include api_get_path(INCLUDE_PATH).'local.inc.php';
$_SESSION['_user']['uidReset'] = true;
$_SESSION['noredirection'] = true;
$_SESSION['profile_update'] = 'success';
header("Location: ".api_get_self()."?{$_SERVER['QUERY_STRING']}".($filtered_extension && strpos($_SERVER['QUERY_STRING'], '&fe=1') === false ? '&fe=1' : ''));
header("Location: ".api_get_self()."?{$_SERVER['QUERY_STRING']}".($filtered_extension && strpos($_SERVER['QUERY_STRING'], '&fe=1') === false ? '&fe=1' : ''));
exit;
}
@ -858,4 +858,4 @@ if (api_get_setting('allow_social_tool') == 'true') {
echo '</div>';
$form->display();
}
Display :: display_footer();
Display :: display_footer();

@ -659,10 +659,14 @@ if (isset($uidReset) && $uidReset) { // session data refresh requested
api_session_register('is_platformAdmin');
api_session_register('is_allowedCreateCourse');
// If request_uri is settd we have to go further to have course permissions
// If request_uri is setted we have to go further to have course permissions
if (empty($_SESSION['request_uri']) || !isset($_SESSION['request_uri'])) {
require_once api_get_path(LIBRARY_PATH).'loginredirection.lib.php';
LoginRedirection::redirect();
if( $_SESSION['noredirection'] ) {//If we just want to rest information without redirecting user
unset($_SESSION['noredirection']);
} else {
require_once api_get_path(LIBRARY_PATH).'loginredirection.lib.php';
LoginRedirection::redirect();
}
}
} else {

Loading…
Cancel
Save