@@ -82,7 +82,7 @@ |
||
| 82 | 82 | $jobPosterApplicationId = Utils::getParameterFromRequest($requestParams,4); |
| 83 | 83 | $criteriaId = Utils::getParameterFromRequest($requestParams,6); |
| 84 | 84 | |
| 85 | - //This action is available to the owner of the application, the owner of the job poster its for, and admins |
|
| 85 | + //This action is available to the owner of the application, the owner of the job poster its for, and admins |
|
| 86 | 86 | $userId = JobApplicationController::getJobApplicationUserId($jobPosterApplicationId); |
| 87 | 87 | $userPermissions = []; |
| 88 | 88 | $userPermissions[] = new UserPermission(ROLE_ADMIN); |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | //var_dump($requestParams); |
| 25 | 25 | switch ($requestMethod) { |
| 26 | 26 | case 'GET': |
| 27 | - if(strlen($requestParams) > 1){ |
|
| 28 | - $jobPosterApplicationId = Utils::getParameterFromRequest($requestParams,4); |
|
| 27 | + if (strlen($requestParams) > 1) { |
|
| 28 | + $jobPosterApplicationId = Utils::getParameterFromRequest($requestParams, 4); |
|
| 29 | 29 | |
| 30 | 30 | //This is viewable by the owner of the application, the owner of the job poster its for, and admins |
| 31 | 31 | $userId = JobApplicationController::getJobApplicationUserId($jobPosterApplicationId); |
@@ -38,18 +38,18 @@ discard block |
||
| 38 | 38 | $result = SkillDeclarationController::getAllSkillDeclarationsForJobApplication($jobPosterApplicationId); |
| 39 | 39 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 40 | 40 | echo($json); |
| 41 | - } else { |
|
| 41 | + }else { |
|
| 42 | 42 | header('HTTP/1.0 400 Bad Request'); |
| 43 | - echo json_encode(array("failed"=>'No request parameters provided'),JSON_FORCE_OBJECT); |
|
| 43 | + echo json_encode(array("failed"=>'No request parameters provided'), JSON_FORCE_OBJECT); |
|
| 44 | 44 | exit; |
| 45 | 45 | } |
| 46 | 46 | break; |
| 47 | 47 | case 'POST': |
| 48 | 48 | break; |
| 49 | 49 | case 'DELETE': |
| 50 | - if(strlen($requestParams) > 1){ |
|
| 51 | - $jobPosterApplicationId = Utils::getParameterFromRequest($requestParams,4); |
|
| 52 | - $criteriaId = Utils::getParameterFromRequest($requestParams,6); |
|
| 50 | + if (strlen($requestParams) > 1) { |
|
| 51 | + $jobPosterApplicationId = Utils::getParameterFromRequest($requestParams, 4); |
|
| 52 | + $criteriaId = Utils::getParameterFromRequest($requestParams, 6); |
|
| 53 | 53 | |
| 54 | 54 | //This action is available to the owner of the application, the owner of the job poster its for, and admins |
| 55 | 55 | $userId = JobApplicationController::getJobApplicationUserId($jobPosterApplicationId); |
@@ -64,23 +64,23 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 66 | 66 | echo($json); |
| 67 | - } else { |
|
| 67 | + }else { |
|
| 68 | 68 | header('HTTP/1.0 403 Forbidden'); |
| 69 | 69 | echo json_encode(array("failed"=>"Only Draft applications can be modified."), JSON_FORCE_OBJECT); |
| 70 | 70 | exit; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
| 74 | - } else { |
|
| 74 | + }else { |
|
| 75 | 75 | header('HTTP/1.0 400 Bad Request'); |
| 76 | - echo json_encode(array("failed"=>'No request parameters provided'),JSON_FORCE_OBJECT); |
|
| 76 | + echo json_encode(array("failed"=>'No request parameters provided'), JSON_FORCE_OBJECT); |
|
| 77 | 77 | exit; |
| 78 | 78 | } |
| 79 | 79 | break; |
| 80 | 80 | case 'PUT': |
| 81 | - if(strlen($requestParams) > 1){ |
|
| 82 | - $jobPosterApplicationId = Utils::getParameterFromRequest($requestParams,4); |
|
| 83 | - $criteriaId = Utils::getParameterFromRequest($requestParams,6); |
|
| 81 | + if (strlen($requestParams) > 1) { |
|
| 82 | + $jobPosterApplicationId = Utils::getParameterFromRequest($requestParams, 4); |
|
| 83 | + $criteriaId = Utils::getParameterFromRequest($requestParams, 6); |
|
| 84 | 84 | |
| 85 | 85 | //This action is available to the owner of the application, the owner of the job poster its for, and admins |
| 86 | 86 | $userId = JobApplicationController::getJobApplicationUserId($jobPosterApplicationId); |
@@ -108,15 +108,15 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 110 | 110 | echo($json); |
| 111 | - } else { |
|
| 111 | + }else { |
|
| 112 | 112 | header('HTTP/1.0 403 Forbidden'); |
| 113 | 113 | echo json_encode(array("failed"=>"Only Draft applications can be modified."), JSON_FORCE_OBJECT); |
| 114 | 114 | exit; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - } else { |
|
| 117 | + }else { |
|
| 118 | 118 | header('HTTP/1.0 400 Bad Request'); |
| 119 | - echo json_encode(array("failed"=>'No request parameters provided'),JSON_FORCE_OBJECT); |
|
| 119 | + echo json_encode(array("failed"=>'No request parameters provided'), JSON_FORCE_OBJECT); |
|
| 120 | 120 | exit; |
| 121 | 121 | } |
| 122 | 122 | break; |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | case 'GET': |
| 28 | 28 | //Here Handle PUT Request |
| 29 | 29 | //$jsonBody = file_get_contents('php://input'); |
| 30 | - if(strlen($requestParams) > 1){ |
|
| 31 | - $jobPosterApplicationId = Utils::getParameterFromRequest($requestParams,4); |
|
| 30 | + if (strlen($requestParams) > 1) { |
|
| 31 | + $jobPosterApplicationId = Utils::getParameterFromRequest($requestParams, 4); |
|
| 32 | 32 | $jobApplicationWithAnswers = JobApplicationController::getJobApplicationWithAnswersById($jobPosterApplicationId); |
| 33 | 33 | |
| 34 | 34 | //Authenticate that the submitting user owns job seeker profile (or is admin) |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $json = json_encode($jobApplicationWithAnswers, JSON_PRETTY_PRINT); |
| 42 | 42 | echo($json); |
| 43 | - } else { |
|
| 43 | + }else { |
|
| 44 | 44 | $result = array(); |
| 45 | 45 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 46 | 46 | echo($json); |
@@ -30,13 +30,13 @@ discard block |
||
| 30 | 30 | if ($result == NULL) { |
| 31 | 31 | http_response_code(404); |
| 32 | 32 | echo('No profile image uploaded for this user.'); |
| 33 | - } else { |
|
| 33 | + }else { |
|
| 34 | 34 | header("Content-type: " . $result->getType()); |
| 35 | 35 | echo($result->getImage()); |
| 36 | 36 | } |
| 37 | - }else{ |
|
| 37 | + }else { |
|
| 38 | 38 | header('HTTP/1.0 400 Bad Request'); |
| 39 | - echo json_encode(array("failed"=>'No request parameters provided'),JSON_FORCE_OBJECT); |
|
| 39 | + echo json_encode(array("failed"=>'No request parameters provided'), JSON_FORCE_OBJECT); |
|
| 40 | 40 | exit; |
| 41 | 41 | } |
| 42 | 42 | break; |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | //Here Handle DELETE Request |
| 48 | 48 | break; |
| 49 | 49 | case 'PUT': |
| 50 | - if(strlen($requestParams) > 1){ |
|
| 51 | - $user_id = Utils::getParameterFromRequest($requestParams,4); |
|
| 50 | + if (strlen($requestParams) > 1) { |
|
| 51 | + $user_id = Utils::getParameterFromRequest($requestParams, 4); |
|
| 52 | 52 | |
| 53 | 53 | //Admins, and the owning applicant have permission to update |
| 54 | 54 | $userPermissions = []; |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | $result = ProfilePicController::putProfilePic($profile_pic); |
| 65 | 65 | |
| 66 | 66 | echo($result); |
| 67 | - }else{ |
|
| 67 | + }else { |
|
| 68 | 68 | header('HTTP/1.0 400 Bad Request'); |
| 69 | - echo json_encode(array("failed"=>'No request parameters provided'),JSON_FORCE_OBJECT); |
|
| 69 | + echo json_encode(array("failed"=>'No request parameters provided'), JSON_FORCE_OBJECT); |
|
| 70 | 70 | exit; |
| 71 | 71 | } |
| 72 | 72 | break; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | header("Content-type: " . $result->getType()); |
| 35 | 35 | echo($result->getImage()); |
| 36 | 36 | } |
| 37 | - }else{ |
|
| 37 | + } else{ |
|
| 38 | 38 | header('HTTP/1.0 400 Bad Request'); |
| 39 | 39 | echo json_encode(array("failed"=>'No request parameters provided'),JSON_FORCE_OBJECT); |
| 40 | 40 | exit; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $result = ProfilePicController::putProfilePic($profile_pic); |
| 65 | 65 | |
| 66 | 66 | echo($result); |
| 67 | - }else{ |
|
| 67 | + } else{ |
|
| 68 | 68 | header('HTTP/1.0 400 Bad Request'); |
| 69 | 69 | echo json_encode(array("failed"=>'No request parameters provided'),JSON_FORCE_OBJECT); |
| 70 | 70 | exit; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | switch ($requestMethod) { |
| 26 | 26 | case 'GET': |
| 27 | 27 | |
| 28 | - if(strlen($requestParams) > 1){ |
|
| 28 | + if (strlen($requestParams) > 1) { |
|
| 29 | 29 | |
| 30 | 30 | //Job Posters are publicly viewable, no authentication |
| 31 | 31 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 36 | 36 | header("Content-length:" . strlen($json)); |
| 37 | 37 | echo($json); |
| 38 | - } else { |
|
| 38 | + }else { |
|
| 39 | 39 | $result = array(); |
| 40 | 40 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 41 | 41 | echo($json); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $result = JobPosterController::createJobPoster($jobPoster); |
| 112 | 112 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 113 | 113 | echo($json); |
| 114 | - } else { |
|
| 114 | + }else { |
|
| 115 | 115 | $result = array(); |
| 116 | 116 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 117 | 117 | echo($json); |
@@ -26,22 +26,22 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | switch ($requestMethod) { |
| 28 | 28 | case 'GET': |
| 29 | - if(strlen($requestParams) > 1){ |
|
| 29 | + if (strlen($requestParams) > 1) { |
|
| 30 | 30 | //Workplace photos are public, no authentication |
| 31 | 31 | |
| 32 | - $managerProfileId = Utils::getParameterFromRequest($requestParams,4); |
|
| 33 | - $photoName = Utils::getParameterFromRequest($requestParams,5); |
|
| 32 | + $managerProfileId = Utils::getParameterFromRequest($requestParams, 4); |
|
| 33 | + $photoName = Utils::getParameterFromRequest($requestParams, 5); |
|
| 34 | 34 | |
| 35 | 35 | $result = WorkEnvironmentController::getWorkplacePhotoByManagerProfileAndName($photoName, $managerProfileId); |
| 36 | 36 | |
| 37 | 37 | if ($result == NULL) { |
| 38 | 38 | http_response_code(404); |
| 39 | 39 | echo('This workplace photo does not exist'); |
| 40 | - } else { |
|
| 40 | + }else { |
|
| 41 | 41 | header("Content-type: " . $result->getMime_type()); |
| 42 | 42 | echo($result->getFile()); |
| 43 | 43 | } |
| 44 | - } else { |
|
| 44 | + }else { |
|
| 45 | 45 | $result = array(); |
| 46 | 46 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 47 | 47 | echo($json); |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | break; |
| 70 | 70 | case 'PUT': |
| 71 | 71 | |
| 72 | - if(strlen($requestParams) > 1){ |
|
| 72 | + if (strlen($requestParams) > 1) { |
|
| 73 | 73 | |
| 74 | - $managerProfileId = Utils::getParameterFromRequest($requestParams,4); |
|
| 74 | + $managerProfileId = Utils::getParameterFromRequest($requestParams, 4); |
|
| 75 | 75 | |
| 76 | - if(strlen($managerProfileId) > 0){ |
|
| 76 | + if (strlen($managerProfileId) > 0) { |
|
| 77 | 77 | |
| 78 | 78 | $user = UserController::getUserByManagerProfileId($managerProfileId); |
| 79 | 79 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | //TODO: add owning manager permission |
| 84 | 84 | AuthenticationController::validateUser($userPermissions); |
| 85 | 85 | |
| 86 | - $photoName = Utils::getParameterFromRequest($requestParams,5); |
|
| 86 | + $photoName = Utils::getParameterFromRequest($requestParams, 5); |
|
| 87 | 87 | |
| 88 | 88 | $workplacePhoto = new File( |
| 89 | 89 | file_get_contents('php://input'), |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 94 | 94 | |
| 95 | 95 | echo($json); |
| 96 | - }else{ |
|
| 96 | + }else { |
|
| 97 | 97 | header('HTTP/1.0 400 Bad Request'); |
| 98 | - echo json_encode(array("failed"=>"No manager profile id provided"),JSON_FORCE_OBJECT); |
|
| 98 | + echo json_encode(array("failed"=>"No manager profile id provided"), JSON_FORCE_OBJECT); |
|
| 99 | 99 | exit; |
| 100 | 100 | } |
| 101 | - }else{ |
|
| 101 | + }else { |
|
| 102 | 102 | header('HTTP/1.0 400 Bad Request'); |
| 103 | - echo json_encode(array("failed"=>'No request parameters provided'),JSON_FORCE_OBJECT); |
|
| 103 | + echo json_encode(array("failed"=>'No request parameters provided'), JSON_FORCE_OBJECT); |
|
| 104 | 104 | exit; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -93,12 +93,12 @@ |
||
| 93 | 93 | $json = json_encode($result, JSON_PRETTY_PRINT); |
| 94 | 94 | |
| 95 | 95 | echo($json); |
| 96 | - }else{ |
|
| 96 | + } else{ |
|
| 97 | 97 | header('HTTP/1.0 400 Bad Request'); |
| 98 | 98 | echo json_encode(array("failed"=>"No manager profile id provided"),JSON_FORCE_OBJECT); |
| 99 | 99 | exit; |
| 100 | 100 | } |
| 101 | - }else{ |
|
| 101 | + } else{ |
|
| 102 | 102 | header('HTTP/1.0 400 Bad Request'); |
| 103 | 103 | echo json_encode(array("failed"=>'No request parameters provided'),JSON_FORCE_OBJECT); |
| 104 | 104 | exit; |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | require_once __DIR__ . '/../config/php.config.inc'; |
| 4 | 4 | |
| 5 | - require_once __DIR__ . '/../config/db.config.inc'; |
|
| 5 | + require_once __DIR__ . '/../config/db.config.inc'; |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Summary: Database connection manager class |
@@ -10,10 +10,10 @@ |
||
| 10 | 10 | $path = dirname(__FILE__); |
| 11 | 11 | |
| 12 | 12 | //var_dump(ROOT); |
| 13 | -require_once __DIR__ .'/../config/auth.config.inc'; |
|
| 14 | -require_once __DIR__ .'/../model/User.php'; |
|
| 15 | -require_once __DIR__ .'/../controller/UserController.php'; |
|
| 16 | -require_once __DIR__ .'/../utils/Utils.php'; |
|
| 13 | +require_once __DIR__ . '/../config/auth.config.inc'; |
|
| 14 | +require_once __DIR__ . '/../model/User.php'; |
|
| 15 | +require_once __DIR__ . '/../controller/UserController.php'; |
|
| 16 | +require_once __DIR__ . '/../utils/Utils.php'; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Description of JWTUtils |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once __DIR__."/User.php"; |
|
| 3 | +require_once __DIR__ . "/User.php"; |
|
| 4 | 4 | |
| 5 | 5 | class UserPermission { |
| 6 | 6 | protected $user_id; |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | //Set cookies used for backend authentication |
| 50 | 50 | |
| 51 | 51 | //Set cookies with session expiry and valid for the whole domain |
| 52 | - setcookie(ID_TOKEN, $oidc->getIdToken(),0,"/"); |
|
| 53 | - setcookie(ACCESS_TOKEN, $oidc->getAccessToken(),0,"/"); |
|
| 54 | - setcookie(REFRESH_TOKEN, $oidc->getRefreshToken(),0,"/"); |
|
| 52 | + setcookie(ID_TOKEN, $oidc->getIdToken(), 0, "/"); |
|
| 53 | + setcookie(ACCESS_TOKEN, $oidc->getAccessToken(), 0, "/"); |
|
| 54 | + setcookie(REFRESH_TOKEN, $oidc->getRefreshToken(), 0, "/"); |
|
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | //Set Cookies through javascript because setcookie can only be called |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | //Authentication complete - redirect to homepage |
| 69 | 69 | if ($user->getUser_role() === "administrator") { |
| 70 | 70 | $homepage = HOMEPAGE_URI_ADMIN; |
| 71 | - } else { |
|
| 71 | + }else { |
|
| 72 | 72 | $homepage = HOMEPAGE_URI_APPLICANT; |
| 73 | 73 | } |
| 74 | 74 | header("Location: " . $homepage); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | -} else { |
|
| 79 | +}else { |
|
| 80 | 80 | $_SESSION['openid_connect_state'] = $state; |
| 81 | 81 | $_SESSION['openid_connect_nonce'] = $nonce; |
| 82 | 82 | } |
| 83 | 83 | \ No newline at end of file |