[TASK] Re-enable disabled saltedpasswords task if not finished 25/23425/3
authorNicole Cordes <typo3@cordes.co>
Wed, 28 Aug 2013 14:50:21 +0000 (16:50 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 28 Aug 2013 17:22:00 +0000 (19:22 +0200)
If you start a disabled saltedpasswords task it begins to look over all
users again. If it didn't process all users the current position is saved
but there is no message to the backend user that the processing is not
finished. Therefore the task should re-enable itself to be able to
process remaining users.

Resolves: #51465
Releases: 6.2
Change-Id: Ia0abf76af2ba91b68d05f0837dda950660f52c1c
Reviewed-on: https://review.typo3.org/23425
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/saltedpasswords/Classes/Task/BulkUpdateTask.php

index b7c7b0a..c948cf4 100644 (file)
@@ -79,6 +79,7 @@ class BulkUpdateTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
                                $numberOfRows = count($usersToUpdate);
                                if ($numberOfRows > 0) {
                                        $processedAllRecords = FALSE;
+                                       $this->activateSelf();
                                        $this->incrementUserRecordPointer($mode, $numberOfRows);
                                        $this->convertPasswords($mode, $usersToUpdate);
                                }
@@ -214,6 +215,16 @@ class BulkUpdateTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
        }
 
        /**
+        * Activates this task instance.
+        * Uses setDisabled() method of parent \TYPO3\CMS\Scheduler\Task\AbstractTask
+        *
+        * @return void
+        */
+       protected function activateSelf() {
+               $this->setDisabled(FALSE);
+       }
+
+       /**
         * Deactivates this task instance.
         * Uses setDisabled() method of parent \TYPO3\CMS\Scheduler\Task\AbstractTask
         *