WIP: bring participo back - consistent use of bootstrap - formatting -
phpstan level 0 error free - fixes for kyu subpage - move mams into participo framework - remove legacy `lib/db.php` usage - add attributer admin function - add newsposter - fixing apiKey creation
This commit is contained in:
@@ -1,30 +1,17 @@
|
||||
<?php
|
||||
setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
require_once 'config/participo.php';
|
||||
require_once "bootstrap.php";
|
||||
|
||||
require_once './local/dbConf.php';
|
||||
require_once './local/cwsvJudo.php';
|
||||
require_once "participoLib/participo.php";
|
||||
|
||||
require_once './lib/participoLib/participo.php';
|
||||
require_once './lib/db.php';
|
||||
require_once './lib/api.php';
|
||||
// @todo Legacy libs! Remove!
|
||||
require_once "./lib/api.php";
|
||||
|
||||
require_once $config['basePath'] . '/config/cwsvJudo.config.php';
|
||||
require_once $config['basePath'] . '/config/phpcount.config.php';
|
||||
participo::init($CONFIG["cwsvJudo"], $SECRETS["cwsvJudo"]);
|
||||
|
||||
dbConnector::connect(
|
||||
$cwsvJudoConfig['db']['host'],
|
||||
$cwsvJudoConfig['db']['name'],
|
||||
$cwsvJudoConfig['db']['user'],
|
||||
$cwsvJudoConfig['db']['password']
|
||||
);
|
||||
|
||||
participo::authentificate();
|
||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||
$usersKids = getUsersKids(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||
$userData = getUserData($_SESSION["user"]["userId"]);
|
||||
$usersKids = getUsersKids($_SESSION["user"]["userId"]);
|
||||
|
||||
processPostData(dbConnector::getDbConnection(), $_POST);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -33,7 +20,7 @@ processPostData(dbConnector::getDbConnection(), $_POST);
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<?php readfile('./shared/imports.php'); ?>
|
||||
<?php readfile("./shared/imports.php"); ?>
|
||||
<!-- inits for the materializeCss -->
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
@@ -47,8 +34,8 @@ processPostData(dbConnector::getDbConnection(), $_POST);
|
||||
<title>User-Config</title>
|
||||
<meta name="description" content="Benutzereinstellungen">
|
||||
|
||||
<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="/ressourcen/graphiken/icons/cwsv.ico" />
|
||||
<link rel="apple-touch-icon" href="/ressourcen/ressourcen/graphiken/logos/favIcons/apple-touch-icon.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -63,10 +50,10 @@ 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'; ?>
|
||||
<li><?php require_once "sidenav/loginStatus.php"; ?>
|
||||
</li>
|
||||
<li class="bold">
|
||||
<a class="waves-effect waves-teal" href="/participo">zurück</a>
|
||||
@@ -80,20 +67,17 @@ processPostData(dbConnector::getDbConnection(), $_POST);
|
||||
</ul>
|
||||
</header>
|
||||
|
||||
<?php
|
||||
if ($_SESSION['login']) {
|
||||
?>
|
||||
<?php if ($_SESSION["login"]) { ?>
|
||||
<main>
|
||||
<h1>Benutzer-Einstellungen</h1>
|
||||
<p>
|
||||
<?php
|
||||
if (array_key_exists('changePasswordSuccess', $_GET)) {
|
||||
if ($_GET['changePasswordSuccess'] == 'true') {
|
||||
echo('<div>Password geändert</div>');
|
||||
} else {
|
||||
echo('<div>Fehler während des Setzens des Passwortes.</div>');
|
||||
}
|
||||
} ?>
|
||||
<?php if (array_key_exists("changePasswordSuccess", $_GET)) {
|
||||
if ($_GET["changePasswordSuccess"] == "true") {
|
||||
echo "<div>Password geändert</div>";
|
||||
} else {
|
||||
echo "<div>Fehler während des Setzens des Passwortes.</div>";
|
||||
}
|
||||
} ?>
|
||||
</p>
|
||||
<h2>Benutzer-Info</h2>
|
||||
<p>Informationen zum eigenen Benutzerkonto</p>
|
||||
@@ -103,18 +87,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 $userData["name"]; ?>,
|
||||
<?php echo $userData["vorname"]; ?></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 $userData["name"]; ?>
|
||||
</dd>
|
||||
<dt>Vorname</dt>
|
||||
<dd><?php echo($userData['vorname']); ?>
|
||||
<dd><?php echo $userData["vorname"]; ?>
|
||||
</dd>
|
||||
<dt>Email</dt>
|
||||
<dd><?php echo($userData['eMail']); ?>
|
||||
<dd><?php echo $userData["eMail"]; ?>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -138,9 +122,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 $userData["id"]; ?>" />
|
||||
<input name="changeeId" type="hidden"
|
||||
value="<?php echo($userData['id']); ?>" />
|
||||
value="<?php echo $userData["id"]; ?>" />
|
||||
<fieldset>
|
||||
<legend>Neues Passwort vergeben</legend>
|
||||
<div>
|
||||
@@ -175,24 +159,23 @@ if ($_SESSION['login']) {
|
||||
<p>Liste der User, für die man meldeberechtigt ist (bzw. Änderungen vornehmen darf). In der Regel ist das das
|
||||
eigene Kind (bei Eltern) oder man selber (bei Volljährigen).</p>
|
||||
<div class="row" id="kidsList">
|
||||
<?php
|
||||
foreach ($usersKids as $kid) { ?>
|
||||
<?php foreach ($usersKids as $kid) { ?>
|
||||
<div style="padding:1%;" class="col s12 m6">
|
||||
<div style="margin:1%;" class="card blue-grey darken-1">
|
||||
<div class="card-content white-text">
|
||||
<span
|
||||
class="card-title"><?php echo($kid['name']); ?>,
|
||||
<?php echo($kid['vorname']); ?></span>
|
||||
class="card-title"><?php echo $kid["name"]; ?>,
|
||||
<?php echo $kid["vorname"]; ?></span>
|
||||
<img style="max-height:10vh;" class="responsive-img" src="images/account.svg" />
|
||||
<dl>
|
||||
<dt>Name</dt>
|
||||
<dd><?php echo($kid['name']); ?>
|
||||
<dd><?php echo $kid["name"]; ?>
|
||||
</dd>
|
||||
<dt>Vorname</dt>
|
||||
<dd><?php echo($kid['vorname']); ?>
|
||||
<dd><?php echo $kid["vorname"]; ?>
|
||||
</dd>
|
||||
<dt>Geb.datum</dt>
|
||||
<dd><?php echo($kid['gebDatum']); ?>
|
||||
<dd><?php echo $kid["gebDatum"]; ?>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -203,11 +186,10 @@ if ($_SESSION['login']) {
|
||||
Wettkämpfen anmelden. Das eigene Passwort muss dabei noch einmal zur Kontrolle eingegeben
|
||||
werden. Das neue Passwort muss zweimal blind eingegeben.</p>
|
||||
<p>
|
||||
<?php
|
||||
if (($kid['pwHash'] == '') || ($kid['pwHash']) == null) {
|
||||
echo('<p>Derzeit ist kein Passwort gesetzt!</p>');
|
||||
} else {
|
||||
echo('<p>Es ist derzeit ein Passwort gesetzt!</p>'); ?>
|
||||
<?php if ($kid["pwHash"] == "" || $kid["pwHash"] == null) {
|
||||
echo "<p>Derzeit ist kein Passwort gesetzt!</p>";
|
||||
} else {
|
||||
echo "<p>Es ist derzeit ein Passwort gesetzt!</p>"; ?>
|
||||
<p>Es besteht auch die Möglickeit, das Passwort ganz zu entfernen. Man kann sich dann nicht mehr mit
|
||||
diesem Konto einloggen. Das eigene Passwort muss dabei noch einmal zur Kontrolle eingegeben
|
||||
werden.</p>
|
||||
@@ -215,9 +197,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 $userData["id"]; ?>" />
|
||||
<input name="changeeId" type="hidden"
|
||||
value="<?php echo($kid['kidId']); ?>" />
|
||||
value="<?php echo $kid["kidId"]; ?>" />
|
||||
<input name="newPassword" type="hidden" value="" />
|
||||
<input name="newPasswordAgain" type="hidden" value="" />
|
||||
<fieldset>
|
||||
@@ -231,16 +213,15 @@ if ($_SESSION['login']) {
|
||||
</fieldset>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
} ?>
|
||||
</p>
|
||||
<form action="./user" method="post">
|
||||
<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 $userData["id"]; ?>" />
|
||||
<input name="changeeId" type="hidden"
|
||||
value="<?php echo($kid['kidId']); ?>" />
|
||||
value="<?php echo $kid["kidId"]; ?>" />
|
||||
<fieldset>
|
||||
<legend>Neues Passwort vergeben</legend>
|
||||
<div>
|
||||
@@ -268,12 +249,9 @@ if ($_SESSION['login']) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} ?>
|
||||
<?php } ?>
|
||||
</main>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user