From: Mischa POSLAWSKY
Date: Thu, 14 Jun 2018 08:59:49 +0000 (+0200)
Subject: login/edit: target user data distinct from login
X-Git-Tag: v3.1~18
X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/2f8daf093a4587ca30630d2aaa7e0a373d4afb45
login/edit: target user data distinct from login
Prepare for admin control.
---
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)) {