@@ -29,8 +29,8 @@ |
||
29 | 29 | //Define action and timing |
30 | 30 | |
31 | 31 | //Execute each hour TUS script to remove expired incomplete upload |
32 | -$tusConfigFile = dirname(__DIR__, 1).'/data/_config/tus_server.php'; |
|
33 | -$rootPath = dirname(__DIR__, 2); |
|
32 | +$tusConfigFile=dirname(__DIR__, 1).'/data/_config/tus_server.php'; |
|
33 | +$rootPath=dirname(__DIR__, 2); |
|
34 | 34 | $scheduler->raw($rootPath.'/vendor/bin/tus tus:expired --config='.$tusConfigFile)->hourly()->output('/var/log/tus_cron.log'); |
35 | 35 | |
36 | 36 |
@@ -2,20 +2,20 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /** |
|
6 | - * Redis connection parameters. |
|
7 | - */ |
|
8 | - 'redis' => [ |
|
9 | - 'host' => getenv('REDIS_HOST') !== false ? getenv('REDIS_HOST') : '127.0.0.1', |
|
10 | - 'port' => getenv('REDIS_PORT') !== false ? getenv('REDIS_PORT') : '6379', |
|
11 | - 'database' => getenv('REDIS_DB') !== false ? getenv('REDIS_DB') : 0, |
|
12 | - ], |
|
5 | + /** |
|
6 | + * Redis connection parameters. |
|
7 | + */ |
|
8 | + 'redis' => [ |
|
9 | + 'host' => getenv('REDIS_HOST') !== false ? getenv('REDIS_HOST') : '127.0.0.1', |
|
10 | + 'port' => getenv('REDIS_PORT') !== false ? getenv('REDIS_PORT') : '6379', |
|
11 | + 'database' => getenv('REDIS_DB') !== false ? getenv('REDIS_DB') : 0, |
|
12 | + ], |
|
13 | 13 | |
14 | - /** |
|
15 | - * File cache configs. |
|
16 | - */ |
|
17 | - 'file' => [ |
|
18 | - 'dir' => $_SERVER['DOCUMENT_ROOT'].'/data/upload' . DIRECTORY_SEPARATOR . '.cache' . DIRECTORY_SEPARATOR, |
|
19 | - 'name' => 'tus_php.server.cache', |
|
20 | - ], |
|
14 | + /** |
|
15 | + * File cache configs. |
|
16 | + */ |
|
17 | + 'file' => [ |
|
18 | + 'dir' => $_SERVER['DOCUMENT_ROOT'].'/data/upload' . DIRECTORY_SEPARATOR . '.cache' . DIRECTORY_SEPARATOR, |
|
19 | + 'name' => 'tus_php.server.cache', |
|
20 | + ], |
|
21 | 21 | ]; |
22 | 22 | \ No newline at end of file |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * File cache configs. |
16 | 16 | */ |
17 | 17 | 'file' => [ |
18 | - 'dir' => $_SERVER['DOCUMENT_ROOT'].'/data/upload' . DIRECTORY_SEPARATOR . '.cache' . DIRECTORY_SEPARATOR, |
|
18 | + 'dir' => $_SERVER['DOCUMENT_ROOT'].'/data/upload'.DIRECTORY_SEPARATOR.'.cache'.DIRECTORY_SEPARATOR, |
|
19 | 19 | 'name' => 'tus_php.server.cache', |
20 | 20 | ], |
21 | 21 | ]; |
22 | 22 | \ No newline at end of file |
@@ -20,137 +20,137 @@ |
||
20 | 20 | if (!isset($_GET['page'])) { |
21 | 21 | require 'controllers/index_controller.php'; |
22 | 22 | |
23 | -}else if ($_GET['page'] == 'controller_form') { |
|
23 | +} else if ($_GET['page'] == 'controller_form') { |
|
24 | 24 | require 'controllers/investigator/controller_form_controller.php'; |
25 | 25 | |
26 | -}else if ($_GET['page'] == 'corrective_action') { |
|
26 | +} else if ($_GET['page'] == 'corrective_action') { |
|
27 | 27 | require 'controllers/investigator/corrective_action_controller.php'; |
28 | 28 | |
29 | -}else if ($_GET['page'] == 'root_investigator') { |
|
29 | +} else if ($_GET['page'] == 'root_investigator') { |
|
30 | 30 | require 'controllers/investigator/root_investigator_controller.php'; |
31 | 31 | |
32 | -}else if ($_GET['page'] == 'documentation') { |
|
32 | +} else if ($_GET['page'] == 'documentation') { |
|
33 | 33 | require 'controllers/investigator/documentation_controller.php'; |
34 | 34 | |
35 | -}else if ($_GET['page'] == 'patient_interface') { |
|
35 | +} else if ($_GET['page'] == 'patient_interface') { |
|
36 | 36 | require 'controllers/investigator/patient_interface_controller.php'; |
37 | 37 | |
38 | -}else if ($_GET['page'] == 'ask_unlock') { |
|
38 | +} else if ($_GET['page'] == 'ask_unlock') { |
|
39 | 39 | require 'controllers/investigator/ask_unlock_controller.php'; |
40 | 40 | |
41 | -}else if ($_GET['page'] == 'visit_interface') { |
|
41 | +} else if ($_GET['page'] == 'visit_interface') { |
|
42 | 42 | require 'controllers/investigator/visit_interface_controller.php'; |
43 | 43 | |
44 | -}else if ($_GET['page'] == 'new_visit') { |
|
44 | +} else if ($_GET['page'] == 'new_visit') { |
|
45 | 45 | require 'controllers/investigator/new_visit_controller.php'; |
46 | 46 | |
47 | -}else if ($_GET['page'] == 'specific_form') { |
|
47 | +} else if ($_GET['page'] == 'specific_form') { |
|
48 | 48 | require 'controllers/investigator/specific_form_controller.php'; |
49 | 49 | |
50 | -}else if ($_GET['page'] == 'administrator') { |
|
50 | +} else if ($_GET['page'] == 'administrator') { |
|
51 | 51 | require 'controllers/administrator/root_administrator_controller.php'; |
52 | 52 | |
53 | -}else if ($_GET['page'] == 'study_activation') { |
|
53 | +} else if ($_GET['page'] == 'study_activation') { |
|
54 | 54 | require 'controllers/administrator/study_activation_controller.php'; |
55 | 55 | |
56 | -}else if ($_GET['page'] == 'modify_centers') { |
|
56 | +} else if ($_GET['page'] == 'modify_centers') { |
|
57 | 57 | require 'controllers/administrator/modify_centers_controller.php'; |
58 | 58 | |
59 | -}else if ($_GET['page'] == 'preferences') { |
|
59 | +} else if ($_GET['page'] == 'preferences') { |
|
60 | 60 | require 'controllers/administrator/preferences_controller.php'; |
61 | 61 | |
62 | -}else if ($_GET['page'] == 'user_table') { |
|
62 | +} else if ($_GET['page'] == 'user_table') { |
|
63 | 63 | require 'controllers/administrator/user_table_controller.php'; |
64 | 64 | |
65 | -}else if ($_GET['page'] == 'new_user') { |
|
65 | +} else if ($_GET['page'] == 'new_user') { |
|
66 | 66 | require 'controllers/administrator/new_user_controller.php'; |
67 | 67 | |
68 | -}else if ($_GET['page'] == 'modify_user') { |
|
68 | +} else if ($_GET['page'] == 'modify_user') { |
|
69 | 69 | require 'controllers/administrator/modify_user_controller.php'; |
70 | 70 | |
71 | -}else if ($_GET['page'] == 'my_account') { |
|
71 | +} else if ($_GET['page'] == 'my_account') { |
|
72 | 72 | require 'controllers/my_account_controller.php'; |
73 | 73 | |
74 | -}else if ($_GET['page'] == 'export_database') { |
|
74 | +} else if ($_GET['page'] == 'export_database') { |
|
75 | 75 | require 'controllers/administrator/export_database_controller.php'; |
76 | 76 | |
77 | -}else if ($_GET['page'] == 'tracker_user') { |
|
77 | +} else if ($_GET['page'] == 'tracker_user') { |
|
78 | 78 | require 'controllers/administrator/tracker_user_controller.php'; |
79 | 79 | |
80 | -}else if ($_GET['page'] == 'tracker_admin') { |
|
80 | +} else if ($_GET['page'] == 'tracker_admin') { |
|
81 | 81 | require 'controllers/administrator/tracker_admin_controller.php'; |
82 | 82 | |
83 | -}else if ($_GET['page'] == 'create_study') { |
|
83 | +} else if ($_GET['page'] == 'create_study') { |
|
84 | 84 | require 'controllers/administrator/create_study_controller.php'; |
85 | 85 | |
86 | -}else if ($_GET['page'] == 'visit_builder') { |
|
86 | +} else if ($_GET['page'] == 'visit_builder') { |
|
87 | 87 | require 'controllers/administrator/visit_builder_controller.php'; |
88 | 88 | |
89 | -}else if ($_GET['page'] == 'preferences') { |
|
89 | +} else if ($_GET['page'] == 'preferences') { |
|
90 | 90 | require 'controllers/administrator/preferences_controller.php'; |
91 | 91 | |
92 | -}else if ($_GET['page'] == 'change_patient_status') { |
|
92 | +} else if ($_GET['page'] == 'change_patient_status') { |
|
93 | 93 | require 'controllers/supervisor/change_patient_status_controller.php'; |
94 | 94 | |
95 | -}else if ($_GET['page'] == 'documentation_supervisor') { |
|
95 | +} else if ($_GET['page'] == 'documentation_supervisor') { |
|
96 | 96 | require 'controllers/supervisor/documentation_controller.php'; |
97 | 97 | |
98 | -}else if ($_GET['page'] == 'documentation_upload') { |
|
98 | +} else if ($_GET['page'] == 'documentation_upload') { |
|
99 | 99 | require 'controllers/supervisor/documentation_upload_controller.php'; |
100 | 100 | |
101 | -}else if ($_GET['page'] == 'users_details') { |
|
101 | +} else if ($_GET['page'] == 'users_details') { |
|
102 | 102 | require 'controllers/supervisor/users_details_controller.php'; |
103 | 103 | |
104 | -}else if ($_GET['page'] == 'import_patients') { |
|
104 | +} else if ($_GET['page'] == 'import_patients') { |
|
105 | 105 | require 'controllers/supervisor/import_patients_controller.php'; |
106 | 106 | |
107 | -}else if ($_GET['page'] == 'patient_infos') { |
|
107 | +} else if ($_GET['page'] == 'patient_infos') { |
|
108 | 108 | require 'controllers/supervisor/patient_infos_controller.php'; |
109 | 109 | |
110 | -}else if ($_GET['page'] == 'visit_infos') { |
|
110 | +} else if ($_GET['page'] == 'visit_infos') { |
|
111 | 111 | require 'controllers/supervisor/visit_infos_controller.php'; |
112 | 112 | |
113 | -}else if ($_GET['page'] == 'root_supervisor') { |
|
113 | +} else if ($_GET['page'] == 'root_supervisor') { |
|
114 | 114 | require 'controllers/supervisor/supervisor_root_controller.php'; |
115 | 115 | |
116 | -}else if ($_GET['page'] == 'upload_manager') { |
|
116 | +} else if ($_GET['page'] == 'upload_manager') { |
|
117 | 117 | require 'controllers/supervisor/upload_manager_controller.php'; |
118 | 118 | |
119 | -}else if ($_GET['page'] == 'review_manager') { |
|
119 | +} else if ($_GET['page'] == 'review_manager') { |
|
120 | 120 | require 'controllers/supervisor/review_manager_controller.php'; |
121 | 121 | |
122 | -}else if ($_GET['page'] == 'download_manager') { |
|
122 | +} else if ($_GET['page'] == 'download_manager') { |
|
123 | 123 | require 'controllers/supervisor/download_manager_controller.php'; |
124 | 124 | |
125 | -}else if ($_GET['page'] == 'tracker') { |
|
125 | +} else if ($_GET['page'] == 'tracker') { |
|
126 | 126 | require 'controllers/supervisor/tracker_controller.php'; |
127 | 127 | |
128 | -}else if ($_GET['page'] == 'statistics') { |
|
128 | +} else if ($_GET['page'] == 'statistics') { |
|
129 | 129 | require 'controllers/supervisor/statistics_controller.php'; |
130 | 130 | |
131 | -}else if ($_GET['page'] == 'change_password') { |
|
131 | +} else if ($_GET['page'] == 'change_password') { |
|
132 | 132 | require 'controllers/change_password_controller.php'; |
133 | 133 | |
134 | -}else if ($_GET['page'] == 'forgot_password') { |
|
134 | +} else if ($_GET['page'] == 'forgot_password') { |
|
135 | 135 | require 'controllers/forgot_password_controller.php'; |
136 | 136 | |
137 | -}else if ($_GET['page'] == 'request') { |
|
137 | +} else if ($_GET['page'] == 'request') { |
|
138 | 138 | require 'controllers/request_controller.php'; |
139 | 139 | |
140 | -}else if ($_GET['page'] == 'messenger') { |
|
140 | +} else if ($_GET['page'] == 'messenger') { |
|
141 | 141 | require 'controllers/messenger_controller.php'; |
142 | 142 | |
143 | -}else if ($_GET['page'] == 'main') { |
|
143 | +} else if ($_GET['page'] == 'main') { |
|
144 | 144 | require 'controllers/main_controller.php'; |
145 | 145 | |
146 | -}else if (strpos($_GET['page'], 'orthanc') === 0) { |
|
146 | +} else if (strpos($_GET['page'], 'orthanc') === 0) { |
|
147 | 147 | //Start with Orthanc to reach orthanc |
148 | 148 | require 'scripts/dicom_web.php'; |
149 | 149 | |
150 | -}else if (strpos($_GET['page'], 'tus') === 0) { |
|
150 | +} else if (strpos($_GET['page'], 'tus') === 0) { |
|
151 | 151 | //tus subrouter |
152 | 152 | require 'scripts/tus_reverse_proxy.php'; |
153 | 153 | |
154 | -}else { |
|
154 | +} else { |
|
155 | 155 | require 'includes/404.php'; |
156 | 156 | } |
157 | 157 | \ No newline at end of file |
@@ -63,6 +63,6 @@ |
||
63 | 63 | // Output response to the browser. |
64 | 64 | (new Narrowspark\HttpEmitter\SapiEmitter)->emit($response); |
65 | 65 | |
66 | -}else { |
|
66 | +} else { |
|
67 | 67 | header('HTTP/1.0 403 Forbidden'); |
68 | 68 | } |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | |
33 | 33 | if ($roleAllowed ) { |
34 | 34 | |
35 | - unset($_GET['page']); |
|
35 | + unset($_GET['page']); |
|
36 | 36 | // Create a PSR7 request based on the current browser request. |
37 | - $request=ServerRequestFactory::fromGlobals(); |
|
37 | + $request=ServerRequestFactory::fromGlobals(); |
|
38 | 38 | |
39 | 39 | // Create a guzzle client |
40 | 40 | $guzzle=new GuzzleHttp\Client(); |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | $url = getenv("HOST_URL"); |
51 | 51 | $port = getenv("HOST_PORT"); |
52 | 52 | $protocol = getenv("HOST_PROTOCOL"); |
53 | - $request=$request->withHeader('X-Forwarded-Host', $url.':'.$port); |
|
54 | - $request=$request->withHeader('X-Forwarded-Proto', $protocol); |
|
53 | + $request=$request->withHeader('X-Forwarded-Host', $url.':'.$port); |
|
54 | + $request=$request->withHeader('X-Forwarded-Proto', $protocol); |
|
55 | 55 | $response=$next($request, $response); |
56 | 56 | |
57 | 57 | return $response; |
58 | 58 | }) -> to(TUS_SERVER); |
59 | - //error_log(print_r($response, true)); |
|
59 | + //error_log(print_r($response, true)); |
|
60 | 60 | // Output response to the browser. |
61 | 61 | (new Narrowspark\HttpEmitter\SapiEmitter)->emit($response); |
62 | 62 |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | $linkpdo=Session::getLinkpdo(); |
29 | 29 | |
30 | 30 | $userObject=new User($_SESSION['username'], $linkpdo); |
31 | -$roleAllowed = $userObject->isRoleAllowed($_SESSION['study'], User::INVESTIGATOR); |
|
31 | +$roleAllowed=$userObject->isRoleAllowed($_SESSION['study'], User::INVESTIGATOR); |
|
32 | 32 | |
33 | -if ($roleAllowed ) { |
|
33 | +if ($roleAllowed) { |
|
34 | 34 | |
35 | 35 | unset($_GET['page']); |
36 | 36 | // Create a PSR7 request based on the current browser request. |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | |
48 | 48 | // Forward the request and get the response. |
49 | 49 | $response=$proxy -> forward($request) -> filter(function($request, $response, $next) { |
50 | - $url = getenv("HOST_URL"); |
|
51 | - $port = getenv("HOST_PORT"); |
|
52 | - $protocol = getenv("HOST_PROTOCOL"); |
|
50 | + $url=getenv("HOST_URL"); |
|
51 | + $port=getenv("HOST_PORT"); |
|
52 | + $protocol=getenv("HOST_PROTOCOL"); |
|
53 | 53 | $request=$request->withHeader('X-Forwarded-Host', $url.':'.$port); |
54 | 54 | $request=$request->withHeader('X-Forwarded-Proto', $protocol); |
55 | 55 | $response=$next($request, $response); |
@@ -18,10 +18,11 @@ discard block |
||
18 | 18 | * @param Patient $patient |
19 | 19 | */ |
20 | 20 | function build_patient_visit_table(Patient $patient, String $role) { |
21 | - if ($patient->patientWithdraw) |
|
22 | - $patientStatus="Withdrawn"; |
|
23 | - else |
|
24 | - $patientStatus="Included"; |
|
21 | + if ($patient->patientWithdraw) { |
|
22 | + $patientStatus="Withdrawn"; |
|
23 | + } else { |
|
24 | + $patientStatus="Included"; |
|
25 | + } |
|
25 | 26 | |
26 | 27 | $patientCenter=$patient->getPatientCenter(); |
27 | 28 | ?> |
@@ -97,7 +98,9 @@ discard block |
||
97 | 98 | foreach ($visitObjects as $visitObject) { |
98 | 99 | $numberOfSeries=count($visitObject->getSeriesOrthancID()); |
99 | 100 | |
100 | - if ($numberOfSeries == 0) $numberOfSeries="Not Uploaded"; |
|
101 | + if ($numberOfSeries == 0) { |
|
102 | + $numberOfSeries="Not Uploaded"; |
|
103 | + } |
|
101 | 104 | ?> |
102 | 105 | <tr> |
103 | 106 | <td><?=$visitObject->visitGroupObject->groupModality?></td> |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | function replaceEmpty($data) { |
233 | 233 | if (empty($data)) { |
234 | 234 | return ('/'); |
235 | - }else { |
|
235 | + } else { |
|
236 | 236 | return (htmlspecialchars($data)); |
237 | 237 | } |
238 | 238 | } |
@@ -246,7 +246,9 @@ discard block |
||
246 | 246 | |
247 | 247 | $series_number=count($data_series); |
248 | 248 | |
249 | - if ($series_number == 0) return; |
|
249 | + if ($series_number == 0) { |
|
250 | + return; |
|
251 | + } |
|
250 | 252 | |
251 | 253 | $colspan=$series_number+1; |
252 | 254 | ?> |
@@ -271,8 +273,8 @@ discard block |
||
271 | 273 | <td>Series Number</td> |
272 | 274 | <?php |
273 | 275 | for ($i=0; $i < $series_number; $i++) { |
274 | - if (empty($data_series[$i]->seriesNumber)) |
|
275 | - ?> |
|
276 | + if (empty($data_series[$i]->seriesNumber)) { |
|
277 | + ?> |
|
276 | 278 | <td> |
277 | 279 | <?=replaceEmpty($data_series[$i]->seriesNumber)?> |
278 | 280 | </td> |
@@ -282,7 +284,9 @@ discard block |
||
282 | 284 | <tr> |
283 | 285 | <td>Manufacturer</td> |
284 | 286 | <?php |
285 | - for ($i=0; $i < $series_number; $i++) { |
|
287 | + for ($i=0; |
|
288 | + } |
|
289 | + $i < $series_number; $i++) { |
|
286 | 290 | ?> |
287 | 291 | <td> |
288 | 292 | <?=replaceEmpty($data_series[$i]->manufacturer)?> |
@@ -334,7 +338,7 @@ discard block |
||
334 | 338 | <td> |
335 | 339 | <?php if (empty($data_series[$i]->injectedDose)) { |
336 | 340 | echo('/'); |
337 | - }else { |
|
341 | + } else { |
|
338 | 342 | echo(htmlspecialchars($data_series[$i]->injectedDose/10 ** 6)); |
339 | 343 | } |
340 | 344 | ?> |
@@ -375,7 +379,7 @@ discard block |
||
375 | 379 | <td> |
376 | 380 | <?php if (empty($data_series[$i]->injectedActivity)) { |
377 | 381 | echo('/'); |
378 | - }else { |
|
382 | + } else { |
|
379 | 383 | echo(htmlspecialchars($data_series[$i]->injectedActivity/10 ** 6)); |
380 | 384 | } |
381 | 385 | ?> |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $studyName=$_POST['studyName']; |
43 | 43 | $visitsGroupArray=$_POST['visitsData']; |
44 | 44 | $patientCodePrefix=$_POST['patientCodePrefix']; |
45 | - if(empty($patientCodePrefix)) $patientCodePrefix = null; |
|
45 | + if (empty($patientCodePrefix)) $patientCodePrefix=null; |
|
46 | 46 | //Add the new study as an active study |
47 | 47 | Study::createStudy($studyName, $patientCodePrefix, $linkpdo); |
48 | 48 |
@@ -35,14 +35,16 @@ discard block |
||
35 | 35 | |
36 | 36 | } |
37 | 37 | |
38 | -}else if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
|
38 | +} else if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
|
39 | 39 | |
40 | 40 | if ($_SESSION['admin']) { |
41 | 41 | |
42 | 42 | $studyName=$_POST['studyName']; |
43 | 43 | $visitsGroupArray=$_POST['visitsData']; |
44 | 44 | $patientCodePrefix=$_POST['patientCodePrefix']; |
45 | - if(empty($patientCodePrefix)) $patientCodePrefix = null; |
|
45 | + if(empty($patientCodePrefix)) { |
|
46 | + $patientCodePrefix = null; |
|
47 | + } |
|
46 | 48 | //Add the new study as an active study |
47 | 49 | Study::createStudy($studyName, $patientCodePrefix, $linkpdo); |
48 | 50 | |
@@ -100,12 +102,12 @@ discard block |
||
100 | 102 | |
101 | 103 | echo(json_encode(true)); |
102 | 104 | |
103 | - }else { |
|
105 | + } else { |
|
104 | 106 | echo(json_encode(false)); |
105 | 107 | } |
106 | 108 | |
107 | 109 | |
108 | 110 | |
109 | -}else if ($_SERVER['REQUEST_METHOD'] === 'PUT') { |
|
111 | +} else if ($_SERVER['REQUEST_METHOD'] === 'PUT') { |
|
110 | 112 | |
111 | 113 | } |
112 | 114 | \ No newline at end of file |
@@ -43,11 +43,11 @@ |
||
43 | 43 | try{ |
44 | 44 | $formProcessor->storeAssociatedFile($fileKey, $fileMime, $fileSize, $tempFileLocation); |
45 | 45 | header('HTTP/1.0 200 OK'); |
46 | - }catch (Throwable $t){ |
|
46 | + } catch (Throwable $t){ |
|
47 | 47 | header('HTTP/1.0 400 Bad Request'); |
48 | 48 | } |
49 | 49 | |
50 | -}else { |
|
50 | +} else { |
|
51 | 51 | header('HTTP/1.0 403 Forbidden'); |
52 | 52 | die('You are not allowed to access this file.'); |
53 | 53 | } |
54 | 54 | \ No newline at end of file |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $visitObject=new Visit($visitId, $linkpdo); |
25 | 25 | $accessCheck=$userObject->isVisitAllowed($visitId, User::REVIEWER); |
26 | 26 | |
27 | -if ( $accessCheck ) { |
|
27 | +if ($accessCheck) { |
|
28 | 28 | $formProcessor=$visitObject->getFromProcessor(false, $username); |
29 | 29 | |
30 | 30 | if (!$formProcessor instanceof Form_Processor_File) { |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | $fileMime=$_FILES['files']['type']; |
37 | 37 | $tempFileLocation=$_FILES['files']['tmp_name']; |
38 | 38 | $fileSize=$_FILES['files']['size']; |
39 | - try{ |
|
39 | + try { |
|
40 | 40 | $formProcessor->storeAssociatedFile($fileKey, $fileMime, $fileSize, $tempFileLocation); |
41 | 41 | header('HTTP/1.0 200 OK'); |
42 | - }catch (Throwable $t){ |
|
42 | + }catch (Throwable $t) { |
|
43 | 43 | header('HTTP/1.0 400 Bad Request'); |
44 | 44 | } |
45 | 45 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $visitObject=new Visit($idVisit, $linkpdo); |
27 | 27 | $accessCheck=$userObject->isRoleAllowed($visitObject->study, User::REVIEWER); |
28 | 28 | |
29 | -if ( $accessCheck ) { |
|
29 | +if ($accessCheck) { |
|
30 | 30 | |
31 | 31 | $reviewObject=$visitObject->queryExistingReviewForReviewer($username); |
32 | 32 |
@@ -45,11 +45,11 @@ |
||
45 | 45 | flush(); |
46 | 46 | } |
47 | 47 | fclose($file); |
48 | - }else { |
|
48 | + } else { |
|
49 | 49 | throw new Exception("Can't Find Attached File"); |
50 | 50 | } |
51 | 51 | |
52 | -}else { |
|
52 | +} else { |
|
53 | 53 | header('HTTP/1.0 403 Forbidden'); |
54 | 54 | die('You are not allowed to access this file.'); |
55 | 55 | } |
56 | 56 | \ No newline at end of file |