From 2f8daf093a4587ca30630d2aaa7e0a373d4afb45 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 14 Jun 2018 10:59:49 +0200 Subject: [PATCH] login/edit: target user data distinct from login Prepare for admin control. --- login/edit.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/login/edit.php b/login/edit.php index ba7e785..0a90e0e 100644 --- a/login/edit.php +++ b/login/edit.php @@ -1,15 +1,16 @@ Het is niet mogelijk om de gebruiker $user aan te passen.

\n\n"; + $username = ltrim($Args, '/'); + $user = [ + 'dir' => "profile/$username", + ]; + if (!is_writable($user['dir'])) { + print "

Het is niet mogelijk om de gebruiker {$user['name']} aan te passen.

\n\n"; return; } } @@ -19,11 +20,11 @@ $cols = [ ]; foreach ($cols as $col => &$colconf) { - $colpath = "$userdir/$col.txt"; + $colpath = "{$user['dir']}/$col.txt"; if (file_exists($colpath)) { $colconf['value'] = file_get_contents($colpath); } - if (!is_writable($userdir)) { + if (!is_writable($user['dir'])) { continue; # locked parent directory } if (isset($colconf['value']) and !is_writable($colpath)) { -- 2.30.0