@@ -45,7 +45,7 @@ |
||
45 | 45 | The following error has occurred |
46 | 46 | <?php namespace TechWilk\Rota; |
47 | 47 | |
48 | -echo " on page '".$page."':<br><br>"; |
|
48 | +echo " on page '" . $page . "':<br><br>"; |
|
49 | 49 | echo '<strong>'; |
50 | 50 | |
51 | 51 | switch ($no) { |
@@ -2,6 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace TechWilk\Rota; |
4 | 4 | |
5 | -ini_set('display_errors', false); // set on for development, off for production |
|
5 | +ini_set('display_errors', false); // set on for development, off for production |
|
6 | 6 | ini_set('log_errors', true); |
7 | 7 | error_reporting(E_ALL); |
@@ -6,16 +6,16 @@ discard block |
||
6 | 6 | use Monolog\Handler\StreamHandler; |
7 | 7 | use Monolog\Logger; |
8 | 8 | |
9 | -include __DIR__.'/errors.php'; |
|
9 | +include __DIR__ . '/errors.php'; |
|
10 | 10 | |
11 | 11 | // setup the autoloading |
12 | -require_once dirname(__FILE__).'/../../../vendor/autoload.php'; |
|
12 | +require_once dirname(__FILE__) . '/../../../vendor/autoload.php'; |
|
13 | 13 | |
14 | 14 | // setup Propel |
15 | -require_once dirname(__FILE__).'/../../../generated-conf/config.php'; |
|
15 | +require_once dirname(__FILE__) . '/../../../generated-conf/config.php'; |
|
16 | 16 | |
17 | 17 | $defaultLogger = new Logger('defaultLogger'); |
18 | -$defaultLogger->pushHandler(new StreamHandler(__DIR__.'/../../../logs/propel.log', Logger::WARNING)); |
|
18 | +$defaultLogger->pushHandler(new StreamHandler(__DIR__ . '/../../../logs/propel.log', Logger::WARNING)); |
|
19 | 19 | |
20 | 20 | $serviceContainer->setLogger('defaultLogger', $defaultLogger); |
21 | 21 | |
@@ -64,18 +64,18 @@ discard block |
||
64 | 64 | return SettingsQuery::create()->findOne(); |
65 | 65 | } |
66 | 66 | |
67 | -include __DIR__.'/functions.auth.php'; |
|
68 | -include __DIR__.'/functions.notifications.php'; |
|
69 | -include __DIR__.'/functions.mail.php'; |
|
70 | -include __DIR__.'/functions.remove.php'; |
|
71 | -include __DIR__.'/functions.discussion.php'; |
|
72 | -include __DIR__.'/functions.event.php'; |
|
73 | -include __DIR__.'/functions.password.php'; |
|
74 | -include __DIR__.'/functions.users.php'; |
|
75 | -include __DIR__.'/functions.roles.php'; |
|
76 | -include __DIR__.'/functions.database.php'; |
|
77 | -include __DIR__.'/functions.calendars.php'; |
|
78 | -include __DIR__.'/functions.facebook.php'; |
|
67 | +include __DIR__ . '/functions.auth.php'; |
|
68 | +include __DIR__ . '/functions.notifications.php'; |
|
69 | +include __DIR__ . '/functions.mail.php'; |
|
70 | +include __DIR__ . '/functions.remove.php'; |
|
71 | +include __DIR__ . '/functions.discussion.php'; |
|
72 | +include __DIR__ . '/functions.event.php'; |
|
73 | +include __DIR__ . '/functions.password.php'; |
|
74 | +include __DIR__ . '/functions.users.php'; |
|
75 | +include __DIR__ . '/functions.roles.php'; |
|
76 | +include __DIR__ . '/functions.database.php'; |
|
77 | +include __DIR__ . '/functions.calendars.php'; |
|
78 | +include __DIR__ . '/functions.facebook.php'; |
|
79 | 79 | |
80 | 80 | date_default_timezone_set(siteSettings()->getTimeZone()); |
81 | 81 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $stat_id = $_SESSION['login_statistic_id']; |
176 | 176 | if (($stat_id != '') && ($stat_id != '0')) { |
177 | 177 | $stat = StatisticQuery::create()->findPk($stat_id); |
178 | - $stat->setDetail1($stat->getDetail1().'/'.$detail1); |
|
178 | + $stat->setDetail1($stat->getDetail1() . '/' . $detail1); |
|
179 | 179 | $stat->setDetail2($stat->getDate()->diff(new DateTime())); |
180 | 180 | $stat->save(); |
181 | 181 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | return 'never'; |
209 | 209 | } |
210 | 210 | |
211 | - return timeInWords($time).' ago'; |
|
211 | + return timeInWords($time) . ' ago'; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | function timeInWordsWithTense($time) |
@@ -222,9 +222,9 @@ discard block |
||
222 | 222 | } |
223 | 223 | |
224 | 224 | if ($time->getTimestamp() > (new DateTime())->getTimestamp()) { |
225 | - return 'in '.timeInWords($time); |
|
225 | + return 'in ' . timeInWords($time); |
|
226 | 226 | } else { |
227 | - return timeInWords($time).' ago'; |
|
227 | + return timeInWords($time) . ' ago'; |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 |
@@ -2,10 +2,10 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace TechWilk\Rota; |
4 | 4 | |
5 | -include __DIR__.'/../../../config/database.php'; |
|
6 | -include __DIR__.'/../../../config/auth.php'; |
|
7 | -include __DIR__.'/../../../config/email.php'; |
|
8 | -include __DIR__.'/../../../config/recording.php'; |
|
5 | +include __DIR__ . '/../../../config/database.php'; |
|
6 | +include __DIR__ . '/../../../config/auth.php'; |
|
7 | +include __DIR__ . '/../../../config/email.php'; |
|
8 | +include __DIR__ . '/../../../config/recording.php'; |
|
9 | 9 | |
10 | 10 | // -- Setup database -- |
11 | 11 | |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | // Connect to the database server |
20 | -$dbh = @mysqli_connect($config['db']['host'], $config['db']['user'], $config['db']['pass']) or die('Connection to '.$config['db']['host']." with login '".$config['db']['user']."'/'$pwdMasked' failed."); |
|
20 | +$dbh = @mysqli_connect($config['db']['host'], $config['db']['user'], $config['db']['pass']) or die('Connection to ' . $config['db']['host'] . " with login '" . $config['db']['user'] . "'/'$pwdMasked' failed."); |
|
21 | 21 | |
22 | 22 | // Choose the right database |
23 | -$db = @mysqli_select_db($dbh, $config['db']['dbname']) or die("Connection made, but database '".$config['db']['dbname']."' was not found."); |
|
23 | +$db = @mysqli_select_db($dbh, $config['db']['dbname']) or die("Connection made, but database '" . $config['db']['dbname'] . "' was not found."); |
|
24 | 24 | |
25 | 25 | // allow config to be fetched in functions |
26 | 26 |
@@ -35,7 +35,7 @@ discard block |
||
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 cr_users (firstName, lastName, username, email, mobile, password, created, updated) |
@@ -46,12 +46,12 @@ discard block |
||
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 |
||
145 | 145 | $sql = "SELECT firstName, lastName FROM cr_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 |
||
219 | 219 | $currentTimestamp = date('Y-m-d H:i:s'); |
220 | 220 | $sql = "UPDATE cr_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) |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | if ($loginFailures < $numberOfAllowedAttempts) { |
265 | 265 | return true; |
266 | 266 | } else { |
267 | - insertStatistics('user', __FILE__, 'Login attempts exceeded for username: '.$username, $ipAddress, $_SERVER['HTTP_USER_AGENT']); |
|
267 | + insertStatistics('user', __FILE__, 'Login attempts exceeded for username: ' . $username, $ipAddress, $_SERVER['HTTP_USER_AGENT']); |
|
268 | 268 | |
269 | 269 | return false; |
270 | 270 | } |
@@ -340,11 +340,11 @@ discard block |
||
340 | 340 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
341 | 341 | |
342 | 342 | $pendingId = mysqli_insert_id(db()); |
343 | - $linkToApprove = 'pendingAccounts.php?id='.$pendingId; |
|
343 | + $linkToApprove = 'pendingAccounts.php?id=' . $pendingId; |
|
344 | 344 | |
345 | - $email = siteSettings()->getOwner().'<'.siteSettings()->getAdminEmailAddress().'>'; |
|
346 | - $subject = $firstName.' requested an account'; |
|
347 | - $message = $subject.' through '.$source.".\nApprove or decline: ".siteSettings()->getSiteUrl().'/'.$linkToApprove; |
|
345 | + $email = siteSettings()->getOwner() . '<' . siteSettings()->getAdminEmailAddress() . '>'; |
|
346 | + $subject = $firstName . ' requested an account'; |
|
347 | + $message = $subject . ' through ' . $source . ".\nApprove or decline: " . siteSettings()->getSiteUrl() . '/' . $linkToApprove; |
|
348 | 348 | |
349 | 349 | sendMail($email, $subject, $message, $email); |
350 | 350 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | addSocialAuthToUserWithId($userId, $pendingUser->socialId, $pendingUser->source); |
417 | 417 | updateUser($userId, $pendingUser->firstName, $pendingUser->lastName, $pendingUser->email, null); |
418 | 418 | |
419 | - createNotificationForUser($userId, 'Social Login added: '.$pendingUser->source, 'Your social media login details for '.$pendingUser->source.' have been added to your existing account', 'account'); |
|
419 | + createNotificationForUser($userId, 'Social Login added: ' . $pendingUser->source, 'Your social media login details for ' . $pendingUser->source . ' have been added to your existing account', 'account'); |
|
420 | 420 | createFacebookNotificationForUser($userId, 'login.php', 'Your account request has been approved. You can now login via Facebook.'); |
421 | 421 | |
422 | 422 | return true; |
@@ -499,32 +499,32 @@ discard block |
||
499 | 499 | |
500 | 500 | function getProfileImageUrl($userId, $size = 'small') |
501 | 501 | { |
502 | - $sql = 'SELECT sa.socialId, u.email FROM cr_users u LEFT JOIN cr_socialAuth sa ON sa.userId = u.id WHERE id = '.$userId; |
|
502 | + $sql = 'SELECT sa.socialId, u.email FROM cr_users u LEFT JOIN cr_socialAuth sa ON sa.userId = u.id WHERE id = ' . $userId; |
|
503 | 503 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
504 | 504 | $user = mysqli_fetch_object($result); |
505 | 505 | |
506 | 506 | if ($user->socialId) { |
507 | 507 | switch ($size) { |
508 | 508 | case 'small': // 50px x 50px |
509 | - return '//graph.facebook.com/'.$user->socialId.'/picture?type=square'; |
|
509 | + return '//graph.facebook.com/' . $user->socialId . '/picture?type=square'; |
|
510 | 510 | break; |
511 | 511 | case 'large': // 200px x 200px |
512 | - return '//graph.facebook.com/'.$user->socialId.'/picture?type=large'; |
|
512 | + return '//graph.facebook.com/' . $user->socialId . '/picture?type=large'; |
|
513 | 513 | break; |
514 | 514 | default: |
515 | - return '//graph.facebook.com/'.$user->socialId.'/picture'; |
|
515 | + return '//graph.facebook.com/' . $user->socialId . '/picture'; |
|
516 | 516 | break; |
517 | 517 | } |
518 | 518 | } else { |
519 | 519 | switch ($size) { |
520 | 520 | case 'small': // 50px x 50px |
521 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=50&d=mm'; |
|
521 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=50&d=mm'; |
|
522 | 522 | break; |
523 | 523 | case 'large': // 200px x 200px |
524 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=200&d=mm'; |
|
524 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=200&d=mm'; |
|
525 | 525 | break; |
526 | 526 | default: |
527 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=50&d=mm'; |
|
527 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=50&d=mm'; |
|
528 | 528 | break; |
529 | 529 | } |
530 | 530 | } |
@@ -294,7 +294,7 @@ discard block |
||
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 |
||
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 |
||
359 | 359 | <!-- User Account Menu --> |
360 | 360 | <li class="dropdown user user-menu"> |
361 | 361 | <?php |
362 | - $sql = 'SELECT u.created FROM cr_users u WHERE id = '.$_SESSION['userid']; |
|
362 | + $sql = 'SELECT u.created FROM cr_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 | ?> |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | function executeDbSql($sql) |
27 | 27 | { |
28 | 28 | if (!mysqli_query(db(), $sql)) { |
29 | - die('Error: '.mysqli_error(db()).', SQL: '.$sql); |
|
29 | + die('Error: ' . mysqli_error(db()) . ', SQL: ' . $sql); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
33 | 33 | function updateDatabase() |
34 | 34 | { |
35 | 35 | $sql = 'SELECT VERSION( ) AS mysqli_version'; |
36 | - $result = mysqli_query(db(), $sql) or die('MySQL-Error: '.mysqli_error(db())); |
|
36 | + $result = mysqli_query(db(), $sql) or die('MySQL-Error: ' . mysqli_error(db())); |
|
37 | 37 | $dbv = mysqli_fetch_array($result, MYSQLI_ASSOC); |
38 | 38 | $mysqli_version = $dbv['mysqli_version']; |
39 | 39 | //echo $mysqli_version."<br>"; |
@@ -87,41 +87,41 @@ discard block |
||
87 | 87 | executeDbSql("alter table cr_users add(isOverviewRecipient char(2) NOT NULL DEFAULT '0')"); |
88 | 88 | executeDbSql('alter table cr_groups add(short_name char(2))'); |
89 | 89 | |
90 | - executeDbSql("update cr_settings set lang_locale = 'en_GB'"); // de_DE |
|
90 | + executeDbSql("update cr_settings set lang_locale = 'en_GB'"); // de_DE |
|
91 | 91 | executeDbSql('update cr_settings set event_sorting_latest = 0'); |
92 | 92 | executeDbSql('update cr_settings set snapshot_show_two_month = 0'); |
93 | 93 | executeDbSql('update cr_settings set snapshot_reduce_skills_by_group = 0'); |
94 | 94 | executeDbSql('update cr_settings set logged_in_show_snapshot_button = 0'); |
95 | 95 | executeDbSql("update cr_settings set time_format_long = '%A, %B %e @ %I:%M %p'"); // de_DE: %A, %e. %B %Y, %R Uhr, KW%V |
96 | 96 | executeDbSql("update cr_settings set time_format_normal = '%m/%d/%y %I:%M %p'"); // de_DE: %d.%m.%Y %H:%M |
97 | - executeDbSql("update cr_settings set time_format_short = '%a, <strong>%b %e</strong>, %I:%M %p'"); // de_DE: %a, <strong>%e. %b</strong>, KW%V |
|
97 | + executeDbSql("update cr_settings set time_format_short = '%a, <strong>%b %e</strong>, %I:%M %p'"); // de_DE: %a, <strong>%e. %b</strong>, KW%V |
|
98 | 98 | executeDbSql("update cr_settings set version = '2.1.0'"); |
99 | 99 | executeDbSql('update cr_settings set users_start_with_myevents = 0'); |
100 | 100 | executeDbSql("update cr_settings set time_zone = 'Europe/London'"); //de_DE: Europe/Berlin |
101 | 101 | executeDbSql("update cr_settings set google_group_calendar = ''"); |
102 | 102 | executeDbSql("update cr_settings set overviewemail = 'Hello,\r\n\r\nIn this email you find the Rota for [MONTH] [YEAR].\r\n\r\n[OVERVIEW]\r\n\r\nPlease inform us as soon as possible, if you are not able to serve as scheduled.\r\n\r\nBe blessed.\r\nChurch Support Stuff'"); |
103 | 103 | |
104 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.1.0', $_SESSION['userid']); |
|
104 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.1.0', $_SESSION['userid']); |
|
105 | 105 | case '2.1.0': |
106 | 106 | executeDbSql('create table cr_settings_bkp2_1_0 as select * from cr_settings'); |
107 | 107 | executeDbSql('alter table cr_settings add(group_sorting_name int(1))'); |
108 | 108 | executeDbSql("update cr_settings set version = '2.1.1'"); |
109 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.1.1', $_SESSION['userid']); |
|
109 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.1.1', $_SESSION['userid']); |
|
110 | 110 | case '2.1.1': |
111 | 111 | executeDbSql("update cr_settings set version = '2.1.2'"); |
112 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.1.2', $_SESSION['userid']); |
|
112 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.1.2', $_SESSION['userid']); |
|
113 | 113 | case '2.1.2': |
114 | 114 | executeDbSql("alter table cr_settings add(debug_mode int(1) DEFAULT '0')"); |
115 | - executeDbSql('update cr_settings set group_sorting_name = 0'); //was a workaround, fixed in V2.2.1 |
|
115 | + executeDbSql('update cr_settings set group_sorting_name = 0'); //was a workaround, fixed in V2.2.1 |
|
116 | 116 | |
117 | 117 | executeDbSql("update cr_settings set version = '2.2.0'"); |
118 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.2.0', $_SESSION['userid']); |
|
118 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.2.0', $_SESSION['userid']); |
|
119 | 119 | case '2.2.0': |
120 | 120 | executeDbSql("alter table cr_users add(isBandAdmin char(2) NOT NULL DEFAULT '0')"); |
121 | 121 | executeDbSql('update cr_settings set group_sorting_name = 0'); //due to an error reset it again |
122 | 122 | |
123 | 123 | executeDbSql("update cr_settings set version = '2.2.1'"); |
124 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.2.1', $_SESSION['userid']); |
|
124 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.2.1', $_SESSION['userid']); |
|
125 | 125 | case '2.2.1': |
126 | 126 | $sql = "CREATE TABLE IF NOT EXISTS `cr_statistics` ( |
127 | 127 | `id` int(11) NOT NULL AUTO_INCREMENT, |
@@ -137,21 +137,21 @@ discard block |
||
137 | 137 | executeDbSql($sql); |
138 | 138 | |
139 | 139 | executeDbSql("update cr_settings set version = '2.3.0'"); |
140 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.3.0', $_SESSION['userid']); |
|
140 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.0', $_SESSION['userid']); |
|
141 | 141 | insertStatistics('system', __FILE__, 'db-update', '2.3.0', $version); |
142 | 142 | case '2.3.0': |
143 | 143 | executeDbSql("alter table cr_users add(isEventEditor char(2) NOT NULL DEFAULT '0')"); |
144 | 144 | |
145 | 145 | executeDbSql("update cr_settings set version = '2.3.1'"); |
146 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.3.1', $_SESSION['userid']); |
|
146 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.1', $_SESSION['userid']); |
|
147 | 147 | insertStatistics('system', __FILE__, 'db-update', '2.3.1', $version); |
148 | 148 | case '2.3.1': |
149 | 149 | executeDbSql("update cr_settings set version = '2.3.2'"); |
150 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.3.2', $_SESSION['userid']); |
|
150 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.2', $_SESSION['userid']); |
|
151 | 151 | insertStatistics('system', __FILE__, 'db-update', '2.3.2', $version); |
152 | 152 | case '2.3.2': |
153 | 153 | executeDbSql("update cr_settings set version = '2.3.3'"); |
154 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.3.3', $_SESSION['userid']); |
|
154 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.3', $_SESSION['userid']); |
|
155 | 155 | insertStatistics('system', __FILE__, 'db-update', '2.3.3', $version); |
156 | 156 | case '2.3.3': |
157 | 157 | if (substr($mysqli_version, 0, 1) == 5) { |
@@ -199,33 +199,33 @@ discard block |
||
199 | 199 | ); |
200 | 200 | } |
201 | 201 | executeDbSql("update cr_settings set version = '2.3.4'"); |
202 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.3.4', $_SESSION['userid']); |
|
202 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.4', $_SESSION['userid']); |
|
203 | 203 | insertStatistics('system', __FILE__, 'db-update', '2.3.4', $version); |
204 | 204 | case '2.3.4': |
205 | 205 | executeDbSql("update cr_settings set version = '2.3.5'"); |
206 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.3.5', $_SESSION['userid']); |
|
206 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.5', $_SESSION['userid']); |
|
207 | 207 | insertStatistics('system', __FILE__, 'db-update', '2.3.5', $version); |
208 | 208 | case '2.3.5': |
209 | 209 | executeDbSql("update cr_settings set version = '2.4.0'"); |
210 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.4.0', $_SESSION['userid']); |
|
210 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.0', $_SESSION['userid']); |
|
211 | 211 | insertStatistics('system', __FILE__, 'db-update', '2.4.0', $version); |
212 | 212 | case '2.4.0': |
213 | 213 | executeDbSql("update cr_settings set version = '2.4.1'"); |
214 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.4.1', $_SESSION['userid']); |
|
214 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.1', $_SESSION['userid']); |
|
215 | 215 | insertStatistics('system', __FILE__, 'db-update', '2.4.1', $version); |
216 | 216 | case '2.4.1': |
217 | 217 | executeDbSql('alter table cr_settings add(days_to_alert int(2) DEFAULT 5) '); |
218 | 218 | executeDbSql("alter table cr_settings add(token varchar(100) DEFAULT '') "); |
219 | 219 | executeDbSql("update cr_settings set version = '2.4.2'"); |
220 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.4.2', $_SESSION['userid']); |
|
220 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.2', $_SESSION['userid']); |
|
221 | 221 | insertStatistics('system', __FILE__, 'db-update', '2.4.2', $version); |
222 | 222 | case '2.4.2': |
223 | 223 | executeDbSql("update cr_settings set version = '2.4.3'"); |
224 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.4.3', $_SESSION['userid']); |
|
224 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.3', $_SESSION['userid']); |
|
225 | 225 | insertStatistics('system', __FILE__, 'db-update', '2.4.3', $version); |
226 | 226 | case '2.4.3': |
227 | 227 | executeDbSql("update cr_settings set version = '2.4.4'"); |
228 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.4.4', $_SESSION['userid']); |
|
228 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.4', $_SESSION['userid']); |
|
229 | 229 | insertStatistics('system', __FILE__, 'db-update', '2.4.4', $version); |
230 | 230 | case '2.4.4': |
231 | 231 | if (substr($mysqli_version, 0, 1) == 5) { |
@@ -274,27 +274,27 @@ discard block |
||
274 | 274 | ); |
275 | 275 | } |
276 | 276 | executeDbSql("update cr_settings set version = '2.4.5'"); |
277 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.4.5', $_SESSION['userid']); |
|
277 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.5', $_SESSION['userid']); |
|
278 | 278 | insertStatistics('system', __FILE__, 'db-update', '2.4.5', $version); |
279 | 279 | case '2.4.5': |
280 | 280 | executeDbSql("update cr_settings set version = '2.5.0'"); |
281 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.5.0', $_SESSION['userid']); |
|
281 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.5.0', $_SESSION['userid']); |
|
282 | 282 | insertStatistics('system', __FILE__, 'db-update', '2.5.0', $version); |
283 | 283 | case '2.5.0': |
284 | 284 | executeDbSql("update cr_settings set version = '2.5.1'"); |
285 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.5.1', $_SESSION['userid']); |
|
285 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.5.1', $_SESSION['userid']); |
|
286 | 286 | insertStatistics('system', __FILE__, 'db-update', '2.5.1', $version); |
287 | 287 | case '2.5.1': |
288 | 288 | executeDbSql("update cr_settings set version = '2.5.2'"); |
289 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.5.2', $_SESSION['userid']); |
|
289 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.5.2', $_SESSION['userid']); |
|
290 | 290 | insertStatistics('system', __FILE__, 'db-update', '2.5.2', $version); |
291 | 291 | case '2.5.2': |
292 | 292 | executeDbSql("update cr_settings set version = '2.5.3'"); |
293 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.5.3', $_SESSION['userid']); |
|
293 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.5.3', $_SESSION['userid']); |
|
294 | 294 | insertStatistics('system', __FILE__, 'db-update', '2.5.3', $version); |
295 | 295 | case '2.5.3': |
296 | 296 | executeDbSql("update cr_settings set version = '2.6.0'"); |
297 | - notifyInfo(__FILE__, 'db-update='.$version.'->2.6.0', $_SESSION['userid']); |
|
297 | + notifyInfo(__FILE__, 'db-update=' . $version . '->2.6.0', $_SESSION['userid']); |
|
298 | 298 | insertStatistics('system', __FILE__, 'db-update', '2.6.0', $version); |
299 | 299 | case '2.6.0': |
300 | 300 | $sql = "ALTER TABLE cr_users |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | executeDbSql($sql); |
371 | 371 | executeDbSql("update cr_settings set version = '3.0.0-pre1'"); |
372 | 372 | |
373 | - notifyInfo(__FILE__, 'db-update='.$version.'->3.0.0-pre1', $_SESSION['userid']); |
|
373 | + notifyInfo(__FILE__, 'db-update=' . $version . '->3.0.0-pre1', $_SESSION['userid']); |
|
374 | 374 | insertStatistics('system', __FILE__, 'db-update', '3.0.0-pre1', $version); |
375 | 375 | case '3.0.0-pre1': |
376 | 376 | $sql = "CREATE TABLE IF NOT EXISTS cr_notifications ( |
@@ -17,7 +17,7 @@ discard block |
||
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 |
||
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 cr_users SET lastLogin = '$currentTimestamp' WHERE id = '".$row['id']."'"; |
|
38 | + $sql = "UPDATE cr_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 |
||
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 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $sql = "UPDATE cr_roles SET name = '$name', description = '$description' WHERE id = '$id'"; |
31 | 31 | |
32 | 32 | if (!mysqli_query(db(), $sql)) { |
33 | - die('Error: '.mysqli_error(db())); |
|
33 | + die('Error: ' . mysqli_error(db())); |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | $sql = "UPDATE cr_groups SET name = '$name' WHERE groupId = '$key'"; |
40 | 40 | |
41 | 41 | if (!mysqli_query(db(), $sql)) { |
42 | - die('Error: '.mysqli_error(db())); |
|
42 | + die('Error: ' . mysqli_error(db())); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | $sql = "UPDATE cr_groups SET description = '$description' WHERE groupId = '$key'"; |
46 | 46 | |
47 | 47 | if (!mysqli_query(db(), $sql)) { |
48 | - die('Error: '.mysqli_error(db())); |
|
48 | + die('Error: ' . mysqli_error(db())); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $sql = "UPDATE cr_roles SET groupId = '$value' WHERE id = '$roleID'"; |
55 | 55 | |
56 | 56 | if (!mysqli_query(db(), $sql)) { |
57 | - die('Error: '.mysqli_error(db())); |
|
57 | + die('Error: ' . mysqli_error(db())); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | return $ob->allowRoleSwaps; |
132 | 132 | } |
133 | 133 | |
134 | - $sql = "SELECT allowRoleSwaps FROM cr_groups WHERE id = '".$ob->groupId."'"; |
|
134 | + $sql = "SELECT allowRoleSwaps FROM cr_groups WHERE id = '" . $ob->groupId . "'"; |
|
135 | 135 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
136 | 136 | $ob = mysqli_fetch_object($result); |
137 | 137 |