login/edit: allow setup form for missing users
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 18 Oct 2019 19:18:38 +0000 (21:18 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 19 Oct 2019 00:26:35 +0000 (02:26 +0200)
Fix creation since validation added in commit v3.6-0-gd1fc7642f0
(2018-08-11) [login/emulate: request page as different user].

auth.inc.php
widget/login/edit.php

index a1ccedf50cf16ea328ac107e4c8ee8fd9326fa15..a792ef6838e13383a6b130facde423ad37a8c0d5 100644 (file)
@@ -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;
index d8114ff07b065bb8f8b056453442ddc9a0225c7e..22ad87856056039fd775062f4a2abca3361cce79 100644 (file)
@@ -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');