Add fiche download auth check

This commit is contained in:
Unknown 2018-05-10 15:43:02 +02:00
parent e9579c8956
commit a745daa506
2 changed files with 9 additions and 1 deletions

View File

@ -22,9 +22,17 @@ class pdfController{
* @return download<File> The PDF fiche
---------------------------------------------------------*/
public static function get($args){
$prof_id = -1;
extract($args);
if(!$_SESSION["CAS"]["admin"] && $_SESSION["CAS"]["id"] != $prof_id){
return [
'headers' => ["Content-Type" => "text/html"],
'body' => "Unauthorized access"
];
}
/* (0) Initialize
---------------------------------------------------------*/
/* (1) Initialize data structure */

View File

@ -260,7 +260,7 @@
"GET": {
"des": "Get a professor's fiche",
"per": [["cas_admin"]],
"per": [["cas_admin"],["cas_user"]],
"par": {
"URL0": { "des": "Optional professor UID.", "typ": "id", "ren": "prof_id" }
},