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
31 changes: 15 additions & 16 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;
',
];
];
}
}
86 changes: 42 additions & 44 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);
}
30 changes: 15 additions & 15 deletions public/old/createEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,38 +543,38 @@
}
$groups = GroupQuery::create()->joinWith('Group.Role')->joinWith('Role.UserRole')->find();

foreach ($groups as $group): ?>
foreach ($groups as $group) { ?>
<legend><?php echo $group->getName() ?></legend>
<?php foreach ($group->getRoles() as $role): ?>
<?php foreach ($group->getRoles() as $role) { ?>
<div class="form-group col-md-6">
<label><?php echo $role->getName() ?></label>
<select name="userRole[]" multiple="multiple" class="form-control multi" style="width:100%;" data-placeholder="Select people for <?php echo $role->getName() ?>">
<optgroup label="Regular">
<?php $countReserve = 0 ?>
<?php foreach ($role->getUserRoles() as $userRole): ?>
<?php if (!$userRole->getReserve()): ?>
<?php foreach ($role->getUserRoles() as $userRole) { ?>
<?php if (!$userRole->getReserve()) { ?>
<?php $isInEvent = in_array($userRole->getId(), $usersInEvent) ?>
<option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName().' '.$userRole->getUser()->getLastName() ?></option>
<?php else: ?>
<?php } else { ?>
<?php $countReserve += 1 ?>
<?php endif //!userRole->getReserve?>
<?php endforeach //users?>
<?php } //!userRole->getReserve?>
<?php } //users?>
</optgroup>
<?php if ($countReserve > 0): ?>
<?php if ($countReserve > 0) { ?>
<optgroup label="Reserve">
<?php foreach ($role->getUserRoles() as $userRole): ?>
<?php if ($userRole->getReserve()): ?>
<?php foreach ($role->getUserRoles() as $userRole) { ?>
<?php if ($userRole->getReserve()) { ?>
<?php $isInEvent = in_array($userRole->getId(), $usersInEvent) ?>
<option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName().' '.$userRole->getUser()->getLastName() ?></option>
<?php endif ?>
<?php endforeach //users?>
<?php } ?>
<?php } //users?>
</optgroup>
<?php endif //countReserve > 0?>
<?php } //countReserve > 0?>
</select>
</div>
<?php endforeach // roles?>
<?php } // roles?>

<?php endforeach // groups?>
<?php } // groups?>

<?php /*

Expand Down
4 changes: 2 additions & 2 deletions public/old/editRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@

<div class="box-body">

<?php foreach ($users as $user): ?>
<?php foreach ($users as $user) { ?>
<div class='checkbox'>
<label for='user[<?php echo $user['id']; ?>]'>
<input
Expand All @@ -159,7 +159,7 @@
<?php echo $user['name']; ?>
</label>
</div>
<?php endforeach ?>
<?php } ?>

</div>
<div class="box-footer">
Expand Down
Loading