login/edit: move admin block to distinct widget
[minimedit.git] / widget / login / edit.php
index 0d61a4f2a029e2ffa2a3758da6e09c8f47ee1fe9..8f96bbd28222cf403f9c87d460721f85f7754609 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");
+if (!$user) {
+       return;
 }
 
 require_once('edit.inc.php');
@@ -160,8 +156,8 @@ if ($_POST) {
                print "<p>Alle instellingen zijn opgeslagen.</p>\n\n";
        }
 }
-
 ?>
+
 <form method="post" enctype="multipart/form-data">
        <ul class="grid">
 <?php
@@ -173,7 +169,7 @@ foreach ($cols as $col => &$colconf) {
        print "\t";
        printf('<li><label for="%s">%s:</label>', $col, ucfirst($colconf['label']));
        if (@$colconf['type'] == 'file' and isset($colconf['value'])) {
-               $target = $user['dir'] . '/' . $colconf['filename'];
+               $target = $user->dir . '/' . $colconf['filename'];
                printf('<a href="/%s"><img src="/thumb/%s/%s?%s" /></a><br />',
                        $target,
                        200, $target, filemtime($target)