Skip to content

Commit

Permalink
Merge pull request #9 from roothaan/develop
Browse files Browse the repository at this point in the history
Updated 2017 codebase
  • Loading branch information
jasperroel authored Aug 20, 2017
2 parents 9e64894 + 06c98f1 commit 890c376
Show file tree
Hide file tree
Showing 103 changed files with 505 additions and 424 deletions.
5 changes: 0 additions & 5 deletions .buildpath

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ composer.phar
vendor/

# User settings
config/user.ini
config/user.ini

# Eclipse files
.buildpath
.settings
1 change: 0 additions & 1 deletion .settings

This file was deleted.

30 changes: 15 additions & 15 deletions 2013/admin/admin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
if(!defined("opoiLoaded")) die("Scouting Putten, het lukt jullie niet om ons te hacken!");
if(!defined("opoiLoaded")) die('Incorrect or unknown use of application');

// If it's not ready at all, we can safely ignore protocol
if ($driver->isReady()) {
Expand All @@ -16,26 +16,26 @@
<?php } else {
?>
<ul>
<li><a href="<?=BASE_URL?>hunter_map.php">Hunter map</a></li>
<li><a href="<?=BASE_URL?>admin/users.php">Users</a></li>
<li><a href="<?=BASE_URL?>admin/createusers.php">Auto create users</a></li>
<li><a href="<?=WEBSITE_URL?>admin-hunter-map">Hunter map</a></li>
<li><a href="<?=WEBSITE_URL?>admin-users">Users</a></li>
<li><a href="<?=WEBSITE_URL?>admin-createusers">Auto create users</a></li>
<li><a href="<?=WEBSITE_URL?>admin-gcm">Android GCM IDs</a></li>
<li><a href="<?=BASE_URL?>admin/poi.php">Pois</a></li>
<li><a href="<?=WEBSITE_URL?>admin-poi">Pois</a></li>
</ul>
<?php if (!$driver->isReady() || $authMgr->isSuperAdmin()) { ?>
<h2>Super Admin</h2>
<ul>
<li><a href="<?=BASE_URL?>admin/config.php">Config</a></li>
<li><a href="<?=BASE_URL?>admin/kml-import.php">KML Import tool</a></li>
<li><a href="<?=BASE_URL?>admin/events.php">Events</a> (<?= $driver->getAllEventsCount() ?>)</li>
<li><a href="<?=BASE_URL?>admin/organisations.php">Organisations</a> (<?= $driver->getAllOrganisationsCount() ?>)</li>
<li><a href="<?=BASE_URL?>admin/deelgebieden.php">Deelgebieden</a> (<?= $driver->getAllDeelgebiedenCount() ?>)</li>
<li><a href="<?=BASE_URL?>admin/speelhelften.php">Speelhelften</a> (<?= $driver->getAllSpeelhelftenCount() ?>)</li>
<li><a href="<?=BASE_URL?>admin/counterhunt.php">Counterhunt rondes</a> (<?= $driver->getAllCounterhuntrondjesCount() ?>)</li>
<li><a href="<?=BASE_URL?>admin/vossen.php">Vossen</a> (<?= $driver->getAllTeamsCount() ?>)</li>
<li><a href="<?=WEBSITE_URL?>suadmin-config">Config</a></li>
<li><a href="<?=WEBSITE_URL?>suadmin-kml-import">KML Import tool</a></li>
<li><a href="<?=WEBSITE_URL?>suadmin-events">Events</a> (<?= $driver->getAllEventsCount() ?>)</li>
<li><a href="<?=WEBSITE_URL?>suadmin-organisations">Organisations</a> (<?= $driver->getAllOrganisationsCount() ?>)</li>
<li><a href="<?=WEBSITE_URL?>suadmin-deelgebieden">Deelgebieden</a> (<?= $driver->getAllDeelgebiedenCount() ?>)</li>
<li><a href="<?=WEBSITE_URL?>suadmin-speelhelften">Speelhelften</a> (<?= $driver->getAllSpeelhelftenCount() ?>)</li>
<li><a href="<?=WEBSITE_URL?>suadmin-counterhunt">Counterhunt rondes</a> (<?= $driver->getAllCounterhuntrondjesCount() ?>)</li>
<li><a href="<?=WEBSITE_URL?>suadmin-vossen">Vossen</a> (<?= $driver->getAllTeamsCount() ?>)</li>

<li><a href="<?=BASE_URL?>admin/showdatabase.php">Show database</a></li>
<li><a href="<?=BASE_URL?>admin/phpinfo.php">phpinfo();</a></li>
<li><a href="<?=WEBSITE_URL?>suadmin-showdatabase">Show database</a></li>
<li><a href="<?=WEBSITE_URL?>suadmin-phpinfo">phpinfo();</a></li>
</ul>
<div><h2>Danger zone</h2>
<strong>Reset database</strong><br />
Expand Down
34 changes: 15 additions & 19 deletions 2013/admin/config.php
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
<?php
require_once '../init.php';
if(!defined("opoiLoaded")) die('Incorrect or unknown use of application');
$authMgr->requireSuperAdmin();
require_once BASE_DIR . 'header.php';
?>
<h1>Config</h1>
<h2>Base Config</h2>
<pre>
ROOT_DIR : <?php echo ROOT_DIR; ?>
ROOT_DIR : <?= ROOT_DIR ?>

CLASS_DIR : <?php echo CLASS_DIR; ?>
CLASS_DIR : <?= CLASS_DIR ?>

TEST_CLASS_DIR : <?php echo TEST_CLASS_DIR; ?>
TEST_CLASS_DIR : <?= TEST_CLASS_DIR ?>

BASE_URL : <?php echo BASE_URL; ?>
BASE_URL : <?= BASE_URL ?>

TEST_URL : <?php echo TEST_URL; ?>
TEST_URL : <?= TEST_URL ?>

$_SERVER ['HTTP_HOST'] = <?php echo $_SERVER ['HTTP_HOST']; ?>
$_SERVER ['HTTP_HOST'] = <?= $_SERVER ['HTTP_HOST'] ?>
</pre>

<h2>Database Config</h2>
<pre>
DB_TYPE : <?php echo DB_TYPE; ?>
DB_TYPE : <?= DB_TYPE ?>

DEV_MODE : <?php if (defined('DEV_MODE')) { echo DEV_MODE; } else {echo 'no DEV_MODE defined'; } ?>

DB_SERVER : <?php echo DB_SERVER; ?>
DB_SERVER : <?= DB_SERVER ?>

DB_PORT : <?php echo DB_PORT; ?>
DB_PORT : <?= DB_PORT ?>

DB_USERNAME : <?php echo DB_USERNAME; ?>
DB_USERNAME : <?= DB_USERNAME ?>

DB_PASSWORD : <?php echo DB_PASSWORD; ?>
DB_PASSWORD : <?= DB_PASSWORD ?>

DB_DATABASE : <?php echo DB_DATABASE; ?>
DB_DATABASE : <?= DB_DATABASE ?>

DB_OPTS : <?php echo DB_OPTS; ?>
DB_OPTS : <?= DB_OPTS ?>
</pre>

<h2>Environment Variables</h2>
Expand Down Expand Up @@ -69,7 +68,4 @@

PROXY_BASE_URL : <?= getenv('PROXY_BASE_URL') ?>

</pre>
<?php
require_once BASE_DIR . 'footer.php';
?>
</pre>
16 changes: 6 additions & 10 deletions 2013/admin/counterhunt.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
require_once '../init.php';
if(!defined("opoiLoaded")) die('Incorrect or unknown use of application');
$authMgr->requireSuperAdmin();
require_once BASE_DIR . 'header.php';

$counterhuntrondjes = $driver->getAllCounterhuntrondjesSu();
?>
Expand All @@ -25,8 +24,8 @@
]
})
.makeEditable({
sUpdateURL: "<?php echo BASE_URL . 'ajax/counterhuntrondjes.ajax.php'; ?>",
sDeleteURL: "<?php echo BASE_URL . 'ajax/counterhuntrondjes.ajax.php'; ?>"
sUpdateURL: "<?= BASE_URL . 'ajax/counterhuntrondjes.ajax.php' ?>",
sDeleteURL: "<?= BASE_URL . 'ajax/counterhuntrondjes.ajax.php' ?>"
})
});
</script>
Expand All @@ -35,7 +34,7 @@

<button id="btnDeleteRow">Verwijder ronde</button>

<form action="<?php echo BASE_URL . 'ajax/counterhuntrondjes.ajax.php'; ?>" method="POST">
<form action="<?= BASE_URL . 'ajax/counterhuntrondjes.ajax.php' ?>" method="POST">
<table id="counterhuntrondjes">
<thead>
<tr>
Expand Down Expand Up @@ -79,7 +78,7 @@
</tfoot>
<tbody>
<?php foreach ($counterhuntrondjes as $counterhuntrondje) { ?>
<tr id="<?php echo $counterhuntrondje->getId(); ?>">
<tr id="<?= $counterhuntrondje->getId() ?>">
<td class="read_only"><?= $counterhuntrondje->getId() ?></td>
<td class="read_only">
<?php
Expand All @@ -100,7 +99,4 @@
<?php } ?>
</tbody>
</table>
</form>
<?php
require_once BASE_DIR . 'footer.php';
?>
</form>
13 changes: 4 additions & 9 deletions 2013/admin/createusers.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
require_once '../init.php';
if(!defined("opoiLoaded")) die('Incorrect or unknown use of application');
$authMgr->requireAdmin();
require_once BASE_DIR . 'header.php';

require_once CLASS_DIR . 'datastore/mail/Email.class.php';
require_once CLASS_DIR . 'datastore/mail/Mailer.class.php';
Expand Down Expand Up @@ -163,11 +162,11 @@ function parseExcelFile() {
</tr>
<tr>
<th>Van</th>
<td><input type="text" name="rider_van" value="2016-10-01 00:00:00" /></td>
<td><input type="text" name="rider_van" value="<?= date('Y') ?>-10-01 00:00:00" /></td>
</tr>
<tr>
<th>Tot</th>
<td><input type="text" name="rider_tot" value="2016-12-31 23:55:00"/></td>
<td><input type="text" name="rider_tot" value="<?= date('Y') ?>-12-31 23:55:00"/></td>
</tr>

<tr>
Expand All @@ -178,8 +177,4 @@ function parseExcelFile() {
<input type="submit" value="Create users" />
</form>
</div>
</div>


<?php
require_once BASE_DIR . 'footer.php';
</div>
26 changes: 12 additions & 14 deletions 2013/admin/deelgebieden.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once '../init.php';
if(!defined("opoiLoaded")) die('Incorrect or unknown use of application');
$authMgr->requireSuperAdmin();
require_once BASE_DIR . 'header.php';

require_once BASE_DIR . 'includes/KmlHelper.class.php';

if (isset($_POST['deelgebied_id'])) {
Expand All @@ -24,17 +24,17 @@
if (sizeof($events) === 0) {?>
<h1>No Events</h1>
<?php
}else {
echo '<h1>Evenementen</h1>';
}

echo '<h1>Evenementen</h1>';
foreach ($events as $event) {
echo '<p><h2>' . $event->getName() . ' [' . $event->getId() . ']</h2><hr /></p>';
$allDeelgebieden = $driver->getAllDeelgebiedenForEvent($event->getId());
if (sizeof($allDeelgebieden) === 0 ) {
?>
<h3>Geen deelgebieden!</h3>
<p>Maak een KML met 2 (!) lagen, :<strong>Deelgebieden</strong> en <strong>Groepen</strong>.</p>
<form action="/2013/admin/deelgebieden.php" method="POST" enctype="multipart/form-data">
<form action="<?=WEBSITE_URL?>suadmin-deelgebieden" method="POST" enctype="multipart/form-data">
KML File: <input type="file" name="kml_file"><br />
import: <input type="checkbox" name="import"><br />
<input type="hidden" name="event_id" value="<?= $event->getId() ?>"><br />
Expand All @@ -44,7 +44,7 @@
<?php
} else {
foreach ($allDeelgebieden as $deelgebied) {
echo '<p><h3>' . $deelgebied->getName() . ' ['.$deelgebied->getId().'] <a href="/2013/admin/deelgebieden.php?action=remove&deelgebied_id='.$deelgebied->getId().'">verwijder</a></h3>';
echo '<p><h3>' . $deelgebied->getName() . ' ['.$deelgebied->getId().'] <a href="'.WEBSITE_URL.'suadmin-deelgebieden?action=remove&deelgebied_id='.$deelgebied->getId().'">verwijder</a></h3>';

$coordinate_counter = 0;
$allCoordinates = $driver->getAllCoordinatesForDeelgebied($deelgebied->getId());
Expand All @@ -69,7 +69,7 @@
}
?>
Voeg coordinate toe aan <strong><?= $deelgebied->getName() ?></strong>:
<form action="/2013/admin/deelgebieden.php" method="POST">
<form action="<?=WEBSITE_URL?>suadmin-deelgebieden" method="POST">
Longitude: <input type="text" name="longitude" />
Latitude: <input type="text" name="latitude" />
Order ID: <input type="text" name="order_id" value="<?= ++$coordinate_counter ?>" />
Expand All @@ -79,7 +79,7 @@
<?php
} ?>
Voeg deelgebied toe:
<form action="/2013/admin/deelgebieden.php" method="POST">
<form action="<?=WEBSITE_URL?>suadmin-deelgebieden" method="POST">
Naam: <input type="text" name="name" />
<input type="hidden" name="event_id" value="<?= $event->getId() ?>"/>
<input type="submit" name="Voeg deelgebied toe"/>
Expand All @@ -88,12 +88,10 @@
}
}
?>
<h1>KML import</h1>
<form action="/2013/admin/deelgebieden.php" method="POST" enctype="multipart/form-data">
<hr />
<h2>KML import</h2>
<form action="<?=WEBSITE_URL?>suadmin-deelgebieden" method="POST" enctype="multipart/form-data">
KML File: <input type="file" name="kml_file"><br />
import: <input type="checkbox" name="import"><br />
<input type="submit" value="Upload KML file">
</form>
<?php
require_once BASE_DIR . 'footer.php';
?>
</form>
14 changes: 5 additions & 9 deletions 2013/admin/events.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
require_once '../init.php';
if(!defined("opoiLoaded")) die('Incorrect or unknown use of application');
$authMgr->requireSuperAdmin();
require_once BASE_DIR . 'header.php';

$events = $driver->getAllEvents();
?>
Expand All @@ -25,8 +24,8 @@
]
})
.makeEditable({
sUpdateURL: "<?php echo BASE_URL . 'ajax/events.ajax.php'; ?>",
sDeleteURL: "<?php echo BASE_URL . 'ajax/events.ajax.php'; ?>"
sUpdateURL: "<?= BASE_URL . 'ajax/events.ajax.php' ?>",
sDeleteURL: "<?= BASE_URL . 'ajax/events.ajax.php' ?>"
})
});
</script>
Expand All @@ -35,7 +34,7 @@

<button id="btnDeleteRow">Verwijder event</button>

<form action="<?php echo BASE_URL . 'ajax/events.ajax.php'; ?>" method="POST">
<form action="<?= BASE_URL . 'ajax/events.ajax.php' ?>" method="POST">
<table id="events">
<thead>
<tr>
Expand Down Expand Up @@ -77,7 +76,4 @@
<?php } ?>
</tbody>
</table>
</form>
<?php
require_once BASE_DIR . 'footer.php';
?>
</form>
5 changes: 2 additions & 3 deletions 2013/admin/kml-import.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
require_once '../init.php';
if(!defined("opoiLoaded")) die('Incorrect or unknown use of application');
$authMgr->requireSuperAdmin();
require_once BASE_DIR . 'header.php';
require_once BASE_DIR . 'includes/KmlHelper.class.php';

$kmlHelper = new KmlHelper();
Expand All @@ -10,7 +9,7 @@

?>
<h1>KML import</h1>
<form action="/2013/admin/kml-import.php" method="POST" enctype="multipart/form-data">
<form action="<?= WEBSITE_URL ?>suadmin-kml-import" method="POST" enctype="multipart/form-data">
KML File: <input type="file" name="kml_file"><br />
import: <input type="checkbox" name="import"><br />
<input type="submit" value="Upload KML file">
Expand Down
Loading

0 comments on commit 890c376

Please sign in to comment.