if (!$isAdmin) { setError('Du bist kein Administrator!'); header("location: {$SETTINGS['url']}/"); exit; } if (!isset($_GET['id'])) { header("location: {$SETTINGS['url']}/"); exit; } $userid = $_GET['id']; if (isset($_POST['lastname'])) { $newlastname = trim($_POST['lastname']); if (strlen($newlastname) < 2) { setError('Dein Nachname ist ungütig!'); } else { if (setLastName($userid, $newlastname)) { setInfo('Nachname wurde gespeichert!'); } else { setError('Fehler beim speichern des Nachnamen!'); } } header("location: {$SETTINGS['url']}/user/{$userid}"); exit; } if (isset($_POST['password'])) { $password = $_POST['password']; if (strlen(trim($password)) < 5) { setError('Passwort zu kurz!'); } else { if (setPassword($userid, $password)) { setInfo('Passwort gespeichert!');
require_once 'lib/users.php'; require_once 'lib/session.php'; require_once 'lib/login.php'; require_once 'lib/voc.php'; if (!connect_mysql()) { exit; } include 'lib/loginfilter.php'; include 'lib/navbar.php'; $lastname = htmlspecialchars($_SESSION['userinfo']->lastname, 0, 'UTF-8'); if (isset($_POST['lastname'])) { $newlastname = trim($_POST['lastname']); if (strlen($newlastname) < 2) { setError('Dein Nachname ist ungütig!'); } else { if (setLastName($_SESSION['userid'], $newlastname)) { $_SESSION['userinfo']->lastname = $newlastname; setInfo('Nachname wurde gespeichert!'); } else { setError('Fehler beim speichern des Nachnamen!'); } } header("location: {$SETTINGS['url']}/settings"); exit; } if (isset($_POST['password']) && isset($_POST['password2'])) { $password = $_POST['password']; $password2 = $_POST['password2']; if (strlen(trim($password)) < 5) { setError('Passwort zu kurz!'); } else {