@@ -28,6 +28,6 @@ |
||
28 | 28 | |
29 | 29 | require 'views/main_view.php'; |
30 | 30 | |
31 | -}else { |
|
31 | +} else { |
|
32 | 32 | require 'includes/no_access.php'; |
33 | 33 | } |
34 | 34 | \ No newline at end of file |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | //Instanciate Visit manager to check if visit creation is still possible |
34 | 34 | try { |
35 | 35 | $patientObject=new Patient($patient, $linkpdo); |
36 | - }catch (Exception $e) { |
|
36 | + } catch (Exception $e) { |
|
37 | 37 | exit("No Patient Found"); |
38 | 38 | } |
39 | 39 | $visitPossible=$patientObject->isMissingVisit(); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | require 'views/investigator/patient_interface_view.php'; |
44 | 44 | |
45 | 45 | |
46 | -}else { |
|
46 | +} else { |
|
47 | 47 | require 'includes/no_access.php'; |
48 | 48 | } |
49 | 49 |
@@ -29,6 +29,6 @@ |
||
29 | 29 | $documentationObjects=$studyObject->getDocumentation($_SESSION['role']); |
30 | 30 | require 'views/investigator/documentation_view.php'; |
31 | 31 | |
32 | -}else { |
|
32 | +} else { |
|
33 | 33 | require 'includes/no_access.php'; |
34 | 34 | } |
@@ -43,16 +43,16 @@ |
||
43 | 43 | $emailObject->sendUnlockRequestMessage($_SESSION['role'], $username, $type_visit, $patient_num, $study, $request); |
44 | 44 | |
45 | 45 | $answer="Success"; |
46 | - }else { |
|
46 | + } else { |
|
47 | 47 | $answer="Missing Reason"; |
48 | 48 | } |
49 | 49 | |
50 | 50 | echo(json_encode($answer)); |
51 | 51 | |
52 | - }else { |
|
52 | + } else { |
|
53 | 53 | require 'views/investigator/ask_unlock_view.php'; |
54 | 54 | } |
55 | 55 | |
56 | -}else { |
|
56 | +} else { |
|
57 | 57 | require 'includes/no_access.php'; |
58 | 58 | } |
@@ -37,6 +37,6 @@ |
||
37 | 37 | |
38 | 38 | require 'views/investigator/new_visit_view.php'; |
39 | 39 | |
40 | -}else { |
|
40 | +} else { |
|
41 | 41 | require 'includes/no_access.php'; |
42 | 42 | } |
@@ -35,6 +35,6 @@ |
||
35 | 35 | |
36 | 36 | require 'views/investigator/root_investigator_view.php'; |
37 | 37 | |
38 | -}else { |
|
38 | +} else { |
|
39 | 39 | require 'includes/no_access.php'; |
40 | 40 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | if ($role != User::ADMINISTRATOR) { |
45 | 45 | $sendEmail->addGroupEmails($_SESSION['study'], $role); |
46 | - }else { |
|
46 | + } else { |
|
47 | 47 | $sendEmail->addAminEmails(); |
48 | 48 | } |
49 | 49 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | echo(json_encode(true)); |
68 | 68 | |
69 | - }else if (!empty($_SESSION['study'])) { |
|
69 | + } else if (!empty($_SESSION['study'])) { |
|
70 | 70 | |
71 | 71 | //list all users having a role a in the study |
72 | 72 | $studyObject=new Study($_SESSION['study'], $linkpdo); |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | require 'views/messenger_view.php'; |
81 | 81 | |
82 | 82 | |
83 | - }else { |
|
83 | + } else { |
|
84 | 84 | require 'includes/no_access.php'; |
85 | 85 | } |
86 | 86 | |
87 | -}else { |
|
87 | +} else { |
|
88 | 88 | require 'includes/no_access.php'; |
89 | 89 | } |
90 | 90 | \ No newline at end of file |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | $answer="Success"; |
46 | 46 | |
47 | - }else { |
|
47 | + } else { |
|
48 | 48 | |
49 | 49 | //Get studies associated with account |
50 | 50 | $linkedStudy=$userObject->getAllStudiesWithRole(); |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | |
58 | 58 | } |
59 | 59 | |
60 | - }else { |
|
60 | + } else { |
|
61 | 61 | $answer="Unknown"; |
62 | 62 | } |
63 | 63 | |
64 | 64 | echo(json_encode($answer)); |
65 | 65 | |
66 | 66 | //not data sent, form display |
67 | -}else { |
|
67 | +} else { |
|
68 | 68 | require 'views/forgot_password_view.php'; |
69 | 69 | } |
@@ -17,7 +17,9 @@ discard block |
||
17 | 17 | * Display connexion form hand check access permission |
18 | 18 | */ |
19 | 19 | |
20 | -if (session_status() == PHP_SESSION_NONE) session_start(); |
|
20 | +if (session_status() == PHP_SESSION_NONE) { |
|
21 | + session_start(); |
|
22 | +} |
|
21 | 23 | |
22 | 24 | //If session already opened, redirect to main |
23 | 25 | if (isset($_SESSION['username'])) { |
@@ -42,7 +44,7 @@ discard block |
||
42 | 44 | $email->addAminEmails(); |
43 | 45 | $email->sendAdminLoggedAlertEmail($_POST['username'], $_SERVER['REMOTE_ADDR']); |
44 | 46 | |
45 | - }else { |
|
47 | + } else { |
|
46 | 48 | $_SESSION['admin']=false; |
47 | 49 | } |
48 | 50 | |
@@ -53,7 +55,7 @@ discard block |
||
53 | 55 | $result['result']="user"; |
54 | 56 | |
55 | 57 | //If not allowed, action depend on reason |
56 | - }else { |
|
58 | + } else { |
|
57 | 59 | //Case outdated password or unconfirmed status, open temp session to redirect to change password |
58 | 60 | if ($userObject->passwordCorrect && (!$userObject->passwordDateValide || $userObject->userStatus == "Unconfirmed")) { |
59 | 61 | //mot de passe non valide, on le change |
@@ -61,17 +63,17 @@ discard block |
||
61 | 63 | $result['result']="temporary"; |
62 | 64 | $result['isPasswordDateValid']=$userObject->passwordDateValide; |
63 | 65 | //case unactivated or blocked account |
64 | - }else if ($userObject->passwordCorrect && ($userObject->userStatus != null && $userObject->userStatus != "Activated")) { |
|
66 | + } else if ($userObject->passwordCorrect && ($userObject->userStatus != null && $userObject->userStatus != "Activated")) { |
|
65 | 67 | $result['result']=$userObject->userStatus; |
66 | 68 | //case non existing user |
67 | - }else if (!$userObject->isExistingUser) { |
|
69 | + } else if (!$userObject->isExistingUser) { |
|
68 | 70 | $result['result']="unknown"; |
69 | 71 | //Case wrong password |
70 | - }else { |
|
72 | + } else { |
|
71 | 73 | //if too much tentative, account blocked |
72 | 74 | if ($userObject->loginAttempt > 2) { |
73 | 75 | $result['result']="NowBlocked"; |
74 | - }else { |
|
76 | + } else { |
|
75 | 77 | $result['result']="WrongPassword"; |
76 | 78 | $result['attempt']=$userObject->loginAttempt; |
77 | 79 | } |
@@ -81,11 +83,11 @@ discard block |
||
81 | 83 | //Echo answer for Ajax |
82 | 84 | echo(json_encode($result)); |
83 | 85 | //No data sent, display the form and it's script |
84 | -}else { |
|
86 | +} else { |
|
85 | 87 | |
86 | 88 | try { |
87 | 89 | Session::getLinkpdo(); |
88 | - }catch (Exception $e) { |
|
90 | + } catch (Exception $e) { |
|
89 | 91 | error_log("Can't Connect DB"); |
90 | 92 | } |
91 | 93 |