@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } catch (\Exception $e) { |
35 | 35 | } |
36 | 36 | |
37 | -$url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; |
|
37 | +$url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
|
38 | 38 | $url = substr($url, 0, -12); // remove "/install.php" from url |
39 | 39 | |
40 | 40 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | //exit; |
49 | 49 | $conn->exec($sql); |
50 | 50 | } catch (\Exception $e) { |
51 | - echo 'Error (code: '.$e->getCode().') adding tables to database: '.$e->getMessage(); |
|
51 | + echo 'Error (code: ' . $e->getCode() . ') adding tables to database: ' . $e->getMessage(); |
|
52 | 52 | exit; |
53 | 53 | } |
54 | 54 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $lastname = $_POST['lastname']; |
59 | 59 | $lastname = trim(strip_tags($lastname)); |
60 | 60 | |
61 | - $username = strtolower($firstname).'.'.strtolower($lastname); |
|
61 | + $username = strtolower($firstname) . '.' . strtolower($lastname); |
|
62 | 62 | |
63 | 63 | $password = $_POST['password']; |
64 | 64 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | try { |
83 | 83 | $user->save(); |
84 | 84 | } catch (\Exception $e) { |
85 | - echo 'Error (code: '.$e->getCode().') adding user to database: '.$e->getMessage(); |
|
85 | + echo 'Error (code: ' . $e->getCode() . ') adding user to database: ' . $e->getMessage(); |
|
86 | 86 | exit; |
87 | 87 | } |
88 | 88 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | $settings->save(); |
181 | 181 | |
182 | - header('Location: login.php?username='.$username); // Move to the home page of the admin section |
|
182 | + header('Location: login.php?username=' . $username); // Move to the home page of the admin section |
|
183 | 183 | exit; |
184 | 184 | } |
185 | 185 |
@@ -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); |
@@ -51,7 +51,7 @@ |
||
51 | 51 | case 'everyone': |
52 | 52 | echo '<p>Function not complete, please wait while we finish writing it.</p><p>Apologies for any inconvinence.</p>'; |
53 | 53 | break; |
54 | - default: |
|
54 | + default: |
|
55 | 55 | echo '<p>Error: Insufficient parameters.</p>'; |
56 | 56 | echo '<p>Please inform the system administrator</p>'; |
57 | 57 | break; |
@@ -37,22 +37,22 @@ |
||
37 | 37 | $platform = strtolower($_POST['platform']); |
38 | 38 | |
39 | 39 | switch ($_POST['action']) { |
40 | - case 'link': |
|
41 | - switch ($platform) { |
|
40 | + case 'link': |
|
41 | + switch ($platform) { |
|
42 | 42 | case 'facebook': |
43 | 43 | $_SESSION['fb-callback-url'] = 'fb-link.php'; |
44 | 44 | header('Location: fb-login.php'); |
45 | 45 | exit; |
46 | - } |
|
47 | - break; |
|
48 | - case 'unlink': |
|
49 | - removeSocialAuthFromUserWithId($id, $platform); |
|
50 | - createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
51 | - break; |
|
52 | - |
|
53 | - default: |
|
54 | - // code... |
|
46 | + } |
|
55 | 47 | break; |
48 | + case 'unlink': |
|
49 | + removeSocialAuthFromUserWithId($id, $platform); |
|
50 | + createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
51 | + break; |
|
52 | + |
|
53 | + default: |
|
54 | + // code... |
|
55 | + break; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | break; |
48 | 48 | case 'unlink': |
49 | 49 | removeSocialAuthFromUserWithId($id, $platform); |
50 | - createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
50 | + createNotificationForUser($id, ucfirst($platform) . ' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
51 | 51 | break; |
52 | 52 | |
53 | 53 | default: |
@@ -41,19 +41,19 @@ |
||
41 | 41 | switch ($platform) { |
42 | 42 | case 'facebook': |
43 | 43 | $_SESSION['fb-callback-url'] = 'fb-link.php'; |
44 | - header('Location: fb-login.php'); |
|
45 | - exit; |
|
46 | - } |
|
47 | - break; |
|
44 | + header('Location: fb-login.php'); |
|
45 | + exit; |
|
46 | + } |
|
47 | + break; |
|
48 | 48 | case 'unlink': |
49 | 49 | removeSocialAuthFromUserWithId($id, $platform); |
50 | - createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
51 | - break; |
|
50 | + createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
51 | + break; |
|
52 | 52 | |
53 | 53 | default: |
54 | 54 | // code... |
55 | 55 | break; |
56 | - } |
|
56 | + } |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // list of possible social account links (names used as platform names in database) |
@@ -5,18 +5,18 @@ |
||
5 | 5 | include 'includes/config.php'; |
6 | 6 | include 'includes/functions.php'; |
7 | 7 | |
8 | - // you have to open the session first |
|
9 | - session_start(); |
|
8 | + // you have to open the session first |
|
9 | + session_start(); |
|
10 | 10 | |
11 | 11 | //if ($debug) notifyInfo(__FILE__,"logout",$_SESSION['userid']); //only_for_testing// |
12 | 12 | if ($debug) { |
13 | 13 | insertStatistics('user', __FILE__, 'logout'); |
14 | 14 | } |
15 | 15 | |
16 | - //remove all the variables in the session |
|
17 | - session_unset(); |
|
16 | + //remove all the variables in the session |
|
17 | + session_unset(); |
|
18 | 18 | |
19 | - // destroy the session |
|
20 | - session_destroy(); |
|
19 | + // destroy the session |
|
20 | + session_destroy(); |
|
21 | 21 | |
22 | - header('Location: login.php'); |
|
22 | + header('Location: login.php'); |
@@ -6,31 +6,31 @@ |
||
6 | 6 | // To help the built-in PHP dev server, check if the request was actually for |
7 | 7 | // something which should probably be served as a static file |
8 | 8 | $url = parse_url($_SERVER['REQUEST_URI']); |
9 | - $file = __DIR__.$url['path']; |
|
9 | + $file = __DIR__ . $url['path']; |
|
10 | 10 | if (is_file($file)) { |
11 | 11 | return false; |
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | -require __DIR__.'/../vendor/autoload.php'; |
|
15 | +require __DIR__ . '/../vendor/autoload.php'; |
|
16 | 16 | |
17 | 17 | // setup Propel (autoload configured though composer) |
18 | -require_once __DIR__.'/../generated-conf/config.php'; |
|
18 | +require_once __DIR__ . '/../generated-conf/config.php'; |
|
19 | 19 | |
20 | 20 | session_start(); |
21 | 21 | |
22 | 22 | // Instantiate the app |
23 | -$settings = require __DIR__.'/../src/settings.php'; |
|
23 | +$settings = require __DIR__ . '/../src/settings.php'; |
|
24 | 24 | $app = new \Slim\App($settings); |
25 | 25 | |
26 | 26 | // Set up dependencies |
27 | -require __DIR__.'/../src/dependencies.php'; |
|
27 | +require __DIR__ . '/../src/dependencies.php'; |
|
28 | 28 | |
29 | 29 | // Register middleware |
30 | -require __DIR__.'/../src/middleware.php'; |
|
30 | +require __DIR__ . '/../src/middleware.php'; |
|
31 | 31 | |
32 | 32 | // Register routes |
33 | -require __DIR__.'/../src/routes.php'; |
|
33 | +require __DIR__ . '/../src/routes.php'; |
|
34 | 34 | |
35 | 35 | // Run app |
36 | 36 | $app->run(); |
@@ -22,16 +22,16 @@ |
||
22 | 22 | } |
23 | 23 | //$acceptedFileExtensions = ['jpg', 'png', 'jpeg', 'gif', 'docx', 'pdf', 'xlsx', 'pptx']; |
24 | 24 | $acceptedFileTypes = ['image/gif', 'image/png', 'image/jpeg', 'application/pdf', 'application/msword', 'application/excel']; |
25 | - $target_dir = __DIR__.'/../documents/'; |
|
25 | + $target_dir = __DIR__ . '/../documents/'; |
|
26 | 26 | $this->setUrl($file->getClientFilename()); |
27 | 27 | //$fileExtension = pathinfo(basename($file->getName()),PATHINFO_EXTENSION); |
28 | 28 | |
29 | 29 | // Allow certain file formats only |
30 | 30 | if (!in_array($file->getClientMediaType(), $acceptedFileTypes)) { |
31 | - throw new InvalidArgumentException('Sorry, only '.implode(', ', $acceptedFileTypes).' files are allowed.'); |
|
31 | + throw new InvalidArgumentException('Sorry, only ' . implode(', ', $acceptedFileTypes) . ' files are allowed.'); |
|
32 | 32 | } |
33 | 33 | $this->save(); |
34 | - $target_file = $target_dir.$this->getId(); |
|
34 | + $target_file = $target_dir . $this->getId(); |
|
35 | 35 | |
36 | 36 | // Check if file already exists |
37 | 37 | if (file_exists($target_file)) { |
@@ -19,11 +19,11 @@ |
||
19 | 19 | { |
20 | 20 | return EventQuery::create() |
21 | 21 | ->useEventPersonQuery() |
22 | - ->useUserRoleQuery() |
|
22 | + ->useUserRoleQuery() |
|
23 | 23 | ->useRoleQuery() |
24 | - ->filterByGroup($this) |
|
24 | + ->filterByGroup($this) |
|
25 | + ->endUse() |
|
25 | 26 | ->endUse() |
26 | - ->endUse() |
|
27 | 27 | ->endUse() |
28 | 28 | ->orderByDate('desc') |
29 | 29 | ->findOne(); |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require __DIR__.'/../config/database.php'; |
|
4 | -require __DIR__.'/../config/auth.php'; |
|
5 | -require __DIR__.'/../config/email.php'; |
|
6 | -require __DIR__.'/../config/recording.php'; |
|
3 | +require __DIR__ . '/../config/database.php'; |
|
4 | +require __DIR__ . '/../config/auth.php'; |
|
5 | +require __DIR__ . '/../config/email.php'; |
|
6 | +require __DIR__ . '/../config/recording.php'; |
|
7 | 7 | |
8 | 8 | function getConfig() |
9 | 9 | { |