244 lines
8.9 KiB
PHP
244 lines
8.9 KiB
PHP
<?php
|
|
setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|
require_once 'config/participo.php';
|
|
|
|
require_once './local/dbConf.php';
|
|
require_once './local/cwsvJudo.php';
|
|
|
|
require_once './lib/participoLib/participo.php';
|
|
require_once './lib/db.php';
|
|
require_once './lib/api.php';
|
|
|
|
|
|
require_once $config['basePath'] . '/config/cwsvJudo.config.php';
|
|
require_once $config['basePath'] . '/config/phpcount.config.php';
|
|
|
|
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']);
|
|
|
|
processPostData(dbConnector::getDbConnection(), $_POST);
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
<?php readfile('./shared/imports.php'); ?>
|
|
<!-- inits for the materializeCss -->
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
var elems = document.querySelectorAll('.sidenav');
|
|
var instances = M.Sidenav.init(elems, {
|
|
// specify options here
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<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">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<header>
|
|
<nav class="indigo darken-4">cwsvJudo Apps<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 style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
|
</a>
|
|
</li>
|
|
<li><?php require_once 'sidenav/loginStatus.php'; ?></li>
|
|
<li class="bold">
|
|
<a class="waves-effect waves-teal" href="/participo">zurück</a>
|
|
</li>
|
|
<li class="bold">
|
|
<a class="waves-effect waves-teal" href="/participo/user#userInfos">Config</a>
|
|
</li>
|
|
<li class="bold">
|
|
<a class="waves-effect waves-teal" href="/participo/user#kidsList">Kinder</a>
|
|
</li>
|
|
</ul>
|
|
</header>
|
|
|
|
<?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 setzens des Passwortes.</div>');
|
|
}
|
|
} ?>
|
|
</p>
|
|
<h2>Benutzer-Info</h2>
|
|
<p>Informationen zum eigenen Benutzerkonto</p>
|
|
<div id="userInfos" class="row">
|
|
|
|
<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($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>
|
|
<dt>Vorname</dt><dd><?php echo($userData['vorname']); ?></dd>
|
|
<dt>Email</dt><dd><?php echo($userData['eMail']); ?></dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
<div class="card-action">
|
|
<!--
|
|
<a href="">kommt bald</a>
|
|
-->
|
|
</div>
|
|
</div>
|
|
|
|
<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">Passwort setzen</span>
|
|
Im folgenden Formular kann das Passwort geändert werden. Man sollte darauf achten, dass man beim <a href="https://www.bsi-fuer-buerger.de/BSIFB/DE/Empfehlungen/Passwoerter/Umgang/umgang_node.html">Umgang mit Passwörtern</a> die nötige Vorsicht walten lässt.
|
|
<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']); ?>" />
|
|
<input name="changeeId" type="hidden" value="<?php echo($userData['id']); ?>" />
|
|
<fieldset>
|
|
<legend>Neues Passwort vergeben</legend>
|
|
<div>
|
|
<label for="changerPassword">Eigenes Passwort</label>
|
|
<input type="password" name="changerPassword" id="changerPassword" />
|
|
</div>
|
|
<div>
|
|
<label for="newPassword">Neues Passwort</label>
|
|
<input type="password" name="newPassword" id="newPassword" />
|
|
</div>
|
|
<div>
|
|
<label for="newPasswordAgain">Neues Passwort wiederholen</label>
|
|
<input type="password" name="newPasswordAgain" id="newPasswordAgain" />
|
|
</div>
|
|
</fieldset>
|
|
<fieldset>
|
|
<div><button type="submit">Passwort neu setzen</button></div>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="card-action">
|
|
<!--
|
|
<a href="">kommt bald</a>
|
|
-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<h2>Berechtigungen</h2>
|
|
|
|
<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) { ?>
|
|
<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>
|
|
<img style="max-height:10vh;" class="responsive-img" src="images/account.svg" />
|
|
<dl>
|
|
<dt>Name</dt><dd><?php echo($kid['name']); ?></dd>
|
|
<dt>Vorname</dt><dd><?php echo($kid['vorname']); ?></dd>
|
|
<dt>Geb.datum</dt><dd><?php echo($kid['gebDatum']); ?></dd>
|
|
</dl>
|
|
</div>
|
|
|
|
<span class="card-title">Passwort</span>
|
|
<p>Im folgenden Formular kann das Passwort des Kindes gesetzt werden. 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>'); ?>
|
|
<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>
|
|
<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']); ?>" />
|
|
<input name="changeeId" type="hidden" value="<?php echo($kid['kidId']); ?>" />
|
|
<input name="newPassword" type="hidden" value="" />
|
|
<input name="newPasswordAgain" type="hidden" value="" />
|
|
<fieldset>
|
|
<div>
|
|
<label for="changerPassword">Eigenes Passwort</label>
|
|
<input type="password" name="changerPassword" id="changerPassword" />
|
|
</div>
|
|
</fieldset>
|
|
<fieldset>
|
|
<div><button type="submit">Passwort entfernen</button></div>
|
|
</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']); ?>" />
|
|
<input name="changeeId" type="hidden" value="<?php echo($kid['kidId']); ?>" />
|
|
<fieldset>
|
|
<legend>Neues Passwort vergeben</legend>
|
|
<div>
|
|
<label for="changerPassword">Eigenes Passwort</label>
|
|
<input type="password" name="changerPassword" id="changerPassword" />
|
|
</div>
|
|
<div>
|
|
<label for="newPassword">Neues Passwort des Kindes</label>
|
|
<input type="password" name="newPassword" id="newPassword" />
|
|
</div>
|
|
<div>
|
|
<label for="newPasswordAgain">Neues Passwort wiederholen</label>
|
|
<input type="password" name="newPasswordAgain" id="newPasswordAgain" />
|
|
</div>
|
|
</fieldset>
|
|
<fieldset>
|
|
<div><button type="submit">Passwort neu setzen</button></div>
|
|
</fieldset>
|
|
</form>
|
|
|
|
<div class="card-action">
|
|
<!--
|
|
<a href="">kommt bald</a>
|
|
-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
} ?>
|
|
</main>
|
|
<?php
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|