|
4 | 4 | * Landing / Home page for the client portal
|
5 | 5 | */
|
6 | 6 |
|
7 |
| -header("Content-Security-Policy: default-src 'self' fonts.googleapis.com fonts.gstatic.com"); |
| 7 | +header("Content-Security-Policy: default-src 'self'"); |
8 | 8 |
|
9 | 9 | require_once '../config.php';
|
10 | 10 |
|
|
50 | 50 | $password = $_POST['password'];
|
51 | 51 |
|
52 | 52 | if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
53 |
| - |
| 53 | + |
54 | 54 | header("HTTP/1.1 401 Unauthorized");
|
55 |
| - |
| 55 | + |
56 | 56 | $_SESSION['login_message'] = 'Invalid e-mail';
|
57 |
| - |
| 57 | + |
58 | 58 | } else {
|
59 |
| - |
| 59 | + |
60 | 60 | $sql = mysqli_query($mysqli, "SELECT * FROM users LEFT JOIN contacts ON user_id = contact_user_id WHERE user_email = '$email' AND user_archived_at IS NULL AND user_type = 2 AND user_status = 1 LIMIT 1");
|
61 | 61 | $row = mysqli_fetch_array($sql);
|
62 | 62 | $client_id = intval($row['contact_client_id']);
|
|
82 | 82 | logAction("Client Login", "Success", "Client contact $user_email successfully logged in locally", $client_id, $user_id);
|
83 | 83 |
|
84 | 84 | } else {
|
85 |
| - |
| 85 | + |
86 | 86 | // Logging
|
87 | 87 | logAction("Client Login", "Failed", "Failed client portal login attempt using $email (incorrect password for contact ID $contact_id)", $client_id, $user_id);
|
88 | 88 |
|
|
92 | 92 | }
|
93 | 93 |
|
94 | 94 | } else {
|
95 |
| - |
| 95 | + |
96 | 96 | // Logging
|
97 | 97 | logAction("Client Login", "Failed", "Failed client portal login attempt using $email (invalid email/not allowed local auth)");
|
98 |
| - |
| 98 | + |
99 | 99 | header("HTTP/1.1 401 Unauthorized");
|
100 |
| - |
| 100 | + |
101 | 101 | $_SESSION['login_message'] = 'Incorrect username or password.';
|
102 |
| - |
| 102 | + |
103 | 103 | }
|
104 | 104 | }
|
105 | 105 | }
|
|
127 | 127 | <!-- Theme style -->
|
128 | 128 | <link rel="stylesheet" href="../dist/css/adminlte.min.css">
|
129 | 129 |
|
130 |
| - <!-- Google Font: Source Sans Pro --> |
131 |
| - <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet"> |
132 | 130 | </head>
|
133 | 131 |
|
134 | 132 | <body class="hold-transition login-page">
|
|
0 commit comments