]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/ExpireAndRemoveUsers.php
Continued:
[friendica.git] / src / Worker / ExpireAndRemoveUsers.php
index f7591bf4a32f91f7ae5dfe0c8e33c509eff63be9..747c8e08961fa9e0b5adf260171208e8649a9e71 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2023, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -36,13 +36,13 @@ class ExpireAndRemoveUsers
 {
        public static function execute()
        {
-               // expire any expired regular accounts. Don't expire forums.
+               // expire any expired regular accounts. Don't expire groups.
                $condition = ["NOT `account_expired` AND `account_expires_on` > ? AND `account_expires_on` < ? AND `page-flags` = ? AND `uid` != ?",
                        DBA::NULL_DATETIME, DateTimeFormat::utcNow(), User::PAGE_FLAGS_NORMAL, 0];
                DBA::update('user', ['account_expired' => true], $condition);
 
                // Ensure to never remove the user with uid=0
-               DBA::update('user', ['account_expired' => false, 'account_removed' => false,
+               DBA::update('user', ['verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false,
                        'account_expires_on' => DBA::NULL_DATETIME], ['uid' => 0]);
 
                // Remove any freshly expired account
@@ -98,7 +98,7 @@ class ExpireAndRemoveUsers
                        // Delete the contacts of this user
                        $self = DBA::selectFirst('contact', ['nurl'], ['self' => true, 'uid' => $user['uid']]);
                        if (DBA::isResult($self)) {
-                               $result = DBA::delete('contact', ["`nurl` = ? AND NOT `self` AND `uid` != ?", $self['nurl'], 0]);
+                               $result = DBA::delete('contact', ['nurl' => $self['nurl'], 'self' => false]);
                                if ($result) {
                                        Logger::debug('Deleted the user contact for other users', ['result' => $result, 'rows' => DBA::affectedRows()]);
                                } else {