Hanno Böck
Spaces between string concat (.) operator, new PER codingstyle
Hanno Böck commited 354c05a at 2023-10-31 17:49:30
initialize_useraccount.php
<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
This code is published under a 0BSD license.
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
*/
require_once('newpass.php');
require_once('inc/security.php');
title("Passwort setzen");
$show = 'token';
if (isset($_SESSION['role']) && $_SESSION['role'] != ROLE_ANONYMOUS) {
@session_destroy();
header('Location: ' . $_SERVER['PHP_SELF']);
die();
}
if (isset($_REQUEST['token'])) {
$token = $_REQUEST['token'];
$uid = get_uid_for_token($token);
if ($uid != null && validate_uid_token($uid, $token)) {
$show = 'agb';
if (isset($_REQUEST['agb']) && $_REQUEST['agb'] == '1') {
$show = 'password';
}
if (isset($_POST['password'])) {
if ($_POST['password'] != $_POST['password2']) {
input_error("Die beiden Passwort-Eingaben stimmen nicht überein.");
} elseif ($_POST['password'] == '') {
input_error("Es kann kein leeres Passwort gesetzt werden");
} elseif (preg_match('/["\'\\\\]/', $_POST['password']) === 1) {
input_error("Das Passwort enthält problematische Zeichen. Bitte keine Anführungszeichen und kein Backslash benutzen.");
} elseif (($result = strong_password($_POST['password'])) !== true) {
input_error("Das Passwort ist zu einfach ({$result})!");
} else {
require_once('session/checkuser.php');
require_once('inc/base.php');
logger(LOG_INFO, "modules/index/initialize_useraccount", "initialize", "uid »{$uid}« set a new password");
set_systemuser_password($uid, $_POST['password']);
invalidate_systemuser_token($uid);
$_SESSION['role'] = find_role($uid, '', true);
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX