From 1df0d6467575a4664c03f02ecc471870b4cfb93b Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 18 Oct 2019 21:18:38 +0200 Subject: [PATCH] login/edit: allow setup form for missing users Fix creation since validation added in commit v3.6-0-gd1fc7642f0 (2018-08-11) [login/emulate: request page as different user]. --- auth.inc.php | 4 ++-- widget/login/edit.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/auth.inc.php b/auth.inc.php index a1ccedf..a792ef6 100644 --- a/auth.inc.php +++ b/auth.inc.php @@ -3,9 +3,9 @@ date_default_timezone_set('Europe/Amsterdam'); class User { - function __construct($dir) + function __construct($dir, $existing = TRUE) { - if (!file_exists($dir)) { + if (!file_exists($dir) and $existing) { throw new Exception("Gebruiker niet gevonden in $dir"); } $this->dir = $dir; diff --git a/widget/login/edit.php b/widget/login/edit.php index d8114ff..22ad878 100644 --- a/widget/login/edit.php +++ b/widget/login/edit.php @@ -8,7 +8,7 @@ if ($User->admin('user') and !empty($Place['user']) and $Place['user'] !== $User->login) { $username = strtolower($Place['user']); unset($user); - $user = new User("profile/$username"); + $user = new User("profile/$username", FALSE); } require_once('edit.inc.php'); -- 2.30.0