Minor - add "exit()" after "header()"

- Move loginFailed before redirection
- Format code
pull/2487/head
jmontoyaa 8 years ago
parent 711964f2b5
commit 6f9490e5d6
  1. 4
      main/cron/fix_lp_total_time.php
  2. 5
      main/inc/local.inc.php

@ -34,8 +34,8 @@ while ($row = Database::fetch_array($result, 'ASSOC')) {
Database::query($sql);
}
$oldTotalTime = round($oldTotalTime / 3600 , 2) ;
$report = "Previous total_time : ".round($oldTotalTime/3600,2)." hours";
$oldTotalTime = round($oldTotalTime / 3600, 2);
$report = "Previous total_time : ".round($oldTotalTime / 3600, 2)." hours";
$report .= PHP_EOL;
$report .= "New total_time: $valueToUpdate";
$report .= PHP_EOL;

@ -787,6 +787,7 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
}
} else {
// Redirect to the subscription form
Session::write('loginFailed', '1');
header(
'Location: '.api_get_path(WEB_CODE_PATH)
.'auth/inscription.php?username='.$res['openid.sreg.nickname']
@ -794,7 +795,6 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
.'&openid='.$res['openid.identity']
.'&openid_msg=idnotfound'
);
Session::write('loginFailed', '1');
exit;
//$loginFailed = true;
}
@ -888,7 +888,8 @@ if (isset($uidReset) && $uidReset) {
Session::write('is_platformAdmin', $is_platformAdmin);
Session::write('is_allowedCreateCourse', $is_allowedCreateCourse);
} else {
header('location:'.api_get_path(WEB_PATH));
header('Location:'.api_get_path(WEB_PATH));
exit;
//exit("WARNING UNDEFINED UID !! ");
}
} else {

Loading…
Cancel
Save