Merge pull request #64 from ThomasRubini/redirect
This commit is contained in:
commit
b52d43ca6f
@ -13,7 +13,8 @@ final class ApprController
|
|||||||
|
|
||||||
$O_apprModel = new ApprModel();
|
$O_apprModel = new ApprModel();
|
||||||
$O_apprModel->createAppr($_SESSION["ID"], $I_recipe_id, $S_comment, $I_score);
|
$O_apprModel->createAppr($_SESSION["ID"], $I_recipe_id, $S_comment, $I_score);
|
||||||
|
|
||||||
|
header("Location: ".$_SERVER['HTTP_REFERER']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteAction(Array $A_urlParams = null, Array $A_postParams = null)
|
public function deleteAction(Array $A_urlParams = null, Array $A_postParams = null)
|
||||||
@ -35,8 +36,6 @@ final class ApprController
|
|||||||
|
|
||||||
$O_apprModel->deleteAppr($I_appr_id);
|
$O_apprModel->deleteAppr($I_appr_id);
|
||||||
|
|
||||||
echo "Appreciation $I_appr_id supprimée avec succès";
|
header("Location: ".$_SERVER['HTTP_REFERER']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@ -44,8 +44,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($I_err_httpCode !== null) {
|
if ($I_err_httpCode !== null) {
|
||||||
http_response_code($I_err_httpCode);
|
|
||||||
|
// do not disable redirects
|
||||||
|
if(http_response_code() !== 302) {
|
||||||
|
http_response_code($I_err_httpCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make the user see the error in these cases
|
||||||
if($I_err_httpCode === 500 || $I_err_httpCode === 400) {
|
if($I_err_httpCode === 500 || $I_err_httpCode === 400) {
|
||||||
header_remove("Location");
|
header_remove("Location");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user