- if ($log = @fopen("$userdir/last.log", 'w')) {
- fwrite($log, "{$_SERVER['REMOTE_ADDR']} {$_SERVER['HTTP_USER_AGENT']}\n");
- }
-
- return [
- 'name' => $inuser,
- 'dir' => $userdir,
- 'admin' => file_exists("$userdir/.admin"),
- 'pass' => $usertest,
- 'auth' => "$inuser:$authhash",
- ];
+ $user = new User($userdir);
+ $user->logclient();
+ $user->pass = $usertest;
+ $user->auth = "$inuser:$authhash";
+ return $user;