Add fiche download auth check
This commit is contained in:
parent
e9579c8956
commit
a745daa506
|
@ -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 */
|
||||
|
|
|
@ -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" }
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue