X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FUser.php;h=d65e7d8f9699e41aabadb406bd3034bd7da2266f;hb=c083ae047c4259dcfa1c61a3795679bbf1b08d8c;hp=502bc4c97c1339e45e4eaa8403a9c5fcffa7bc5b;hpb=7f3fb34c24e30b79d8c25f63dbb2c3c3da79e599;p=friendica.git diff --git a/src/Model/User.php b/src/Model/User.php index 502bc4c97c..d65e7d8f96 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -71,9 +71,11 @@ class User public static function getOwnerDataByNick($nick) { $user = DBA::selectFirst('user', ['uid'], ['nickname' => $nick]); + if (!DBA::isResult($user)) { return false; } + return self::getOwnerDataById($user['uid']); } @@ -728,13 +730,16 @@ class User DBA::insert('userd', ['username' => $user['nickname']]); // The user and related data will be deleted in "cron_expire_and_remove_users" (cronjobs.php) - DBA::update('user', ['account_removed' => true, 'account_expires_on' => DateTimeFormat::utcNow()], ['uid' => $uid]); + DBA::update('user', ['account_removed' => true, 'account_expires_on' => DateTimeFormat::utc(DateTimeFormat::utcNow() . " + 7 day")], ['uid' => $uid]); Worker::add(PRIORITY_HIGH, "Notifier", "removeme", $uid); // Send an update to the directory $self = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]); Worker::add(PRIORITY_LOW, "Directory", $self['url']); + // Remove the user relevant data + Worker::add(PRIORITY_LOW, "RemoveUser", $uid); + if ($uid == local_user()) { unset($_SESSION['authenticated']); unset($_SESSION['uid']);