TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask Class Reference
Inheritance diagram for TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask:
TYPO3\CMS\Scheduler\Task\AbstractTask tx_saltedpasswords_Tasks_BulkUpdate

Public Member Functions

 __construct ()
 
 execute ()
 
 getAdditionalInformation ()
 
 setCanDeactivateSelf ($canDeactivateSelf)
 
 getCanDeactivateSelf ()
 
 setNumberOfRecords ($numberOfRecords)
 
 getNumberOfRecords ()
 
- Public Member Functions inherited from TYPO3\CMS\Scheduler\Task\AbstractTask
 __construct ()
 
 execute ()
 
 getAdditionalInformation ()
 
 setTaskUid ($id)
 
 getTaskUid ()
 
 getTaskTitle ()
 
 getTaskDescription ()
 
 getTaskClassName ()
 
 isDisabled ()
 
 setDisabled ($flag)
 
 setExecutionTime ($timestamp)
 
 getTaskGroup ()
 
 setTaskGroup ($taskGroup)
 
 getExecutionTime ()
 
 setDescription ($description)
 
 getDescription ()
 
 setScheduler ()
 
 unsetScheduler ()
 
 setExecution (\TYPO3\CMS\Scheduler\Execution $execution)
 
 getExecution ()
 
 getNextDueExecution ()
 
 areMultipleExecutionsAllowed ()
 
 isExecutionRunning ()
 
 markExecution ()
 
 unmarkExecution ($executionID, \Exception $failure=NULL)
 
 unmarkAllExecutions ()
 
 save ()
 
 stop ()
 
 remove ()
 

Protected Member Functions

 findUsersToUpdate ($mode)
 
 convertPasswords ($mode, array $users)
 
 isSaltedHash ($password)
 
 isMd5Password ($password)
 
 incrementUserRecordPointer ($mode, $number)
 
 activateSelf ()
 
 deactivateSelf ()
 

Protected Attributes

 $canDeactivateSelf = TRUE
 
 $numberOfRecords = 250
 
 $userRecordPointer = array()
 
- Protected Attributes inherited from TYPO3\CMS\Scheduler\Task\AbstractTask
 $scheduler
 
 $taskUid
 
 $disabled = FALSE
 
 $execution
 
 $executionTime = 0
 
 $description = ''
 
 $taskGroup
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Update plaintext and hashed passwords of existing users to salted passwords.

Author
Christian Kuhn lolli.nosp@m.@sch.nosp@m.warzb.nosp@m.u.ch
Marcus Krause <marcus::exp2010.info>

Definition at line 22 of file BulkUpdateTask.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::__construct ( )

Constructor initializes user record pointer

Definition at line 47 of file BulkUpdateTask.php.

Member Function Documentation

◆ activateSelf()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::activateSelf ( )
protected

Activates this task instance. Uses setDisabled() method of parent

Returns
void

Definition at line 211 of file BulkUpdateTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\setDisabled().

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\execute().

◆ convertPasswords()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::convertPasswords (   $mode,
array  $users 
)
protected

Iterates over given user records and update password if needed.

Parameters
string$mode'FE' for frontend, 'BE' for backend user records
array$usersWith user uids and passwords
Returns
void

Definition at line 120 of file BulkUpdateTask.php.

References $GLOBALS, TYPO3\CMS\Saltedpasswords\Salt\SaltFactory\getSaltingInstance(), TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\isMd5Password(), and TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\isSaltedHash().

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\execute().

◆ deactivateSelf()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::deactivateSelf ( )
protected

Deactivates this task instance. Uses setDisabled() method of parent

Returns
void

Definition at line 221 of file BulkUpdateTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\setDisabled().

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\execute().

◆ execute()

◆ findUsersToUpdate()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::findUsersToUpdate (   $mode)
protected

Finds next set of frontend or backend users to update.

Parameters
string$mode'FE' for frontend, 'BE' for backend user records
Returns
array Rows with uid and password

Definition at line 108 of file BulkUpdateTask.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\execute().

◆ getAdditionalInformation()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::getAdditionalInformation ( )

Get additional information

Returns
string Additional information

Definition at line 97 of file BulkUpdateTask.php.

References $GLOBALS, TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\getCanDeactivateSelf(), and TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\getNumberOfRecords().

◆ getCanDeactivateSelf()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::getCanDeactivateSelf ( )

Get if it can deactivate self

Returns
boolean TRUE if task shall deactivate itself, FALSE otherwise

Definition at line 240 of file BulkUpdateTask.php.

References TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\$canDeactivateSelf.

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\getAdditionalInformation().

◆ getNumberOfRecords()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::getNumberOfRecords ( )

Get number of records

Returns
integer The number of records

Definition at line 259 of file BulkUpdateTask.php.

References TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\$numberOfRecords.

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\getAdditionalInformation().

◆ incrementUserRecordPointer()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::incrementUserRecordPointer (   $mode,
  $number 
)
protected

Increments current user record counter by number of handled rows.

Parameters
string$mode'FE' for frontend, 'BE' for backend user records
integer$numberNumber of handled rows
Returns
void

Definition at line 201 of file BulkUpdateTask.php.

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\execute().

◆ isMd5Password()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::isMd5Password (   $password)
protected

Checks if a given password is a md5 hash, the default for be_user records before saltedpasswords.

Parameters
string$passwordThe password to test
Returns
boolean TRUE if password is md5

Definition at line 190 of file BulkUpdateTask.php.

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\convertPasswords().

◆ isSaltedHash()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::isSaltedHash (   $password)
protected

Passwords prefixed with M or C might be salted passwords: M means: originally a md5 hash before it was salted (eg. default be_users). C means: originally a cleartext password with lower hash looping count generated by t3sec_saltedpw. Both M and C will be updated to usual salted hashes on first login of user.

If a password does not start with M or C determine if a password is already a usual salted hash.

Parameters
string$passwordPassword
Returns
boolean TRUE if password is a salted hash

Definition at line 171 of file BulkUpdateTask.php.

References TYPO3\CMS\Saltedpasswords\Salt\SaltFactory\determineSaltingHashingMethod().

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\convertPasswords().

◆ setCanDeactivateSelf()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::setCanDeactivateSelf (   $canDeactivateSelf)

Set if it can deactivate self

Parameters
boolean$canDeactivateSelf
Returns
void

Definition at line 231 of file BulkUpdateTask.php.

References TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\$canDeactivateSelf.

◆ setNumberOfRecords()

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::setNumberOfRecords (   $numberOfRecords)

Set number of records

Parameters
integer$numberOfRecords
Returns
void

Definition at line 250 of file BulkUpdateTask.php.

References TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\$numberOfRecords.

Member Data Documentation

◆ $canDeactivateSelf

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::$canDeactivateSelf = TRUE
protected

◆ $numberOfRecords

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::$numberOfRecords = 250
protected

◆ $userRecordPointer

TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask::$userRecordPointer = array()
protected

Definition at line 42 of file BulkUpdateTask.php.