@@ -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: |
@@ -106,14 +106,17 @@ |
||
| 106 | 106 | <input type="hidden" name="action" value="unlink" /> |
| 107 | 107 | <button class="btn btn-danger">Unlink</button> |
| 108 | 108 | </form> |
| 109 | - <?php else: ?> |
|
| 109 | + <?php else { |
|
| 110 | + : ?> |
|
| 110 | 111 | <form action="#" method="post"> |
| 111 | 112 | <input type="hidden" name="id" value="<?php echo $id ?>" /> |
| 112 | 113 | <input type="hidden" name="platform" value="<?php echo $platform ?>" /> |
| 113 | 114 | <input type="hidden" name="action" value="link" /> |
| 114 | 115 | <button class="btn btn-primary">Link</button> |
| 115 | 116 | </form> |
| 116 | - <?php endif; ?> |
|
| 117 | + <?php endif; |
|
| 118 | +} |
|
| 119 | +?> |
|
| 117 | 120 | </div> |
| 118 | 121 | </div> |
| 119 | 122 | <?php endforeach; ?> |
@@ -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) |
@@ -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(); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | public function getUpSQL() |
| 41 | 41 | { |
| 42 | 42 | return [ |
| 43 | - 'default' => ' |
|
| 43 | + 'default' => ' |
|
| 44 | 44 | # This is a fix for InnoDB in MySQL >= 4.1.x |
| 45 | 45 | # It "suspends judgement" for fkey relationships until are tables are set. |
| 46 | 46 | SET FOREIGN_KEY_CHECKS = 0; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | public function getDownSQL() |
| 173 | 173 | { |
| 174 | 174 | return [ |
| 175 | - 'default' => ' |
|
| 175 | + 'default' => ' |
|
| 176 | 176 | # This is a fix for InnoDB in MySQL >= 4.1.x |
| 177 | 177 | # It "suspends judgement" for fkey relationships until are tables are set. |
| 178 | 178 | SET FOREIGN_KEY_CHECKS = 0; |
@@ -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(); |
@@ -7,18 +7,18 @@ discard block |
||
| 7 | 7 | $serviceContainer->setAdapterClass('default', 'mysql'); |
| 8 | 8 | $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); |
| 9 | 9 | $manager->setConfiguration([ |
| 10 | - 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
|
| 11 | - 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], |
|
| 12 | - 'user' => $config['db']['user'], |
|
| 13 | - 'password' => $config['db']['pass'], |
|
| 14 | - 'attributes' => [ |
|
| 10 | + 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
|
| 11 | + 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], |
|
| 12 | + 'user' => $config['db']['user'], |
|
| 13 | + 'password' => $config['db']['pass'], |
|
| 14 | + 'attributes' => [ |
|
| 15 | 15 | 'ATTR_EMULATE_PREPARES' => false, |
| 16 | 16 | 'ATTR_TIMEOUT' => 30, |
| 17 | - ], |
|
| 18 | - 'model_paths' => [ |
|
| 17 | + ], |
|
| 18 | + 'model_paths' => [ |
|
| 19 | 19 | 0 => 'src', |
| 20 | 20 | 1 => 'vendor', |
| 21 | - ], |
|
| 21 | + ], |
|
| 22 | 22 | ]); |
| 23 | 23 | $manager->setName('default'); |
| 24 | 24 | $serviceContainer->setConnectionManager('default', $manager); |
@@ -26,16 +26,16 @@ discard block |
||
| 26 | 26 | $serviceContainer->setAdapterClass('test', 'sqlite'); |
| 27 | 27 | $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); |
| 28 | 28 | $manager->setConfiguration([ |
| 29 | - 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
|
| 30 | - 'dsn' => 'sqlite:/var/tmp/test.db', |
|
| 31 | - 'attributes' => [ |
|
| 29 | + 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
|
| 30 | + 'dsn' => 'sqlite:/var/tmp/test.db', |
|
| 31 | + 'attributes' => [ |
|
| 32 | 32 | 'ATTR_EMULATE_PREPARES' => false, |
| 33 | 33 | 'ATTR_TIMEOUT' => 30, |
| 34 | - ], |
|
| 35 | - 'model_paths' => [ |
|
| 34 | + ], |
|
| 35 | + 'model_paths' => [ |
|
| 36 | 36 | 0 => 'src', |
| 37 | 37 | 1 => 'vendor', |
| 38 | - ], |
|
| 38 | + ], |
|
| 39 | 39 | ]); |
| 40 | 40 | $manager->setName('test'); |
| 41 | 41 | $serviceContainer->setConnectionManager('test', $manager); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require __DIR__.'/../config/database.php'; |
|
| 3 | +require __DIR__ . '/../config/database.php'; |
|
| 4 | 4 | $serviceContainer = \Propel\Runtime\Propel::getServiceContainer(); |
| 5 | 5 | $serviceContainer->checkVersion('2.0.0-dev'); |
| 6 | 6 | |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); |
| 9 | 9 | $manager->setConfiguration([ |
| 10 | 10 | 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
| 11 | - 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], |
|
| 11 | + 'dsn' => 'mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'], |
|
| 12 | 12 | 'user' => $config['db']['user'], |
| 13 | 13 | 'password' => $config['db']['pass'], |
| 14 | 14 | 'attributes' => [ |
@@ -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 | { |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once __DIR__.'/config.php'; |
|
| 3 | +require_once __DIR__ . '/config.php'; |
|
| 4 | 4 | |
| 5 | 5 | $config = getConfig(); |
| 6 | 6 | |
@@ -12,13 +12,13 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | // Renderer settings |
| 14 | 14 | 'renderer' => [ |
| 15 | - 'template_path' => __DIR__.'/../templates/', |
|
| 15 | + 'template_path' => __DIR__ . '/../templates/', |
|
| 16 | 16 | ], |
| 17 | 17 | |
| 18 | 18 | // Monolog settings |
| 19 | 19 | 'logger' => [ |
| 20 | 20 | 'name' => 'rota', |
| 21 | - 'path' => __DIR__.'/../logs/app.log', |
|
| 21 | + 'path' => __DIR__ . '/../logs/app.log', |
|
| 22 | 22 | 'level' => \Monolog\Logger::DEBUG, |
| 23 | 23 | ], |
| 24 | 24 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | $hostname = $_SERVER['HTTP_HOST']; |
| 40 | 40 | |
| 41 | 41 | return [ |
| 42 | - 'base' => $http.'://'.$hostname, |
|
| 42 | + 'base' => $http . '://' . $hostname, |
|
| 43 | 43 | 'protocol' => $http, |
| 44 | 44 | 'host' => $hostname, |
| 45 | 45 | ]; |