Added permission check in PreorderApi for preorderaddressreporting

This commit is contained in:
Frank Schubert
2023-06-06 12:58:06 +02:00
parent 43e4b781e6
commit d2ef831e3d
4 changed files with 19 additions and 2 deletions
+4 -1
View File
@@ -78,7 +78,10 @@ class mfBaseApicontroller {
if($this->requireAuth) {
$this->authenticateUser();
if(method_exists($this,"authenticated")) {
$this->authenticated(); // event defined in extending class
$afterAuthResult = $this->authenticated(); // event defined in extending class
if(mfResponse::isResponse($afterAuthResult)) {
$this->return($afterAuthResult);
}
}
}
+9
View File
@@ -2,6 +2,15 @@
class mfResponse {
public static function isResponse($test) {
if(is_array($test) && array_key_exists('code', $test) && array_key_exists('status', $test)) {
if($test['code'] >= 100 && $test['code'] < 600) {
return true;
}
}
return false;
}
public static function Ok($data = []) {
$response = [];
$response['code'] = 200;