login/edit: user override in page code
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 25 Oct 2019 23:59:54 +0000 (01:59 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 9 Nov 2019 06:08:13 +0000 (07:08 +0100)
login/edit/index.php
widget/login/edit.php

index c56109fbd53df0992d186019fba7fc5e3d53d127..fb668cfbe4fb3262bce8857f7cfb732e9ec2664f 100644 (file)
@@ -1,6 +1,8 @@
 <?php
-if ($Args) {
-       $Place['user'] = ltrim($Args, '/');
-       include 'login/edit/index.html';
+if ($Args and $User->admin('user')) {
+       $user = new User(strtolower("profile$Args"), FALSE);
+       $Article->title = "Profiel <em>{$user->login}</em>";
+       print "<h2>{$Article->title}</h2>\n";
+       print placeholder_include('login/edit');
        return;
 }
index bb0f75ca28f0947db9b076b0ef4dc4e884394ab1..8fd3824f3dd28ce776bd7ca6dcbc683a9e9e84fb 100644 (file)
@@ -1,14 +1,10 @@
 <?php
-global $User;
-if (empty($user = &$User)) {
-       return;
+global $User, $user;
+if (!$user) {
+       $user = $User;
 }
-
-if ($User->admin('user')
-and !empty($Place['user']) and $Place['user'] !== $User->login) {
-       $username = strtolower($Place['user']);
-       unset($user);
-       $user = new User("profile/$username", FALSE);
+if (!$user) {
+       return;
 }
 
 require_once('edit.inc.php');