Completed
Pull Request — master (#140)
by Christopher
03:07 queued 55s
created
src/classes/Controller/JobController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
         }
20 20
 
21 21
         $client = new Client();
22
-        $url = $site->getUrl()['base'].$this->router->pathFor('home').'old/cr_daily.php';
22
+        $url = $site->getUrl()['base'] . $this->router->pathFor('home') . 'old/cr_daily.php';
23 23
         $guzzleResponse = $client->get($url, [
24 24
             'query' => [
25 25
                 'token' => $args['token'],
Please login to merge, or discard this patch.
src/classes/Controller/NotificationController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 {
12 12
     public function getNotificationClick(ServerRequestInterface $request, ResponseInterface $response, $args)
13 13
     {
14
-        $this->logger->info("Fetch settings GET '/notification/".$args['id']."'");
14
+        $this->logger->info("Fetch settings GET '/notification/" . $args['id'] . "'");
15 15
 
16 16
         $n = NotificationQuery::create()->findPk($args['id']);
17 17
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
                 return $response->withStatus(302)->withHeader('Location', $this->router->pathFor($link['route'], $link['attributes']));
37 37
             } else {
38
-                return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home').$n->getLink());
38
+                return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home') . $n->getLink());
39 39
             }
40 40
         }
41 41
 
Please login to merge, or discard this patch.
public/old/statistics.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -139,12 +139,12 @@
 block discarded – undo
139 139
     		<tbody>
140 140
     		<?php
141 141
                 $sql = "SELECT s.date,s.detail1,s.detail2,s.detail3,s.type,trim(concat(u.firstName,' ',u.lastName)) AS name FROM statistics s INNER JOIN users u ON u.id = s.userid";
142
-          if (!isAdmin()) {
143
-              $sql .= 'WHERE u.ID=s.userID';
144
-              if (!$debug) {
145
-                  $sql .= " AND s.type = 'system'";
146
-              }
147
-          }
142
+            if (!isAdmin()) {
143
+                $sql .= 'WHERE u.ID=s.userID';
144
+                if (!$debug) {
145
+                    $sql .= " AND s.type = 'system'";
146
+                }
147
+            }
148 148
                 $sql .= ' ORDER BY date desc '.$limit;
149 149
                 $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
150 150
                 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     exit;
15 15
 }
16 16
 if (!isAdmin()) {
17
-    header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME']));
17
+    header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME']));
18 18
     exit;
19 19
 }
20 20
 
@@ -26,28 +26,28 @@  discard block
 block discarded – undo
26 26
     if ($method == 'truncate') {
27 27
         $sql = "CREATE TABLE tmp_system_statistics as SELECT * from statistics WHERE type='system'";
28 28
         if (!mysqli_query(db(), $sql)) {
29
-            die('Error: '.mysqli_error(db()));
29
+            die('Error: ' . mysqli_error(db()));
30 30
         }
31 31
 
32 32
         $sql = ('TRUNCATE TABLE statistics');
33 33
         if (!mysqli_query(db(), $sql)) {
34
-            die('Error: '.mysqli_error(db()));
34
+            die('Error: ' . mysqli_error(db()));
35 35
         }
36 36
 
37 37
         $sql = ('ALTER TABLE statistics  AUTO_INCREMENT = 50');
38 38
         if (!mysqli_query(db(), $sql)) {
39
-            die('Error: '.mysqli_error(db()));
39
+            die('Error: ' . mysqli_error(db()));
40 40
         }
41 41
 
42 42
         $sql = 'INSERT INTO statistics (userid,date,type,detail1,detail2,detail3,script) ';
43
-        $sql = $sql.'SELECT userid,date,type,detail1,detail2,detail3,script from tmp_system_statistics order by date';
43
+        $sql = $sql . 'SELECT userid,date,type,detail1,detail2,detail3,script from tmp_system_statistics order by date';
44 44
         if (!mysqli_query(db(), $sql)) {
45
-            die('Error: '.mysqli_error(db()));
45
+            die('Error: ' . mysqli_error(db()));
46 46
         }
47 47
 
48 48
         $sql = 'DROP TABLE tmp_system_statistics';
49 49
         if (!mysqli_query(db(), $sql)) {
50
-            die('Error: '.mysqli_error(db()));
50
+            die('Error: ' . mysqli_error(db()));
51 51
         }
52 52
 
53 53
         insertStatistics('system', __FILE__, 'statistics deleted');
@@ -103,22 +103,22 @@  discard block
 block discarded – undo
103 103
               <?php
104 104
 
105 105
                         $sql = 'SELECT VERSION( ) AS mysqli_version';
106
-            $result = mysqli_query(db(), $sql) or die('MySQL-Error: '.mysqli_error(db()));
106
+            $result = mysqli_query(db(), $sql) or die('MySQL-Error: ' . mysqli_error(db()));
107 107
             $dbv = mysqli_fetch_array($result, MYSQLI_ASSOC);
108 108
             $mysqli_version = $dbv['mysqli_version'];
109 109
 
110 110
             if (substr($mysqli_version, 0, 1) == 5) {
111
-                $sql = "SELECT getBrowserInfo(detail3) as browser,count(*) as count from statistics where detail1 like 'login%' and detail3!='' group by getBrowserInfo(detail3) order by count desc ".$browserLimit;
111
+                $sql = "SELECT getBrowserInfo(detail3) as browser,count(*) as count from statistics where detail1 like 'login%' and detail3!='' group by getBrowserInfo(detail3) order by count desc " . $browserLimit;
112 112
             } else {
113
-                $sql = "SELECT detail3 as browser,count(*) as count from statistics where detail1 like 'login%' and detail3!='' group by detail3 order by count desc ".$browserLimit;
113
+                $sql = "SELECT detail3 as browser,count(*) as count from statistics where detail1 like 'login%' and detail3!='' group by detail3 order by count desc " . $browserLimit;
114 114
             }
115 115
 
116 116
             $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
117 117
             while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
118 118
                 extract($row);
119 119
                 echo '<tr>';
120
-                echo '<td>'.$browser.'</td>';
121
-                echo '<td>'.$count.'</td>';
120
+                echo '<td>' . $browser . '</td>';
121
+                echo '<td>' . $count . '</td>';
122 122
                 echo '</tr>';
123 123
             } ?>
124 124
 
@@ -145,16 +145,16 @@  discard block
 block discarded – undo
145 145
                   $sql .= " AND s.type = 'system'";
146 146
               }
147 147
           }
148
-                $sql .= ' ORDER BY date desc '.$limit;
148
+                $sql .= ' ORDER BY date desc ' . $limit;
149 149
                 $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
150 150
                 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
151 151
                     extract($row);
152 152
                     echo '<tr>';
153
-                    echo '<td>'.$date.'</td>';
154
-                    echo '<td>'.$name.'</td>';
155
-                    echo '<td>'.$type.'</td>';
156
-                    echo '<td>'.$detail1.'</td>';
157
-                    echo '<td>'.$detail2.'</td>';
153
+                    echo '<td>' . $date . '</td>';
154
+                    echo '<td>' . $name . '</td>';
155
+                    echo '<td>' . $type . '</td>';
156
+                    echo '<td>' . $detail1 . '</td>';
157
+                    echo '<td>' . $detail2 . '</td>';
158 158
                     //echo "<td>".$detail3."</td>";
159 159
                     echo '</tr>';
160 160
                 }
Please login to merge, or discard this patch.
public/old/tableView.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 									 FROM eventTypes et
112 112
 									 WHERE id IN (SELECT e.type
113 113
 										 						FROM events e
114
-																WHERE '.$whereTwoMonth.'
114
+																WHERE '.$whereTwoMonth . '
115 115
 																AND e.removed = 0)
116 116
 									 ORDER BY name';
117 117
         $result = mysqli_query(db(), $filter_sql) or die(mysqli_error(db()));
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 <tr>
133 133
 	<td ><strong>Event</strong></td>
134 134
 	<?php
135
-    $sql = 'SELECT * FROM groups g ORDER BY '.$group_sorting_name;
135
+    $sql = 'SELECT * FROM groups g ORDER BY ' . $group_sorting_name;
136 136
     $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
137 137
 
138 138
     while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
     if ($filter == '') {
164 164
         $sql .= '
165
-							AND '.$whereTwoMonth.'
165
+							AND '.$whereTwoMonth . '
166 166
 						ORDER BY
167 167
 							e.date';
168 168
     } elseif ($filter == 'all') {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     } elseif ($filter != '') {
173 173
         $sql .= "
174 174
 							AND e.type = '$filter'
175
-							AND ".$whereTwoMonth.'
175
+							AND " . $whereTwoMonth . '
176 176
 						ORDER BY
177 177
 							e.date';
178 178
     }
@@ -186,31 +186,31 @@  discard block
 block discarded – undo
186 186
         echo '<tr>';
187 187
         echo '<td >';
188 188
         setlocale(LC_TIME, $lang_locale); //de_DE
189
-        echo '<a href="event.php?id='.$row['id'].'">';
189
+        echo '<a href="event.php?id=' . $row['id'] . '">';
190 190
         echo strftime($time_format_short, strtotime($row['sundayDate'])); // %a, <strong>%e. %b</strong>, KW%V
191 191
         echo '</a>';
192 192
 
193 193
         //$row['sundayDate']
194 194
         if (!empty($row['eventType'])) {
195
-            echo '<br /><em>&nbsp;&nbsp;&nbsp;'.$row['eventType'].'</em>';
195
+            echo '<br /><em>&nbsp;&nbsp;&nbsp;' . $row['eventType'] . '</em>';
196 196
         }
197 197
         if (!empty($row['eventSubType'])) {
198
-            echo ' - <em>'.$row['eventSubType'].'</em>';
198
+            echo ' - <em>' . $row['eventSubType'] . '</em>';
199 199
         }
200 200
         if (!empty($row['eventLocation'])) {
201
-            echo '<br /><em>&nbsp;&nbsp;&nbsp;'.$row['eventLocation'].'</em>';
201
+            echo '<br /><em>&nbsp;&nbsp;&nbsp;' . $row['eventLocation'] . '</em>';
202 202
         }
203 203
         if (!empty($row['name'])) {
204
-            echo '<br /><em>&nbsp;&nbsp;&nbsp;'.$row['name'].'</em>';
204
+            echo '<br /><em>&nbsp;&nbsp;&nbsp;' . $row['name'] . '</em>';
205 205
         }
206 206
         if (!empty($row['eventGroup'])) {
207
-            echo '<br /><strong>&nbsp;&nbsp;&nbsp;'.$row['eventGroup'].'</strong>';
207
+            echo '<br /><strong>&nbsp;&nbsp;&nbsp;' . $row['eventGroup'] . '</strong>';
208 208
         }
209 209
         if (!empty($row['sermonTitle'])) {
210
-            echo ': '.$row['sermonTitle'];
210
+            echo ': ' . $row['sermonTitle'];
211 211
         }
212 212
         if (!empty($row['bibleVerse'])) {
213
-            echo ' <em>('.$row['bibleVerse'].')</em>';
213
+            echo ' <em>(' . $row['bibleVerse'] . ')</em>';
214 214
         }
215 215
         echo '</td>';
216 216
 
@@ -242,16 +242,16 @@  discard block
 block discarded – undo
242 242
                     if ($previousName == '') {
243 243
                         // new name
244 244
                         echo ($viewPeople['userId'] == $sessionUserId) ? '<strong class="me">' : '';
245
-                        echo $name.' <em>('.$viewPeople['role'];
245
+                        echo $name . ' <em>(' . $viewPeople['role'];
246 246
                     } elseif ($previousName != $name) {
247 247
                         echo ')</em>';
248 248
                         echo ($viewPeople['userId'] != $sessionUserId) ? '</strong>' : '';
249 249
                         echo '<br />'; // line break from previous name
250 250
                         // new name
251 251
                         echo ($viewPeople['userId'] == $sessionUserId) ? '<strong class="me">' : '';
252
-                        echo $name.' <em>('.$viewPeople['role'];
252
+                        echo $name . ' <em>(' . $viewPeople['role'];
253 253
                     } else {
254
-                        echo ', '.$viewPeople['role'];
254
+                        echo ', ' . $viewPeople['role'];
255 255
                     }
256 256
 
257 257
                     $peopleInEvent = true;
Please login to merge, or discard this patch.
public/old/roles.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     exit;
15 15
 }
16 16
 if (!isAdmin()) {
17
-    header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME']));
17
+    header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME']));
18 18
     exit;
19 19
 }
20 20
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 if ($role && $assignTo) {
35 35
     $sql = "UPDATE roles r SET r.groupId = '$assignTo' WHERE r.id = '$role'";
36 36
     if (!mysqli_query(db(), $sql)) {
37
-        die('Error: '.mysqli_error(db()));
37
+        die('Error: ' . mysqli_error(db()));
38 38
     }
39 39
     header('Location: roles.php');
40 40
     exit;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $sql = "INSERT INTO roles (name, description, rehersalId, groupId)
71 71
             VALUES ('$newrole', '$newrole', $rehersal, $groupId)";
72 72
         if (!mysqli_query(db(), $sql)) {
73
-            die('Error: '.mysqli_error(db()));
73
+            die('Error: ' . mysqli_error(db()));
74 74
         }
75 75
     } else {
76 76
         // Handle renaming of the roles
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
     $i = 1;
104 104
     while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
105 105
         if ($type == 'option') {
106
-            $list = $list."<option value='".$row['id']."'>".$row['name'].'</option>';
106
+            $list = $list . "<option value='" . $row['id'] . "'>" . $row['name'] . '</option>';
107 107
         } elseif ($type == 'li') {
108
-            $list = $list.'<li>'.$row['name'].'</li>';
108
+            $list = $list . '<li>' . $row['name'] . '</li>';
109 109
         } elseif ($type == 'li-a') {
110
-            $list = $list."<li><a href='roles.php?role=".$roleId.'&assignto='.$row['id']."'>".$row['name'].'</a></li>';
110
+            $list = $list . "<li><a href='roles.php?role=" . $roleId . '&assignto=' . $row['id'] . "'>" . $row['name'] . '</a></li>';
111 111
         }
112 112
         $i++;
113 113
     }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             $group = $row['groupId'];
174 174
             $down = $group + 1;
175 175
             $up = $group - 1;
176
-            echo '<div><strong>'.$groupname.'</strong><br />';
176
+            echo '<div><strong>' . $groupname . '</strong><br />';
177 177
         }
178 178
         // Print text input box if a role exists for the group.
179 179
         // Allows user to update role names and move roles between groups
Please login to merge, or discard this patch.
public/old/emails.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     exit;
36 36
 }
37 37
 if (!isAdmin()) {
38
-    header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME']));
38
+    header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME']));
39 39
     exit;
40 40
 }
41 41
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     if ($editskillID != '') {
72 72
         $sql = ("INSERT INTO eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')");
73 73
         if (!mysqli_query(db(), $sql)) {
74
-            die('Error: '.mysqli_error(db()));
74
+            die('Error: ' . mysqli_error(db()));
75 75
         }
76 76
 
77 77
         // After we have inserted the data, we want to head back to the main page
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
             $sql = ("INSERT INTO eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')");
90 90
             if (!mysqli_query(db(), $sql)) {
91
-                die('Error: '.mysqli_error(db()));
91
+                die('Error: ' . mysqli_error(db()));
92 92
             }
93 93
         }
94 94
 
Please login to merge, or discard this patch.
public/old/includes/header.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 							<!-- Menu toggle button -->
295 295
 							<a href="#" class="dropdown-toggle" data-toggle="dropdown">
296 296
 								<i class="fa fa-bell-o"></i>
297
-								<?php echo $unseen >= 1 ? '<span class="label label-warning">'.$unseen.'</span>' : '' ?>
297
+								<?php echo $unseen >= 1 ? '<span class="label label-warning">' . $unseen . '</span>' : '' ?>
298 298
 							</a>
299 299
 							<ul class="dropdown-menu">
300 300
 								<li class="header">You have <?php echo $unseen >= 1 ? $unseen : 'no' ?> new notifications</li>
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 									<?php foreach ($notifications as $n): ?>
305 305
 										<li><!-- start notification -->
306 306
 											<a href="notification.php?click=notifications-panel&id=<?php echo $n->id ?>">
307
-												<i class="fa fa-users text-aqua"></i> <?php echo $n->seen ? $n->summary : '<strong>'.$n->summary.'</strong>' ?>
307
+												<i class="fa fa-users text-aqua"></i> <?php echo $n->seen ? $n->summary : '<strong>' . $n->summary . '</strong>' ?>
308 308
 												<small><?php echo timeAgoInWords($n->timestamp) ?></small>
309 309
 											</a>
310 310
 										</li><!-- end notification -->
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 						<!-- User Account Menu -->
360 360
 						<li class="dropdown user user-menu">
361 361
 							<?php
362
-                            $sql = 'SELECT u.created FROM users u WHERE id = '.$_SESSION['userid'];
362
+                            $sql = 'SELECT u.created FROM users u WHERE id = ' . $_SESSION['userid'];
363 363
                                             $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
364 364
                                             $currentUser = mysqli_fetch_object($result);
365 365
                             ?>
Please login to merge, or discard this patch.
public/old/includes/functions.auth.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         $_SESSION['db_is_logged_in'] = true;
18 18
         $_SESSION['isAdmin'] = $row['isAdmin']; // Set the admin status to be carried across this session
19 19
         $_SESSION['userid'] = $row['id'];
20
-        $_SESSION['name'] = $row['firstName'].' '.$row['lastName'];
20
+        $_SESSION['name'] = $row['firstName'] . ' ' . $row['lastName'];
21 21
         $_SESSION['isBandAdmin'] = $row['isBandAdmin']; // Set the band admin status to be carried across this session
22 22
         $_SESSION['isEventEditor'] = $row['isEventEditor']; // Set the event editor status to be carried across this session
23 23
         $_SESSION['onlyShowUserEvents'] = $users_start_with_myevents; // 1 if users_start_with_myevents is set in settings, can be changed by user during session
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
 
30 30
         // admin section
31 31
         if ($_SESSION['isAdmin'] == 1) {
32
-            updateDatabase();                        //check for db updates
32
+            updateDatabase(); //check for db updates
33 33
             //$_SESSION['onlyShowUserEvents'] = '0';		//show all events for admin, regardless what settings say
34 34
         }
35 35
 
36 36
         // Update last login timestamp
37 37
         $currentTimestamp = date('Y-m-d H:i:s');
38
-        $sql = "UPDATE users SET lastLogin = '$currentTimestamp' WHERE id = '".$row['id']."'";
38
+        $sql = "UPDATE users SET lastLogin = '$currentTimestamp' WHERE id = '" . $row['id'] . "'";
39 39
         mysqli_query(db(), $sql) or die(mysqli_error(db()));
40 40
 
41 41
         // redirect
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
             $redirectFromSession = strip_tags($_SESSION['redirectUrl']);
45 45
             unset($_SESSION['redirectUrl']);
46 46
             // check is url is on same domain and prevents redirecting to logout page
47
-            if (strncmp(strtolower(siteSettings()->getSiteUrl().'/'), strtolower($redirectFromSession), (strlen(siteSettings()->getSiteUrl()) + 1)) == 0 && strpos($redirectFromSession, 'logout.php') === false) {
47
+            if (strncmp(strtolower(siteSettings()->getSiteUrl() . '/'), strtolower($redirectFromSession), (strlen(siteSettings()->getSiteUrl()) + 1)) == 0 && strpos($redirectFromSession, 'logout.php') === false) {
48 48
                 $redirectUrl = $redirectFromSession;
49 49
             }
50 50
         }
51
-        header('Location: '.$redirectUrl);
51
+        header('Location: ' . $redirectUrl);
52 52
         exit;
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
public/old/includes/functions.users.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     }
36 36
 
37 37
     // create username and remove all whitespace
38
-    $username = $firstNameLower.'.'.$lastNameLower;
38
+    $username = $firstNameLower . '.' . $lastNameLower;
39 39
     $username = preg_replace('/\s+/', '', $username);
40 40
 
41 41
     $sql = ("INSERT INTO users (firstName, lastName, username, email, mobile, password, created, updated)
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
     $id = mysqli_insert_id(db());
47 47
 
48 48
     $notificationMessage = "Welcome to your new account on the rota system.\n
49
-If you have any issues, please get in touch with us [".siteSettings()->getAdminEmailAddress().'](mailto:'.siteSettings()->getAdminEmailAddress().").\n
49
+If you have any issues, please get in touch with us [".siteSettings()->getAdminEmailAddress() . '](mailto:' . siteSettings()->getAdminEmailAddress() . ").\n
50 50
 ---\n
51 51
 **Sync to digital calendar**\n
52 52
 You may wish to link the rota to your digital calendar on your computer and phone.  To do so, generate a [calendar token](calendarTokens.php) which will present you with your unique URL.  Follow instructions from your digital calendar provider for exact details on how import an iCal feed, or get in touch and we may be able to help.\n";
53 53
 
54
-    createNotificationForUser($id, 'Welcome '.$firstName, $notificationMessage, 'feature');
54
+    createNotificationForUser($id, 'Welcome ' . $firstName, $notificationMessage, 'feature');
55 55
     createNotificationForUser($id, 'Change your password', 'Please change your password to something unique and memorable.', 'account', 'editPassword.php');
56 56
 
57 57
     return $id;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     $sql = "SELECT firstName, lastName FROM users WHERE id = '$id'";
146 146
     $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
147 147
     $ob = mysqli_fetch_object($result);
148
-    $name = $ob->firstName.' '.$ob->lastName;
148
+    $name = $ob->firstName . ' ' . $ob->lastName;
149 149
 
150 150
     return $name;
151 151
 }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     $currentTimestamp = date('Y-m-d H:i:s');
220 220
     $sql = "UPDATE users SET password = '$newPassword', passwordChanged = '$currentTimestamp' WHERE id = '$userId'";
221 221
     $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
222
-    insertStatistics('user', __FILE__, 'password force changed for user '.getNameWithId($userId), null, $_SERVER['HTTP_USER_AGENT']);
222
+    insertStatistics('user', __FILE__, 'password force changed for user ' . getNameWithId($userId), null, $_SERVER['HTTP_USER_AGENT']);
223 223
 }
224 224
 
225 225
 function hashPassword($plainTextPassword)
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
     if ($loginFailures < $numberOfAllowedAttempts) {
266 266
         return true;
267 267
     } else {
268
-        insertStatistics('user', __FILE__, 'Login attempts exceeded for username: '.$username, $ipAddress, $_SERVER['HTTP_USER_AGENT']);
268
+        insertStatistics('user', __FILE__, 'Login attempts exceeded for username: ' . $username, $ipAddress, $_SERVER['HTTP_USER_AGENT']);
269 269
 
270 270
         return false;
271 271
     }
@@ -341,11 +341,11 @@  discard block
 block discarded – undo
341 341
     $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
342 342
 
343 343
     $pendingId = mysqli_insert_id(db());
344
-    $linkToApprove = 'pendingAccounts.php?id='.$pendingId;
344
+    $linkToApprove = 'pendingAccounts.php?id=' . $pendingId;
345 345
 
346
-    $email = siteSettings()->getOwner().'<'.siteSettings()->getAdminEmailAddress().'>';
347
-    $subject = $firstName.' requested an account';
348
-    $message = $subject.' through '.$source.".\nApprove or decline: ".siteSettings()->getSiteUrl().'/'.$linkToApprove;
346
+    $email = siteSettings()->getOwner() . '<' . siteSettings()->getAdminEmailAddress() . '>';
347
+    $subject = $firstName . ' requested an account';
348
+    $message = $subject . ' through ' . $source . ".\nApprove or decline: " . siteSettings()->getSiteUrl() . '/' . $linkToApprove;
349 349
 
350 350
     sendMail($email, $subject, $message, $email);
351 351
 
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
     addSocialAuthToUserWithId($userId, $pendingUser->socialId, $pendingUser->source);
418 418
     updateUser($userId, $pendingUser->firstName, $pendingUser->lastName, $pendingUser->email, null);
419 419
 
420
-    createNotificationForUser($userId, 'Social Login added: '.$pendingUser->source, 'Your social media login details for '.$pendingUser->source.' have been added to your existing account', 'account');
420
+    createNotificationForUser($userId, 'Social Login added: ' . $pendingUser->source, 'Your social media login details for ' . $pendingUser->source . ' have been added to your existing account', 'account');
421 421
     createFacebookNotificationForUser($userId, 'login.php', 'Your account request has been approved. You can now login via Facebook.');
422 422
 
423 423
     return true;
@@ -500,32 +500,32 @@  discard block
 block discarded – undo
500 500
 
501 501
 function getProfileImageUrl($userId, $size = 'small')
502 502
 {
503
-    $sql = 'SELECT sa.socialId, u.email FROM users u LEFT JOIN socialAuth sa ON sa.userId = u.id WHERE id = '.$userId;
503
+    $sql = 'SELECT sa.socialId, u.email FROM users u LEFT JOIN socialAuth sa ON sa.userId = u.id WHERE id = ' . $userId;
504 504
     $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
505 505
     $user = mysqli_fetch_object($result);
506 506
 
507 507
     if ($user->socialId) {
508 508
         switch ($size) {
509 509
             case 'small': // 50px x 50px
510
-                return '//graph.facebook.com/'.$user->socialId.'/picture?type=square';
510
+                return '//graph.facebook.com/' . $user->socialId . '/picture?type=square';
511 511
                 break;
512 512
             case 'large': // 200px x 200px
513
-                return '//graph.facebook.com/'.$user->socialId.'/picture?type=large';
513
+                return '//graph.facebook.com/' . $user->socialId . '/picture?type=large';
514 514
                 break;
515 515
             default:
516
-                return '//graph.facebook.com/'.$user->socialId.'/picture';
516
+                return '//graph.facebook.com/' . $user->socialId . '/picture';
517 517
                 break;
518 518
         }
519 519
     } else {
520 520
         switch ($size) {
521 521
             case 'small': // 50px x 50px
522
-                return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=50&d=mm';
522
+                return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=50&d=mm';
523 523
                 break;
524 524
             case 'large': // 200px x 200px
525
-                return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=200&d=mm';
525
+                return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=200&d=mm';
526 526
                 break;
527 527
             default:
528
-                return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=50&d=mm';
528
+                return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=50&d=mm';
529 529
                 break;
530 530
         }
531 531
     }
Please login to merge, or discard this patch.