Compare commits
17 Commits
materializ
...
participo/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d9deebd58 | ||
|
|
0c25d62a45 | ||
|
|
9c78234d33 | ||
|
|
649d5e9d52 | ||
|
|
aafb1f6c69 | ||
|
|
359851b28b | ||
|
|
63a832830c | ||
|
|
2bc08549f9 | ||
|
|
466911a5c6 | ||
|
|
34435d570a | ||
|
|
9e5f192dda | ||
|
|
86276f4ec1 | ||
|
|
c30b9e8522 | ||
|
|
81b943dcd5 | ||
|
|
223f8ff0ac | ||
|
|
dbad37a083 | ||
|
|
15111e3e1a |
|
After Width: | Height: | Size: 418 KiB |
|
After Width: | Height: | Size: 441 KiB |
|
After Width: | Height: | Size: 366 KiB |
BIN
homepage/cwsvHomepage/graphics/promo/sections/linedance.jpg
Normal file
|
After Width: | Height: | Size: 202 KiB |
@@ -10,47 +10,62 @@
|
||||
.newsBox img {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 50%;
|
||||
}
|
||||
</style>
|
||||
<h2 style="text-align:center;">Herzlich Willkommen auf der offiziellen Homepage des Chemnitzer Freizeit- und
|
||||
Wohngebietssportverein e. V.</h2>
|
||||
<!-- Eine kleiner Bereich für aktuelle Neuigkeiten--> <!-- Nicht zu vieles, aktuell halten!!!-->
|
||||
<!-- Idee: jede News ist eine h4-Überschrift und ein center-Element in einer div-->
|
||||
<!-- Idee: nur centerElement, wenn es nur ein Bild ist. Text sollte linksbündig sein.-->
|
||||
<!-- Gewinner Sportvereinswettbewerb -->
|
||||
<!-- Idee: nur centerElement, wenn es nur ein Bild ist. Text sollte linksbündig sein.--> <!-- HighlandGames-2024 -->
|
||||
<div class="newsBox"><img class="center" src="https://img.webme.com/pic/c/cwsv-sport/champion-des-ehrenamtes.jpg"
|
||||
title="Auszeichnung Champion des Ehrenamtes" alt="Auszeichnung Champion des Ehrenamtes" /> Zu unserer
|
||||
Präsidiumssitzung am 29.08.2024 war es uns eine große Ehre unser langjähriges Vereinsmitglied seit
|
||||
1981, Marita Schlegel, und ehrenamtliche Schatzmeisterin seit 14 Jahren über den Sportvereinswettbewerb
|
||||
"So geht sächsisch. - Im Sport" 2024 auszuzeichnen. <img class="center"
|
||||
src="https://img.webme.com/pic/c/cwsv-sport/marita-champion-des-ehrenamtes.jpg"
|
||||
title="Marita - Champion des Ehrenamtes" alt="Marita - Champion des Ehrenamtes" /> Dazu überreichten wir
|
||||
ihr noch die Ehrennadel des LSB e.V. in Silber. Herzlichen Dank an alle Unterstützer vom Vorstand des CWSV e.V.
|
||||
</div>
|
||||
|
||||
<!--Highlandgames Trebsen 2024-->
|
||||
<div class="newsBox">
|
||||
<h4>Gewinner Sportvereinswettbewerb</h4>
|
||||
<hr />
|
||||
<center>Der Chemnitzer Freizeit- und Wohngebietssportverein ist Gewinner im <a
|
||||
href="https://www.so-geht-saechsisch.de/gewinner-vereinssportwettbewerb">Sportvereinswettbewerb des
|
||||
Landessportbundes Sachsen</a></center>
|
||||
<div style="text-align:center;">
|
||||
<a href="https://www.so-geht-saechsisch.de/gewinner-vereinssportwettbewerb">
|
||||
<img src="https://img.webme.com/pic/c/cwsv-sport/preisverleihung-sportvereinswettbewerb-2023.jpg"
|
||||
title="Ehrung Chemnitzer WSV Sportvereinswettbewerb 2023" style="width:100%;"
|
||||
alt="Ehrung Chemnitzer WSV Sportvereinswettbewerb 2023" hspace="25" />
|
||||
</a>
|
||||
</div>
|
||||
<div style="text-align:center;">
|
||||
<a href="https://www.so-geht-saechsisch.de/gewinner-vereinssportwettbewerb">
|
||||
<img src="https://img.webme.com/pic/c/cwsv-sport/sportvereinswettbewerb-2023.png"
|
||||
title="Gewinner Sportvereinswettbewerb 2023" style="width:100%;"
|
||||
alt="Gewinner Sportvereinswettbewerb 2023" hspace="25" />
|
||||
</a>
|
||||
</div>
|
||||
<h3>Highland Games Trebsen</h3>
|
||||
<img src="https://img.webme.com/pic/c/cwsv-sport/highlanders-highlandgames-trebsen-2024.jpg"
|
||||
title="HighlandGames-Trebsen-2024" alt="HighlandGames Trebsen 2024" style="width:100%" />
|
||||
Bei den Highland Games Trebsen 2024 konnten unsere Highlanders unter den Top 5 landen.
|
||||
</div>
|
||||
|
||||
<!-- Line Dance Promo-->
|
||||
<div class="newsBox">
|
||||
<h3>Line Dance</h3>
|
||||
<img src="https://img.webme.com/pic/c/cwsv-sport/DanceAcademyPoster-09-2024.jpg" title="Come dance with us"
|
||||
alt="Flyer Linedance" style="width:100%;" />
|
||||
<ul>
|
||||
<li>16--18:00 Uhr</li>
|
||||
<li>Turnhalle der Allende-Grundschule, Straße Usti nad Labem 279, 09119 Chemnitz</li>
|
||||
</ul>
|
||||
</div>
|
||||
<hr />
|
||||
<!-- Spenden Button--> <!-- Sollte vlt. nach corona nicht mehr so präsent mittig plaziert werden -->
|
||||
<!-- Spenden Button-->
|
||||
<div style="display: flex;justify-content: center;" align="center">
|
||||
<form action="https://www.paypal.com/donate" method="post" target="_top">
|
||||
<input type="hidden" name="hosted_button_id" value="8RYJXHP5X53LA" /> <input type="image"
|
||||
src="
https://www.paypalobjects.com/de_DE/DE/i/btn/btn_donateCC_LG.gif" name="submit"
|
||||
title="PayPal - The safer, easier way to pay
online!" alt="Donate with PayPal button" border="0" /> <img
|
||||
alt="" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" style="display: none !important;" x3i433pnl=""
|
||||
d22q4wuy3="" xmqo9fcaa="" pv56i2hu5="" width="1" hidden="" height="1" border="0" />
|
||||
d22q4wuy3="" xmqo9fcaa="" pv56i2hu5="" czfe9x85v="" o0aypinyl="" sb7ofhfmh="" vqrtauiqc="" jlm4vk2m1=""
|
||||
width="1" hidden="" height="1" border="0" />
|
||||
</form>
|
||||
</div>
|
||||
<h3 style="text-align:center;">CWSV e.V. - Sport für jedermann</h3>
|
||||
<div style="text-align:center;"><!--Automatisches Weihnachts- und Sylvesterlogo-->
|
||||
<!--Automatisches Weihnachts- und Sylvesterlogo-->
|
||||
<div style="text-align:center;">
|
||||
<script language="JavaScript">
|
||||
function getSeasonBanner() {
|
||||
var curDateTime = new Date()
|
||||
@@ -90,12 +105,12 @@
|
||||
document.write(getGreeting())
|
||||
</script>
|
||||
</div>
|
||||
<!-- Banner unten --> <a href="https://www.so-geht-saechsisch.de" title="So geht sächsisch"><img
|
||||
<!-- Banner unten --> <a href="https://www.so-geht-saechsisch.de" title="So geht sächsisch"> <img
|
||||
style="width:100%;" src="https://img.webme.com/pic/c/cwsv-sport/so-geht-saechsisch-2022.png"
|
||||
alt="So geht sächsisch" /></a> <img src="//img.webme.com/pic/c/cwsv-sport/LogoSmiVerein.2048w.png"
|
||||
alt="Gefördert vom Freistaat Sachsen" width="100%" /> <!-- Banner unten --> <img
|
||||
src="//img.webme.com/pic/c/cwsv-sport/bannerCwsvLinks.2048w.png"
|
||||
alt="Chemnitzer Freizeit- und Wohngebietssportverein e. V." width="100%" />
|
||||
alt="Chemnitzer Freizeit- und Wohngebietssportverein e. V." width="100%" /> <!-- static structured data infos -->
|
||||
<script type="application/ld+json"> {
|
||||
"@context" : "https://schema.org",
|
||||
"@type" : "SportsClub",
|
||||
|
||||
@@ -4,6 +4,8 @@ CSSO = node_modules/csso-cli/bin/csso
|
||||
|
||||
RES_LIST = 64 128 256 512
|
||||
|
||||
ANDROID_CHROME_ICON_RES_LIST
|
||||
|
||||
cssFiles = $(wildcard src/css/*.css)
|
||||
mdFiles = $(wildcard src/md/*.md)
|
||||
phpFiles = $(patsubst src/md/%.md, build/%.php, $(mdFiles))
|
||||
@@ -162,7 +164,7 @@ build/graphiken/cwsvLogoWappen/cwsvLogoWappen.%w.png: build/graphiken/cwsvLogoWa
|
||||
|
||||
|
||||
.PHONY: favIcons
|
||||
favIcons: build/graphiken/favIcons/favicon.ico
|
||||
favIcons: build/graphiken/favIcons/favicon.ico build/graphiken/favIcons/apple-touch-icon.png
|
||||
|
||||
build/graphiken/favIcons/favicon.ico: build/graphiken/cwsvJudoLogoWappen/cwsvJudoLogoWappen.png
|
||||
mkdir -p $(dir $@)
|
||||
@@ -173,3 +175,15 @@ build/graphiken/favIcons/favicon.ico: build/graphiken/cwsvJudoLogoWappen/cwsvJud
|
||||
-alpha on \
|
||||
-define icon:auto-resize=64,48,32,16 \
|
||||
$@
|
||||
|
||||
build/graphiken/favIcons/apple-touch-icon.png: build/graphiken/cwsvJudoLogoWappen/cwsvJudoLogoWappen.png
|
||||
mkdir -p $(dir $@)
|
||||
convert $< \
|
||||
-background transparent \
|
||||
-gravity center \
|
||||
-resize 180x180 \
|
||||
-extent 180x180 \
|
||||
$@
|
||||
pngquant --speed 1 --ext .png --force $@
|
||||
zopflipng -y --iterations=500 --filters=01234mepb --lossy_8bit --lossy_transparent $@ $@
|
||||
|
||||
|
||||
7
homepage/cwsvJudo/mirror-heliohost-graphics.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
open cwsvjudo@cwsvjudo.helioho.st
|
||||
set ssl:verify-certificate no
|
||||
set ftp:ssl-allow off
|
||||
mirror --verbose --continue --parallel=8 --reverse ./build/graphiken/cwsvJudoLogoWappen /httpdocs/ressourcen/graphiken/logos
|
||||
mirror --verbose --continue --parallel=8 --reverse ./build/graphiken/cwsvLogoWappen /httpdocs/ressourcen/graphiken/logos
|
||||
put -e -O /httpdocs/ ./build/graphiken/favIcons/apple-touch-icon.png
|
||||
exit
|
||||
6
homepage/cwsvJudo/participo/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# don't commit credentials
|
||||
db_root_password.txt
|
||||
db_password.txt
|
||||
# sql dump shall be created new every time (from the productive system)
|
||||
cwsvjudo.sql
|
||||
|
||||
17
homepage/cwsvJudo/participo/PHP.dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
# select base image
|
||||
FROM php:fpm
|
||||
|
||||
# startup scripts for the image
|
||||
# - docker-php-ext-install -- install helper script from PHP
|
||||
RUN docker-php-ext-install pdo pdo_mysql
|
||||
|
||||
# install and add xdebug extension
|
||||
# @todo What is pecl?
|
||||
# @todo What is xdebug and how do I use it?
|
||||
RUN pecl install xdebug && docker-php-ext-enable xdebug
|
||||
|
||||
RUN ls /home/ -lah
|
||||
ADD ./cwsvjudo@bplaced/www/participo /home/cwsvjudo/httpdocs/participo/lastLogins.json
|
||||
RUN chown -R www-data:www-data /home/cwsvjudo/httpdocs/participo/lastLogins.json
|
||||
|
||||
RUN ls -lah /home/cwsvjudo/httpdocs/participo/
|
||||
5
homepage/cwsvJudo/participo/bdCheck
Executable file
@@ -0,0 +1,5 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
cd /home/marko/cwsvJudo/homepage/participo/; . .venv/bin/activate; python bdCheck.py ; deactivate;
|
||||
|
||||
exit 0;
|
||||
3
homepage/cwsvJudo/participo/config-heliohost/.htaccess
Normal file
@@ -0,0 +1,3 @@
|
||||
order deny,allow
|
||||
deny from all
|
||||
allow from localhost
|
||||
13
homepage/cwsvJudo/participo/config-heliohost/participo.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/// @file some variable definitions
|
||||
|
||||
$config["home"] = "/home/cwsvjudo.helioho.st";
|
||||
$config['basePath'] = $config["home"] . '/httpdocs';
|
||||
$config['baseUrl'] = 'https://cwsvjudo.helioho.st';
|
||||
$config['ressourceUrl'] = 'https://cwsvjudo.helioho.st/ressourcen';
|
||||
|
||||
setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
set_include_path(implode(
|
||||
PATH_SEPARATOR,
|
||||
[get_include_path(), $config['basePath'], $config['basePath'] . '/ressourcen', $config['basePath'] . '/ressourcen/phpLib', './lib/']
|
||||
));
|
||||
@@ -0,0 +1,3 @@
|
||||
order deny,allow
|
||||
deny from all
|
||||
allow from localhost
|
||||
@@ -0,0 +1 @@
|
||||
<h1>Hello, World!</h1>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?
|
||||
echo __DIR__;
|
||||
@@ -3,6 +3,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . "./lib/");
|
||||
|
||||
// configs and local data
|
||||
require_once 'config/participo.php';
|
||||
require_once './local/cwsvJudo.php';
|
||||
|
||||
// libraries
|
||||
@@ -3,8 +3,8 @@
|
||||
<nav class="indigo darken-4">
|
||||
<div class="nav-wrapper">
|
||||
<div class="col s12">
|
||||
<a href="http://cwsvjudo.bplaced.net/participo" class="breadcrumb">cwsvJudo-Apps</a>
|
||||
<a href="http://cwsvjudo.bplaced.net/participo/admin" class="breadcrumb">
|
||||
<a href="/participo" class="breadcrumb">cwsvJudo-Apps</a>
|
||||
<a href="/participo/admin" class="breadcrumb">
|
||||
<?php echo($meta['title']); ?>
|
||||
</a>
|
||||
<a class="right top-nav sidenav-trigger waves-effect waves-light hide-on-large-only" href="#"
|
||||
@@ -24,7 +24,7 @@
|
||||
<li class="logo">
|
||||
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img"
|
||||
src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||
src="/ressourcen/graphiken/logos/cwsvJudoLogoWappen.256w.png" />
|
||||
</a>
|
||||
</li>
|
||||
<!-- brings its own li -->
|
||||
@@ -21,14 +21,12 @@ function init($config)
|
||||
|
||||
function authorize()
|
||||
{
|
||||
if (array_key_exists("HTTP_AUTHORIZATION", $_SERVER)) {
|
||||
if (!empty($_SERVER["HTTP_AUTHORIZATION"])) {
|
||||
if (array_key_exists("HTTP_AUTHORIZATION", $_SERVER) && (!empty($_SERVER["HTTP_AUTHORIZATION"])) ) {
|
||||
$auth = explode(" ", $_SERVER["HTTP_AUTHORIZATION"]);
|
||||
if ($auth[0] = "Basic") {
|
||||
$allowKey = ApiKey::loadFromDb($auth[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$allowKey || !$allowKey->isValidFor("api")) {
|
||||
die(
|
||||
@@ -9,6 +9,7 @@ setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
require_once './lib/db.php';
|
||||
require_once './lib/api.php';
|
||||
require_once './lib/participoLib/participo.php';
|
||||
require_once './lib/participoLib/user.php';
|
||||
|
||||
require_once $config['basePath'] . '/config/cwsvJudo.config.php';
|
||||
require_once $config['basePath'] . '/config/phpcount.config.php';
|
||||
@@ -21,7 +22,7 @@ setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
);
|
||||
|
||||
participo::authentificate();
|
||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||
$user = participo::sessionUser();
|
||||
$usersKids = getUsersKids(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||
|
||||
abstract class AttendanceType
|
||||
@@ -265,23 +266,23 @@ setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
|
||||
<header>
|
||||
<nav class="indigo darken-4">
|
||||
<a href="http://cwsvjudo.bplaced.net/participo" class="breadcrumb">cwsvJudo-Apps</a>
|
||||
<a href="http://cwsvjudo.bplaced.net/participo/attendance" class="breadcrumb">Anwesenheit</a>
|
||||
<a href="/participo" class="breadcrumb">cwsvJudo-Apps</a>
|
||||
<a href="/participo/attendance" class="breadcrumb">Anwesenheit</a>
|
||||
<a class="right top-nav sidenav-trigger waves-effect waves-light hide-on-large-only" href="#" data-target="nav-mobile"><i class="material-icons">menu</i></a>
|
||||
</nav>
|
||||
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
|
||||
<li class="logo">
|
||||
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="/ressourcen/graphiken/logos/cwsvJudoLogoWappen.256w.png" />
|
||||
</a>
|
||||
</li>
|
||||
<?php require_once 'sidenav/loginStatus.php'; ?><!-- brings its own li -->
|
||||
<li class="bold">
|
||||
<a class="waves-effect waves-teal right-align" href="#attendance-<?php echo($userData['id']); ?>">Selber</a>
|
||||
<a class="waves-effect waves-teal right-align" href="#attendance-<?php echo($user->getId()); ?>">Selber</a>
|
||||
</li>
|
||||
<?php
|
||||
foreach ($usersKids as $k) {
|
||||
if ($userData['id'] == $k['id']) {
|
||||
if ($user->getId() == $k['id']) {
|
||||
continue;
|
||||
} ?>
|
||||
<li class="bold">
|
||||
@@ -301,8 +302,8 @@ if ($_SESSION['login']) {
|
||||
$ownAttendances = Attendance::getUsersAttendance(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||
if (!empty($ownAttendances)) {
|
||||
echo(
|
||||
'<h2 id="attendance-' . $userData['id'] . '">Eigene Anwesenheiten</h2>' .
|
||||
Attendance::userAttendanceHtmlTable(dbConnector::getDbConnection(), $userData['id'])
|
||||
'<h2 id="attendance-' . $user->getId() . '">Eigene Anwesenheiten</h2>' .
|
||||
Attendance::userAttendanceHtmlTable(dbConnector::getDbConnection(), $user->getId())
|
||||
);
|
||||
require_once './lib/participoLib/participo.php';
|
||||
}
|
||||
@@ -310,7 +311,7 @@ if ($_SESSION['login']) {
|
||||
if (!empty($usersKids)) {
|
||||
echo('<h2>Anwesenheit der Kinder</h2>');
|
||||
foreach ($usersKids as $k) {
|
||||
if ($userData['id'] == $k['kidId']) {
|
||||
if ($user->getId() == $k['kidId']) {
|
||||
continue;
|
||||
}
|
||||
echo(
|
||||
@@ -0,0 +1,3 @@
|
||||
order deny,allow
|
||||
deny from all
|
||||
allow from localhost
|
||||
@@ -24,8 +24,6 @@ dbConnector::connect(
|
||||
|
||||
participo::authentificate();
|
||||
|
||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||
|
||||
$meta = [
|
||||
'title' => 'Event Planer',
|
||||
'description' => 'Planung von (Nicht-)Teilnahmen an Wettkämpfen und anderen Veranstaltungen'
|
||||
@@ -2,8 +2,8 @@
|
||||
<div>
|
||||
<nav class="indigo darken-4">
|
||||
<div class="nav-wrapper">
|
||||
<a href="http://cwsvjudo.bplaced.net/participo" class="breadcrumb">cwsvJudo-Apps</a>
|
||||
<a href="http://cwsvjudo.bplaced.net/participo/events" class="breadcrumb">
|
||||
<a href="/participo" class="breadcrumb">cwsvJudo-Apps</a>
|
||||
<a href="/participo/events" class="breadcrumb">
|
||||
<?php echo($meta['title']); ?>
|
||||
</a>
|
||||
<a class="right top-nav sidenav-trigger waves-effect waves-light hide-on-large-only" href="#"
|
||||
@@ -22,7 +22,7 @@
|
||||
<li class="logo">
|
||||
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img"
|
||||
src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||
src="/ressourcen/graphiken/logos/cwsvJudoLogoWappen.256w.png" />
|
||||
</a>
|
||||
</li>
|
||||
<!-- brings its own li -->
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -5,24 +5,25 @@ set_include_path(get_include_path() . PATH_SEPARATOR . "./lib/");
|
||||
// configs and local data
|
||||
// @todo Check and replace obsolete ones
|
||||
require_once 'config/participo.php';
|
||||
require_once 'config/phpcount.config.php';
|
||||
require_once 'local/cwsvJudo.php';
|
||||
// require_once 'config/phpcount.config.php';
|
||||
require_once $config['home'] . '/.local/cwsvJudo.config.php';
|
||||
|
||||
// legacy lib usage
|
||||
// @todo remove unused libraries
|
||||
require_once 'db.php'; // should be replaced
|
||||
require_once 'api.php'; // should be replaced
|
||||
// require_once 'api.php'; // should be replaced
|
||||
|
||||
// libraries
|
||||
require_once 'participoLib/participo.php';
|
||||
require_once 'participoLib/planer.php';
|
||||
require_once 'participoLib/apiKey.php';
|
||||
require_once 'phpcount/phpcount.php';
|
||||
|
||||
// require_once 'phpcount/phpcount.php';
|
||||
|
||||
// Add page hit
|
||||
PHPCount::AddHit('participo');
|
||||
// PHPCount::AddHit('participo');
|
||||
|
||||
// init the db connector
|
||||
// init the db connector
|
||||
dbConnector::connect(
|
||||
$cwsvJudoConfig['db']['host'],
|
||||
$cwsvJudoConfig['db']['name'],
|
||||
@@ -30,8 +31,5 @@ dbConnector::connect(
|
||||
$cwsvJudoConfig['db']['password']
|
||||
);
|
||||
|
||||
// authentication of the current user
|
||||
// authentication of the current user
|
||||
participo::authentificate();
|
||||
|
||||
// load the userData
|
||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||
@@ -14,8 +14,8 @@
|
||||
<title>participo</title>
|
||||
<meta name="description" content="Online-Apps der Judoka des Chemnitzer WSV">
|
||||
|
||||
<link rel="icon" href="<?echo($config['ressourceUrl']);?>/graphiken/icons/cwsv.ico" />
|
||||
<link rel="apple-touch-icon" href="<?echo($config['baseUrl']);?>/apple-touch-icon.png">
|
||||
<link rel="icon" href="<?php echo($config['ressourceUrl']);?>/graphiken/icons/cwsv.ico" />
|
||||
<link rel="apple-touch-icon" href="<?php echo($config['baseUrl']);?>/apple-touch-icon.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -29,7 +29,7 @@
|
||||
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
|
||||
<li class="logo">
|
||||
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="<?php echo($config['ressourceUrl']);?>/graphiken/logos/cwsvJudoLogoWappen.256w.png" />
|
||||
</a>
|
||||
</li>
|
||||
<?php require_once 'sidenav/loginStatus.php'; ?><!-- brings its own li -->
|
||||
@@ -45,7 +45,7 @@
|
||||
<li class="bold">
|
||||
<a class="waves-effect waves-teal right-align" href="#configApps">Einstellen<i class="material-icons">settings</i></a>
|
||||
</li>
|
||||
<?php if (participo::isUserAdmin($userData['id'])) {?>
|
||||
<?php if (participo::isUserAdmin()) {?>
|
||||
<li class="bold">
|
||||
<a class="waves-effect waves-teal right-align" href="#admiStuff">adminStuff</a>
|
||||
</li>
|
||||
@@ -101,7 +101,7 @@ echo(
|
||||
'link' => 'attendance',
|
||||
'title' => 'Teilnahme',
|
||||
'description' => 'Eine kleine Übersicht, wie wie oft man beim Training war',
|
||||
'imgUrl' => 'http://cwsvjudo.bplaced.net/ressourcen/graphiken/icons/calendarIcon.svg',
|
||||
'imgUrl' => $config['ressourceUrl'].'/graphiken/icons/calendarIcon.svg',
|
||||
'actions' => [
|
||||
AppCardAction::fromArray(['caption' => 'Anwesenheit', 'link' => 'attendance']),
|
||||
],
|
||||
@@ -127,7 +127,7 @@ echo(
|
||||
'link' => '/JudoWiki',
|
||||
'title' => 'JudoWiki',
|
||||
'description' => 'Ein Wiki zum Thema Judo',
|
||||
'imgUrl' => 'http://cwsvjudo.bplaced.net/ressourcen/graphiken/icons/wikipediaW.svg',
|
||||
'imgUrl' => $config['ressourceUrl'].'/graphiken/icons/wikipediaW.svg',
|
||||
'actions' => [
|
||||
AppCardAction::fromArray(['caption' => 'JudoWiki', 'link' => '/JudoWiki']),
|
||||
],
|
||||
@@ -154,10 +154,10 @@ echo(
|
||||
</div> <!-- configApps -->
|
||||
<?php
|
||||
// AdminStuff, thats only visible for Admins
|
||||
if (participo::isUserAdmin($userData['id'])) {
|
||||
if (participo::isUserAdmin()) {
|
||||
echo(
|
||||
'<h2>AdminStuff</h2>' .
|
||||
'<div id="admiStuff" class="row">' .
|
||||
'<div id="adminStuff" class="row">' .
|
||||
AppCard::fromArray([
|
||||
'title' => 'lastLogins',
|
||||
'description' => '</p>' . lastLoginTable() . '</p>'
|
||||
@@ -62,7 +62,7 @@ $years = array_unique($years);
|
||||
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
|
||||
<li class="logo">
|
||||
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
||||
<img style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||
<img style="max-width:100%;height:12vh;" class="responsive-img" src="/ressourcen/graphiken/logos/cwsvJudoLogoWappen.256w.png" />
|
||||
</a>
|
||||
</li>
|
||||
<li><?php require_once 'sidenav/loginStatus.php'; ?></li>
|
||||
@@ -234,7 +234,7 @@ function ytLightEmbed($item){
|
||||
<li>
|
||||
<a
|
||||
title="Seite auf HTML 5 Konformität prüfen"
|
||||
href="http://validator.w3.org/check?uri=<?php echo(urlencode(getCurPagesUrl()));?>"
|
||||
href="https://validator.w3.org/check?uri=<?php echo(urlencode(getCurPagesUrl()));?>"
|
||||
rel="nofollow"
|
||||
>Valid <img
|
||||
src="/ressourcen/graphiken/icons/HTML5_1Color_Black.svg"
|
||||
@@ -3,10 +3,10 @@
|
||||
function processPostData($db, $post, $redirectLocation = '.')
|
||||
{
|
||||
sleep(1);
|
||||
if ($post['action']) {
|
||||
// if there is a redirectlocation, set it
|
||||
if ($post['redirectLocation']) {
|
||||
$redirectLocation = $post['redirectLocation'];
|
||||
if (array_key_exists("action", $post)) {
|
||||
// if there is a redirectLocation, set it
|
||||
if (array_key_exists("redirectLocation", $post)) {
|
||||
$redirectLocation = filter_var($post['redirectLocation'], FILTER_SANITIZE_URL);
|
||||
}
|
||||
|
||||
// change a users password
|
||||
@@ -144,15 +144,14 @@ function changePassword($db, $changerId, $changeeId, $changerPassword, $newPassw
|
||||
{
|
||||
// we need a dbConnection
|
||||
if (!$db) {
|
||||
// echo("No DB!");
|
||||
return false;
|
||||
}
|
||||
// echo("No DB!");
|
||||
return false;
|
||||
}
|
||||
|
||||
$changerInfo = getUserData($db, $changerId);
|
||||
$changer = User::loadFromDb($db, $changerId);
|
||||
|
||||
// check the password of the changer
|
||||
if (!password_verify($changerPassword, $changerInfo['pwHash'])) {
|
||||
// echo("Wrong changerPasswod");
|
||||
if (!password_verify($changerPassword, $changer->getPwHash())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ if( empty($someOptions['dontFetch' ]) ) $someOptions['dontFetch' ] = false;
|
||||
array_walk(
|
||||
$entry,
|
||||
function (&$value, $key, $someOptions) {
|
||||
$value = iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value);
|
||||
$value = isset($value) ? iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value) : $value;
|
||||
},
|
||||
$someOptions
|
||||
);
|
||||
@@ -254,17 +254,6 @@ function isUserAdmin($dbConn, $userId){
|
||||
return false;
|
||||
}
|
||||
|
||||
function getUserData($db, $userId){
|
||||
$query = <<<SQL
|
||||
SELECT *
|
||||
FROM `cwsvjudo`.`wkParticipo_Users`
|
||||
WHERE `id` = :userId;
|
||||
SQL;
|
||||
$params = [':userId'=>['value'=>$userId, 'data_type'=>PDO::PARAM_INT]];
|
||||
$userData = dbQuery($db, $query, $params);
|
||||
return $userData[0];
|
||||
}
|
||||
|
||||
function getAchievements($db){
|
||||
$query = <<<SQL
|
||||
SELECT *
|
||||
@@ -380,24 +369,6 @@ SQL;
|
||||
return;
|
||||
}
|
||||
|
||||
function setRecord($db, $userId, $achievementGroupId, $value){
|
||||
$u = getUserData($db, $userId);
|
||||
$query = <<<SQL
|
||||
INSERT `cwsvjudo`.`machs_records`
|
||||
SET achievementGroupId=:achievementGroupId, ageClass=:ageClass, userId=:userId, value=:value
|
||||
SQL;
|
||||
$params=[
|
||||
':achievementGroupId' => ['value'=>$achievementGroupId, 'data_type'=>PDO::PARAM_INT],
|
||||
':ageClass' => ['value'=>record::birthday2ageClass($u['gebDatum']), 'data_type'=>PDO::PARAM_INT],
|
||||
':userId' => ['value'=>$userId, 'data_type'=>PDO::PARAM_INT],
|
||||
':value' => ['value'=>$value, 'data_type'=>PDO::PARAM_INT],
|
||||
];
|
||||
dbQuery($db, $query, $params, ['dontFetch'=>true]);
|
||||
//var_dump($userId, $achievementGroupId, $value);
|
||||
//var_dump($query, $params);
|
||||
return;
|
||||
}
|
||||
|
||||
function canUserGetAchievementToday($db, $userId){
|
||||
$achievements = getUsersAchievements($db, $userId);
|
||||
foreach($achievements as $a){
|
||||
@@ -83,7 +83,7 @@ class AgeGroup
|
||||
|
||||
preg_match($akUmatchString, $label, $matches);
|
||||
// The found match should cover the whole string. Otherwise it isn't applicable.
|
||||
if ($matches[0] == $label) {
|
||||
if (!empty($matches) && $matches[0] == $label) {
|
||||
// The x in Ux should be a positive integer.
|
||||
$ageLimit = filterPosInt($matches[2]);
|
||||
if ($ageLimit) {
|
||||
@@ -121,7 +121,7 @@ class AgeGroup
|
||||
preg_match($akUmatchString, $label, $matches);
|
||||
// The found match should cover the whole string. Otherwise it isn't applicable.
|
||||
|
||||
if ($matches[0] == $label) {
|
||||
if (!empty($matches) && $matches[0] == $label) {
|
||||
$lowerYear = filterPosInt($matches[1]);
|
||||
$upperYear = filterPosInt($matches[2]);
|
||||
|
||||
@@ -86,7 +86,7 @@ class dbConnector
|
||||
array_walk(
|
||||
$entry,
|
||||
function (&$value, $key, $someOptions) {
|
||||
$value = iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value);
|
||||
$value = isset($value) ? iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value) : $value;
|
||||
},
|
||||
$someOptions
|
||||
);
|
||||
@@ -119,7 +119,7 @@ class Event
|
||||
*/
|
||||
private static function loadFromDbById(int $id)
|
||||
{
|
||||
$query = 'SELECT * FROM `cwsvjudo`.`wkParticipo_Events` WHERE `id` = :id;';
|
||||
$query = 'SELECT * FROM `wkParticipo_Events` WHERE `id` = :id;';
|
||||
$params = [':id' => ['value' => $id, 'data_type' => PDO::PARAM_INT]];
|
||||
$response = dbConnector::query($query, $params);
|
||||
|
||||
@@ -165,13 +165,15 @@ class Event
|
||||
|
||||
public function getHtmlEventDetails()
|
||||
{
|
||||
$html .= '<dl>';
|
||||
$html .= '<dt>Datum</dt><dd>' . $this->event()->htmlDate() . '</dd>';
|
||||
$html .= '<dt>Deadline zum Einschreiben:</dt><dd>' . $this->event()->htmlDeadline() . '</dd>';
|
||||
$html = '<dl>';
|
||||
$html .= '<dt>Datum</dt><dd>' . $this->htmlDate() . '</dd>';
|
||||
$html .= '<dt>Deadline zum Einschreiben:</dt><dd>' . $this->htmlDeadline() . '</dd>';
|
||||
$html .= '</dl>';
|
||||
$html .= $this->event()->shiai()->getHtml();
|
||||
$html .= $this->event()->getHtmlStarterStatistic();
|
||||
$html .= $this->event()->getHtmlStarterList();
|
||||
$html .= $this->shiai()->getHtml();
|
||||
$html .= $this->getHtmlStarterStatistic();
|
||||
$html .= $this->getHtmlStarterList();
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function htmlTableRow()
|
||||
@@ -203,7 +205,7 @@ class Event
|
||||
$today = new DateTime();
|
||||
if (
|
||||
(isset($this->deadline) && ($today <= $this->deadline))
|
||||
|| participo::isUserAdmin($userData['id'])
|
||||
|| participo::isUserAdmin()
|
||||
) {
|
||||
$kids = participo::getKids();
|
||||
foreach ($kids as $k) {
|
||||
@@ -232,7 +234,7 @@ class Event
|
||||
if (!isset($listOfStarter) || count($listOfStarter) == 0) {
|
||||
return '';
|
||||
}
|
||||
$starterList .= 'Bereits eingetragen: <div class="row">';
|
||||
$starterList = 'Bereits eingetragen: <div class="row">';
|
||||
foreach ($listOfStarter as $start) {
|
||||
$startingUser = $start->loadStarter();
|
||||
$starterList .= '<div class="col s12 m6"><div class="row valign-wrapper">'
|
||||
@@ -311,7 +313,8 @@ class Event
|
||||
|
||||
public static function fromDbArray($member)
|
||||
{
|
||||
$shiai = json_decode($member['bemerkungen'], true);
|
||||
|
||||
$shiai = isset($member["bemerkungen"]) ? json_decode($member['bemerkungen'], true) : null;
|
||||
|
||||
return new event(
|
||||
$member['id'] ?? null,
|
||||
@@ -339,7 +342,7 @@ class Event
|
||||
|
||||
public static function getSeatCountOf(int $id)
|
||||
{
|
||||
$query = 'SELECT SUM(plaetze) AS sumSeats FROM `cwsvjudo`.`wkParticipo_Fahrten` WHERE eventId = :eventId;';
|
||||
$query = 'SELECT SUM(plaetze) AS sumSeats FROM `wkParticipo_Fahrten` WHERE eventId = :eventId;';
|
||||
$params = [
|
||||
'eventId' => ['value' => $id, 'data_type' => PDO::PARAM_INT]
|
||||
];
|
||||
@@ -641,7 +641,7 @@ function logLoginsToJsonFile($userName, $fileName = 'lastLogins.json')
|
||||
function getCurPagesUrl()
|
||||
{
|
||||
$pageURL = 'http';
|
||||
if ($_SERVER['HTTPS'] == 'on') {
|
||||
if ( array_key_exists("HTTPS", $_SERVER) && ($_SERVER['HTTPS'] == 'on')) {
|
||||
$pageURL .= 's';
|
||||
}
|
||||
$pageURL .= '://';
|
||||
@@ -129,7 +129,7 @@ class Shiai
|
||||
$id = filterId($id);
|
||||
|
||||
$query =
|
||||
"SELECT * FROM `cwsvjudo`.`wettkampfkalender` WHERE `lfdeNr` = :id;";
|
||||
"SELECT * FROM `wettkampfkalender` WHERE `lfdeNr` = :id;";
|
||||
$params = [":id" => ["value" => $id, "data_type" => PDO::PARAM_INT]];
|
||||
$response = dbConnector::query($query, $params);
|
||||
|
||||
@@ -51,7 +51,7 @@ class Starter
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->$result = filter_var($r, FILTER_VALIDATE_INT, ['options' => ['default' => null, 'min_range' => 0]]);
|
||||
$this->$result = filter_var($result, FILTER_VALIDATE_INT, ['options' => ['default' => null, 'min_range' => 0]]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,10 +254,19 @@ class User
|
||||
public function getDateOfBirth(){
|
||||
return $this->dateOfBirth;
|
||||
}
|
||||
|
||||
public function getStrBirthday(){
|
||||
return $this->dateOfBirth->format("Y-m-d");
|
||||
}
|
||||
|
||||
public function getEmail(){
|
||||
return $this->eMail;
|
||||
}
|
||||
|
||||
public function getPwHash(){
|
||||
return $this->pwHash;
|
||||
}
|
||||
|
||||
// static functions
|
||||
|
||||
/** Create a User from an assoziative array like it is returned from db requests
|
||||
@@ -284,8 +293,8 @@ class User
|
||||
$member[$columnMappings['vorname']] ?? null,
|
||||
$member[$columnMappings['gebDatum']] ?? null,
|
||||
array_key_exists($columnMappings['eMail'], $member) ? explode(',', $member['eMail']) : null,
|
||||
array_key_exists($columnMappings['config'], $member) ? json_decode($member['config']) : null,
|
||||
array_key_exists($columnMappings['pwHash'], $member) ? $member['pwHash'] : null
|
||||
array_key_exists($columnMappings['config'], $member) && isset($member[$columnMappings['config']]) ? json_decode($member[$columnMappings['config']]) : null,
|
||||
array_key_exists($columnMappings['pwHash'], $member) ? $member[$columnMappings['pwHash']] : null
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,9 @@ require_once 'participoLib/apiKey.php';
|
||||
|
||||
require_once './local/dbConf.php';
|
||||
|
||||
require_once $config['basePath'] . '/config/cwsvJudo.config.php';
|
||||
dbConnector::connect(
|
||||
require_once $config['home'] . '/.local/cwsvJudo.config.php';
|
||||
|
||||
$dbConnection = dbConnector::connect(
|
||||
$cwsvJudoConfig['db']['host'],
|
||||
$cwsvJudoConfig['db']['name'],
|
||||
$cwsvJudoConfig['db']['user'],
|
||||
@@ -0,0 +1,355 @@
|
||||
<?php
|
||||
/*
|
||||
* phpcount.php Ver.1.1- An "anoymizing" hit counter.
|
||||
* Copyright (C) 2013 Taylor Hornby
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This PHP Class provides a hit counter that is able to track unique hits
|
||||
* without recording the visitor's IP address in the database. It does so by
|
||||
* recording the hash of the IP address and page name.
|
||||
*
|
||||
* By hashing the IP address with page name as salt, you prevent yourself from
|
||||
* being able to track a user as they navigate your site. You also prevent
|
||||
* yourself from being able to recover anyone's IP address without brute forcing
|
||||
* through all of the assigned IP address blocks in use by the internet.
|
||||
*
|
||||
* Contact: havoc AT defuse.ca
|
||||
* WWW: https://defuse.ca/
|
||||
*
|
||||
* USAGE:
|
||||
* In your script, use reqire_once() to import this script, then call the
|
||||
* functions like PHPCount::AddHit(...); See each function for help.
|
||||
*
|
||||
* NOTE: You must set the database credentials in the InitDB method.
|
||||
*/
|
||||
|
||||
// global $phpcountConfig;
|
||||
// var_dump($phpcountConfig);
|
||||
|
||||
|
||||
class PHPCount
|
||||
{
|
||||
/*
|
||||
* Defines how many seconds a hit should be rememberd for. This prevents the
|
||||
* database from perpetually increasing in size. Thirty days (the default)
|
||||
* works well. If someone visits a page and comes back in a month, it will be
|
||||
* counted as another unique hit.
|
||||
*/
|
||||
const HIT_OLD_AFTER_SECONDS = 2592000; // default: 30 days.
|
||||
|
||||
// Don't count hits from search robots and crawlers.
|
||||
const IGNORE_SEARCH_BOTS = true;
|
||||
|
||||
// Don't count the hit if the browser sends the DNT: 1 header.
|
||||
const HONOR_DO_NOT_TRACK = false;
|
||||
|
||||
private static $IP_IGNORE_LIST = array(
|
||||
'127.0.0.1',
|
||||
);
|
||||
|
||||
private static $DB = false;
|
||||
|
||||
private static function InitDB()
|
||||
{
|
||||
global $phpcountConfig;
|
||||
// var_dump($phpcountConfig);
|
||||
|
||||
if(self::$DB)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
// TODO: Set the database login credentials.
|
||||
//echo("<!--");
|
||||
// var_dump($phpcountConfig);
|
||||
self::$DB = new PDO(
|
||||
'mysql:host='.$phpcountConfig["db"]["host"] .';dbname='.$phpcountConfig["db"]["name"],
|
||||
$phpcountConfig["db"]["user"], // Username
|
||||
$phpcountConfig["db"]["password"]//, // Password
|
||||
//array(PDO::ATTR_PERSISTENT => true)
|
||||
);
|
||||
//echo("-->");
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
self::$DB = false;
|
||||
echo("Failed to connect to phpcount database (".$e->getMessage().")\n");
|
||||
// die('Failed to connect to phpcount database ('.$e->getMessage().')');
|
||||
}
|
||||
}
|
||||
|
||||
public static function setDBAdapter($db)
|
||||
{
|
||||
self::$DB = $db;
|
||||
return $db;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a hit to a page specified by a unique $pageID string.
|
||||
*/
|
||||
public static function AddHit($pageID)
|
||||
{
|
||||
if(self::IGNORE_SEARCH_BOTS && self::IsSearchBot())
|
||||
return false;
|
||||
if(in_array($_SERVER['REMOTE_ADDR'], self::$IP_IGNORE_LIST))
|
||||
return false;
|
||||
if(
|
||||
self::HONOR_DO_NOT_TRACK &&
|
||||
isset($_SERVER['HTTP_DNT']) && $_SERVER['HTTP_DNT'] == "1"
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
self::InitDB();
|
||||
|
||||
self::Cleanup();
|
||||
if(self::UniqueHit($pageID))
|
||||
{
|
||||
self::CountHit($pageID, true);
|
||||
self::LogHit($pageID);
|
||||
}
|
||||
self::CountHit($pageID, false);
|
||||
|
||||
self::LogPageHit($pageID);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns (int) the amount of hits a page has
|
||||
* $pageID - the page identifier
|
||||
* $unique - true if you want unique hit count
|
||||
*/
|
||||
public static function GetHits($pageID, $unique = false){
|
||||
global $phpcountConfig;
|
||||
self::InitDB();
|
||||
|
||||
try{
|
||||
$q = self::$DB->prepare(
|
||||
'SELECT hitcount FROM '.$phpcountConfig["db"]["hitsTable"].'
|
||||
WHERE pageid = :pageid AND isunique = :isunique'
|
||||
);
|
||||
$q->bindParam(':pageid', $pageID);
|
||||
$q->bindParam(':isunique', $unique);
|
||||
$q->execute();
|
||||
}
|
||||
catch(Exeption $e){
|
||||
echo("Failed to getHits from phpcount database (".$e->getMessage().")\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(($res = $q->fetch()) !== FALSE)
|
||||
{
|
||||
return (int)$res['hitcount'];
|
||||
}
|
||||
else
|
||||
{
|
||||
//die("Missing hit count from database!");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the total amount of hits to the entire website
|
||||
* When $unique is FALSE, it returns the sum of all non-unique hit counts
|
||||
* for every page. When $unique is TRUE, it returns the sum of all unique
|
||||
* hit counts for every page, so the value that's returned IS NOT the
|
||||
* amount of site-wide unique hits, it is the sum of each page's unique
|
||||
* hit count.
|
||||
*/
|
||||
public static function GetTotalHits($unique = false){
|
||||
global $phpcountConfig;
|
||||
|
||||
self::InitDB();
|
||||
|
||||
$q = self::$DB->prepare(
|
||||
'SELECT hitcount FROM '.$phpcountConfig["db"]["hitsTable"].' WHERE isunique = :isunique'
|
||||
);
|
||||
$q->bindParam(':isunique', $unique);
|
||||
$q->execute();
|
||||
$rows = $q->fetchAll();
|
||||
|
||||
$total = 0;
|
||||
foreach($rows as $row)
|
||||
{
|
||||
$total += (int)$row['hitcount'];
|
||||
}
|
||||
return $total;
|
||||
}
|
||||
|
||||
/*====================== PRIVATE METHODS =============================*/
|
||||
|
||||
private static function IsSearchBot()
|
||||
{
|
||||
// Of course, this is not perfect, but it at least catches the major
|
||||
// search engines that index most often.
|
||||
$keywords = array(
|
||||
'bot',
|
||||
'spider',
|
||||
'spyder',
|
||||
'crawler',
|
||||
'walker',
|
||||
'search',
|
||||
'yahoo',
|
||||
'holmes',
|
||||
'htdig',
|
||||
'archive',
|
||||
'tineye',
|
||||
'yacy',
|
||||
'yeti',
|
||||
'Chrome-Lighthouse',
|
||||
'Barkrowler',
|
||||
);
|
||||
|
||||
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
|
||||
foreach($keywords as $keyword)
|
||||
{
|
||||
if(strpos($agent, $keyword) !== false)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static function UniqueHit($pageID){
|
||||
global $phpcountConfig;
|
||||
|
||||
$ids_hash = self::IDHash($pageID);
|
||||
|
||||
$q = self::$DB->prepare(
|
||||
'SELECT `time` FROM '.$phpcountConfig["db"]["nodupesTable"].' WHERE ids_hash = :ids_hash'
|
||||
);
|
||||
$q->bindParam(':ids_hash', $ids_hash);
|
||||
$q->execute();
|
||||
|
||||
if(($res = $q->fetch()) !== false)
|
||||
{
|
||||
if($res['time'] > time() - self::HIT_OLD_AFTER_SECONDS)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static function LogHit($pageID){
|
||||
global $phpcountConfig;
|
||||
|
||||
$ids_hash = self::IDHash($pageID);
|
||||
|
||||
$q = self::$DB->prepare(
|
||||
'SELECT `time` FROM '.$phpcountConfig["db"]["nodupesTable"].' WHERE ids_hash = :ids_hash'
|
||||
);
|
||||
$q->bindParam(':ids_hash', $ids_hash);
|
||||
$q->execute();
|
||||
|
||||
$curTime = time();
|
||||
|
||||
if(($res = $q->fetch()) !== false)
|
||||
{
|
||||
$s = self::$DB->prepare(
|
||||
'UPDATE '.$phpcountConfig["db"]["nodupesTable"].' SET `time` = :time WHERE ids_hash = :ids_hash'
|
||||
);
|
||||
$s->bindParam(':time', $curTime);
|
||||
$s->bindParam(':ids_hash', $ids_hash);
|
||||
$s->execute();
|
||||
}
|
||||
else
|
||||
{
|
||||
$s = self::$DB->prepare(
|
||||
'INSERT INTO '.$phpcountConfig["db"]["nodupesTable"].' (ids_hash, `time`)
|
||||
VALUES( :ids_hash, :time )'
|
||||
);
|
||||
$s->bindParam(':time', $curTime);
|
||||
$s->bindParam(':ids_hash', $ids_hash);
|
||||
$s->execute();
|
||||
}
|
||||
}
|
||||
|
||||
private static function LogPageHit($pageId){
|
||||
global $phpcountConfig;
|
||||
|
||||
try{
|
||||
$q = self::$DB->prepare(
|
||||
'INSERT INTO '.$phpcountConfig["db"]["pagehitsTable"].' (userHash, pageId, userAgentString) VALUES (:idsHash, :pageId, :userAgentString);'
|
||||
);
|
||||
$q->bindParam(':idsHash', self::userHash());
|
||||
$q->bindParam(':pageId', $pageId);
|
||||
$q->bindParam(':userAgentString', $_SERVER['HTTP_USER_AGENT']);
|
||||
$q->execute();
|
||||
}
|
||||
catch(Exeption $e){
|
||||
echo("Failed to logPageHits to phpcount database (".$e->getMessage().")\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static function CountHit($pageID, $unique){
|
||||
global $phpcountConfig;
|
||||
|
||||
//echo("DEBUG: Counting Hit on ".$pageID."\n");
|
||||
try{
|
||||
$q = self::$DB->prepare(
|
||||
"INSERT INTO ".$phpcountConfig["db"]["hitsTable"]." (pageid, isunique, hitcount) VALUES (:pageid, :isunique, 1) " .
|
||||
"ON DUPLICATE KEY UPDATE hitcount = hitcount + 1"
|
||||
);
|
||||
$q->bindParam(':pageid', $pageID);
|
||||
$unique = $unique ? '1' : '0';
|
||||
$q->bindParam(':isunique', $unique);
|
||||
$q->execute();
|
||||
}
|
||||
catch(Exception $e){
|
||||
die('phpcount failed to CountHit ('.$e->getMessage().')');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static function IDHash($pageID)
|
||||
{
|
||||
$visitorID = $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT'];
|
||||
return hash("SHA256", $pageID . $visitorID);
|
||||
}
|
||||
|
||||
private static function userHash()
|
||||
{
|
||||
$visitorID = $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT'];
|
||||
return hash("SHA256", $visitorID);
|
||||
}
|
||||
|
||||
private static function Cleanup(){
|
||||
global $phpcountConfig;
|
||||
|
||||
$last_interval = time() - self::HIT_OLD_AFTER_SECONDS;
|
||||
|
||||
$q = self::$DB->prepare(
|
||||
'DELETE FROM '.$phpcountConfig["db"]["nodupesTable"].' WHERE `time` < :time'
|
||||
);
|
||||
$q->bindParam(':time', $last_interval);
|
||||
$q->execute();
|
||||
|
||||
$q = self::$DB->prepare(
|
||||
'DELETE FROM '.$phpcountConfig["db"]["pageHitsTable"].' WHERE `timeStamp` < :time'
|
||||
);
|
||||
$q->bindParam(':time', $last_interval);
|
||||
$q->execute();
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@
|
||||
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
|
||||
<li class="logo">
|
||||
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="/ressourcen/graphiken/logos/cwsvJudoLogoWappen.256w.png" />
|
||||
</a>
|
||||
</li>
|
||||
<?php require_once "sidenav/loginStatus.php"; ?><!-- brings its own li -->
|
||||
@@ -13,7 +13,7 @@
|
||||
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
|
||||
<li class="logo">
|
||||
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="/ressourcen/graphiken/logos/cwsvJudoLogoWappen.256w.png" />
|
||||
</a>
|
||||
</li>
|
||||
<?php require_once("sidenav/loginStatus.php");?><!-- brings its own li -->
|
||||
@@ -20,7 +20,7 @@ dbConnector::connect(
|
||||
);
|
||||
|
||||
participo::authentificate();
|
||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||
$user = participo::sessionUser();
|
||||
$usersKids = getUsersKids(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||
|
||||
processPostData(dbConnector::getDbConnection(), $_POST);
|
||||
@@ -63,7 +63,7 @@ processPostData(dbConnector::getDbConnection(), $_POST);
|
||||
<li class="logo">
|
||||
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
||||
<img style="max-width:100%;height:12vh;" class="responsive-img"
|
||||
src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||
src="/ressourcen/graphiken/logos/cwsvJudoLogoWappen.256w.png" />
|
||||
</a>
|
||||
</li>
|
||||
<li><?php require_once 'sidenav/loginStatus.php'; ?>
|
||||
@@ -103,18 +103,18 @@ if ($_SESSION['login']) {
|
||||
<div style="margin:1%;" class="card blue-grey darken-1">
|
||||
<div class="card-content white-text">
|
||||
<span
|
||||
class="card-title"><?php echo($userData['name']); ?>,
|
||||
<?php echo($userData['vorname']); ?></span>
|
||||
class="card-title"><?php echo($user->getName()); ?>,
|
||||
<?php echo($user->getFirstName()); ?></span>
|
||||
<img style="max-height:10vh;" class="responsive-img" src="images/account.svg" />
|
||||
<dl>
|
||||
<dt>Name</dt>
|
||||
<dd><?php echo($userData['name']); ?>
|
||||
<dd><?php echo($user->getName()); ?>
|
||||
</dd>
|
||||
<dt>Vorname</dt>
|
||||
<dd><?php echo($userData['vorname']); ?>
|
||||
<dd><?php echo($user->getFirstName()); ?>
|
||||
</dd>
|
||||
<dt>Email</dt>
|
||||
<dd><?php echo($userData['eMail']); ?>
|
||||
<dd><?php echo($user->getEmail()); ?>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -138,9 +138,9 @@ if ($_SESSION['login']) {
|
||||
<input name="action" type="hidden" value="changePassword" />
|
||||
<input name="redirectLocation" type="hidden" value="./user" />
|
||||
<input name="changerId" type="hidden"
|
||||
value="<?php echo($userData['id']); ?>" />
|
||||
value="<?php echo($user->getId()); ?>" />
|
||||
<input name="changeeId" type="hidden"
|
||||
value="<?php echo($userData['id']); ?>" />
|
||||
value="<?php echo($user->getId()); ?>" />
|
||||
<fieldset>
|
||||
<legend>Neues Passwort vergeben</legend>
|
||||
<div>
|
||||
@@ -215,7 +215,7 @@ if ($_SESSION['login']) {
|
||||
<input name="action" type="hidden" value="changePassword" />
|
||||
<input name="redirectLocation" type="hidden" value="./user" />
|
||||
<input name="changerId" type="hidden"
|
||||
value="<?php echo($userData['id']); ?>" />
|
||||
value="<?php echo($user->getId()); ?>" />
|
||||
<input name="changeeId" type="hidden"
|
||||
value="<?php echo($kid['kidId']); ?>" />
|
||||
<input name="newPassword" type="hidden" value="" />
|
||||
@@ -238,7 +238,7 @@ if ($_SESSION['login']) {
|
||||
<input name="action" type="hidden" value="changePassword" />
|
||||
<input name="redirectLocation" type="hidden" value="./user" />
|
||||
<input name="changerId" type="hidden"
|
||||
value="<?php echo($userData['id']); ?>" />
|
||||
value="<?php echo($user->getId()); ?>" />
|
||||
<input name="changeeId" type="hidden"
|
||||
value="<?php echo($kid['kidId']); ?>" />
|
||||
<fieldset>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?
|
||||
phpinfo();
|
||||
1
homepage/cwsvJudo/participo/db_password.txt.template
Normal file
@@ -0,0 +1 @@
|
||||
insert_MYSQL_PASSWORD_here_and_remove_template_in_filename
|
||||
@@ -0,0 +1 @@
|
||||
insert_MYSQL_ROOT_PASSWORD_here_and_remove_template_in_filename
|
||||
8
homepage/cwsvJudo/participo/docker-clean
Executable file
@@ -0,0 +1,8 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# stop all containers
|
||||
docker-compose down --remove-orphans
|
||||
# delete all containers
|
||||
docker rm -f $(docker ps -a -q)
|
||||
# delete all volumes
|
||||
docker volume rm $(docker volume ls -q)
|
||||
81
homepage/cwsvJudo/participo/docker-compose.yml
Normal file
@@ -0,0 +1,81 @@
|
||||
# version for the docker compose file to use
|
||||
version: "3"
|
||||
|
||||
# a dict of services running in the container label: {<service>} label is a self defined name for the service
|
||||
services:
|
||||
# the webserver service
|
||||
web:
|
||||
image: nginx:latest
|
||||
# port forwarding
|
||||
ports:
|
||||
# forward port 80 top port 80 in the container
|
||||
- "80:80"
|
||||
# files and directories to be available in the container
|
||||
# - localPath:pathInContainer
|
||||
volumes:
|
||||
# nginx config file
|
||||
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf
|
||||
# the app itself
|
||||
- ./cwsvjudo@bplaced/www/participo:/home/cwsvjudo/httpdocs/participo
|
||||
# the apps config files
|
||||
- ./config-heliohost/cwsvJudo.config.php:/home/cwsvjudo/.local/cwsvJudo.config.php
|
||||
# ressourcen
|
||||
- /home/marko/cwsvJudo/submodules/materialize/dist:/home/cwsvjudo/httpdocs/ressourcen/materializeCss
|
||||
- /home/marko/cwsvJudo/homepage/cwsvJudo/build/graphiken:/home/cwsvjudo/httpdocs/ressourcen/graphiken
|
||||
# php and extensions
|
||||
php:
|
||||
# use pre-build image from docker..
|
||||
# image: php:fpm
|
||||
# .. or build your own image
|
||||
build:
|
||||
context: .
|
||||
dockerfile: PHP.dockerfile
|
||||
# files and directories to be available in the container
|
||||
# @todo Except from better structuring: Is there a reason for not having the volumes as one central list?
|
||||
volumes:
|
||||
# the app itself
|
||||
- ./cwsvjudo@bplaced/www/participo:/home/cwsvjudo/httpdocs/participo
|
||||
# the apps config files
|
||||
- ./config-heliohost/cwsvJudo.config.php:/home/cwsvjudo/.local/cwsvJudo.config.php
|
||||
# @todo Maybe use postgre instead?
|
||||
database:
|
||||
image: mariadb:latest
|
||||
restart: always
|
||||
# define environment variables
|
||||
# @todo Should credentials be placed here? Even if it is just a test environment
|
||||
environment:
|
||||
# MYSQL_TCP_PORT: 1433
|
||||
MYSQL_USER: 'cwsvjudo'
|
||||
MYSQL_DATABASE: 'cwsvjudo'
|
||||
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
|
||||
MYSQL_PASSWORD_FILE: /run/secrets/db_password
|
||||
volumes:
|
||||
- mysqldata:/var/lib/mysql
|
||||
# initial database
|
||||
# - has to be created first, e.g., by dumping the database from the productive system
|
||||
- ./cwsvjudo.sql:/docker-entrypoint-initdb.d/cwsvjudo.sql
|
||||
|
||||
secrets:
|
||||
- db_root_password
|
||||
- db_password
|
||||
# phpmyadmin
|
||||
phpmyadmin:
|
||||
image: phpmyadmin:latest
|
||||
restart: always
|
||||
depends_on:
|
||||
- database
|
||||
ports:
|
||||
- 8080:80
|
||||
environment:
|
||||
# name of the host is the name of the db service started above! Why? I don't know!
|
||||
- PMA_HOST=database
|
||||
- PMA_PORT=1433
|
||||
volumes:
|
||||
# data storage for the db
|
||||
mysqldata: {}
|
||||
|
||||
secrets:
|
||||
db_root_password:
|
||||
file: db_root_password.txt
|
||||
db_password:
|
||||
file: db_password.txt
|
||||
@@ -0,0 +1,7 @@
|
||||
open cwsvjudo@cwsvjudo.helioho.st
|
||||
set ssl:verify-certificate no
|
||||
set ftp:ssl-allow off
|
||||
mirror --verbose --continue --parallel=8 --reverse ./cwsvjudo@bplaced/www/participo /httpdocs/participo
|
||||
put -e -O /httpdocs/participo/config ./config-heliohost/participo.php
|
||||
put -e -O /.local ./config-heliohost/cwsvJudo.config.php
|
||||
# exit
|
||||
23
homepage/cwsvJudo/participo/nginx.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
# @todo Needs helpfull comments.
|
||||
server {
|
||||
listen 80 default_server;
|
||||
# root /users/cwsvjudo/www;
|
||||
root /home/cwsvjudo/httpdocs;
|
||||
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location / {
|
||||
# rewrite rules
|
||||
# - add php to requested filename if it exists
|
||||
if (-e $request_filename.php) {
|
||||
rewrite ^/(.*)$ /$1.php last;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php:9000;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
2
homepage/cwsvJudo/participo/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
requests
|
||||
/home/marko/keeper/try-matrix-nio/MatrixIm
|
||||
2
homepage/cwsvJudo/participo/testApi.config.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
apiKey: "5fPs3G1JsAj"
|
||||
host: "cwsvjudo.bplaced.net"
|
||||