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
|
* @return download<File> The PDF fiche
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
public static function get($args){
|
public static function get($args){
|
||||||
|
|
||||||
$prof_id = -1;
|
$prof_id = -1;
|
||||||
extract($args);
|
extract($args);
|
||||||
|
|
||||||
|
if(!$_SESSION["CAS"]["admin"] && $_SESSION["CAS"]["id"] != $prof_id){
|
||||||
|
return [
|
||||||
|
'headers' => ["Content-Type" => "text/html"],
|
||||||
|
'body' => "Unauthorized access"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/* (0) Initialize
|
/* (0) Initialize
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
/* (1) Initialize data structure */
|
/* (1) Initialize data structure */
|
||||||
|
|
|
@ -260,7 +260,7 @@
|
||||||
|
|
||||||
"GET": {
|
"GET": {
|
||||||
"des": "Get a professor's fiche",
|
"des": "Get a professor's fiche",
|
||||||
"per": [["cas_admin"]],
|
"per": [["cas_admin"],["cas_user"]],
|
||||||
"par": {
|
"par": {
|
||||||
"URL0": { "des": "Optional professor UID.", "typ": "id", "ren": "prof_id" }
|
"URL0": { "des": "Optional professor UID.", "typ": "id", "ren": "prof_id" }
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue