Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated-classes/TechWilk/Rota/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public function setPassword($v)

if (!password_verify($v, $this->password)) {
$bcrypt_options = [
'cost' => 12,
];
'cost' => 12,
];
$this->password = password_hash($v, PASSWORD_BCRYPT, $bcrypt_options);

$this->modifiedColumns[UserTableMap::COL_PASSWORD] = true;
Expand Down
44 changes: 22 additions & 22 deletions generated-conf/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@
$serviceContainer->setAdapterClass('default', 'mysql');
$manager = new \Propel\Runtime\Connection\ConnectionManagerSingle();
$manager->setConfiguration([
'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper',
'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'],
'user' => $config['db']['user'],
'password' => $config['db']['pass'],
'attributes' => [
'ATTR_EMULATE_PREPARES' => false,
'ATTR_TIMEOUT' => 30,
],
'model_paths' => [
0 => 'src',
1 => 'vendor',
],
'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper',
'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'],
'user' => $config['db']['user'],
'password' => $config['db']['pass'],
'attributes' => [
'ATTR_EMULATE_PREPARES' => false,
'ATTR_TIMEOUT' => 30,
],
'model_paths' => [
0 => 'src',
1 => 'vendor',
],
]);
$manager->setName('default');
$serviceContainer->setConnectionManager('default', $manager);

$serviceContainer->setAdapterClass('test', 'sqlite');
$manager = new \Propel\Runtime\Connection\ConnectionManagerSingle();
$manager->setConfiguration([
'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper',
'dsn' => 'sqlite:/var/tmp/test.db',
'attributes' => [
'ATTR_EMULATE_PREPARES' => false,
'ATTR_TIMEOUT' => 30,
],
'model_paths' => [
0 => 'src',
1 => 'vendor',
],
'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper',
'dsn' => 'sqlite:/var/tmp/test.db',
'attributes' => [
'ATTR_EMULATE_PREPARES' => false,
'ATTR_TIMEOUT' => 30,
],
'model_paths' => [
0 => 'src',
1 => 'vendor',
],
]);
$manager->setName('test');
$serviceContainer->setConnectionManager('test', $manager);
Expand Down
8 changes: 4 additions & 4 deletions generated-migrations/PropelMigration_1494860053.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function postDown(MigrationManager $manager)
public function getUpSQL()
{
return [
'default' => '
'default' => '
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
Expand Down Expand Up @@ -160,7 +160,7 @@ public function getUpSQL()
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;
',
];
];
}

/**
Expand All @@ -172,7 +172,7 @@ public function getUpSQL()
public function getDownSQL()
{
return [
'default' => '
'default' => '
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
Expand Down Expand Up @@ -270,6 +270,6 @@ public function getDownSQL()
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;
',
];
];
}
}
84 changes: 41 additions & 43 deletions public/api/v1/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,68 +17,66 @@ function isAdmin()
}
}

if (isAdmin()):
if (isAdmin()) {

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Start of API
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Start of API
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

require_once __DIR__.'/../../../vendor/autoload.php';
require_once __DIR__.'/../../../vendor/autoload.php';

require_once __DIR__.'/../../../generated-conf/config.php';
require_once __DIR__.'/../../../generated-conf/config.php';

// Create and configure Slim app
$app = new \Slim\App(['settings' => $config]);
// Create and configure Slim app
$app = new \Slim\App(['settings' => $config]);

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Containers for DI
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Containers for DI
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$container = $app->getContainer();
$container = $app->getContainer();

$container['db'] = function ($c) {
$db_config = $c['settings']['db'];
$db = new Database($db_config);
$container['db'] = function ($c) {
$db_config = $c['settings']['db'];
$db = new Database($db_config);

return $db;
};
return $db;
};

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Define app routes
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Define app routes
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// ~~~~~~~~~~~~~~~ Series ~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~ Series ~~~~~~~~~~~~~~~

$app->post('/series', function ($request, $response, $args) {
$postData = $request->getParsedBody();
$app->post('/series', function ($request, $response, $args) {
$postData = $request->getParsedBody();

$name = filter_var($postData['name'], FILTER_SANITIZE_STRING);
$description = filter_var($postData['description'], FILTER_SANITIZE_STRING);
$name = filter_var($postData['name'], FILTER_SANITIZE_STRING);
$description = filter_var($postData['description'], FILTER_SANITIZE_STRING);

$series = new EventGroup();
$series->setName($name);
$series->setDescription($description);
$series->save();
$series = new EventGroup();
$series->setName($name);
$series->setDescription($description);
$series->save();

$data = [
'data' => [
'id' => $series->getId(),
'name' => $series->getName(),
'description' => $series->getDescription(),
],
$data = [
'data' => [
'id' => $series->getId(),
'name' => $series->getName(),
'description' => $series->getDescription(),
],
];

return $response->withJson($data);
});
return $response->withJson($data);
});

// Run app
$app->run();
// Run app
$app->run();

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// End of very very very basic auth
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

else:
http_response_code(401);

endif;
} else {
http_response_code(401);
}
2 changes: 1 addition & 1 deletion public/old/cr_daily.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
date >= CURDATE()
AND date_format( date , "%y-%m-%d" )
<= date_format( DATE_ADD(now(), INTERVAL '.$daysAlert.' DAY ) , "%y-%m-%d" )';
$resultEvents = mysqli_query(db(), $sqlEvents) or die(mysqli_error(db()));
$resultEvents = mysqli_query(db(), $sqlEvents) or exit(mysqli_error(db()));
$i = 0;
while ($rowEvents = mysqli_fetch_array($resultEvents, MYSQLI_ASSOC)) {
$usersNotified = notifyEveryoneForEvent($rowEvents['id']);
Expand Down
Loading