Project

General

Profile

Actions

Bug #27440

closed

Task center - sys_action: Prefix added to username over and over again when editing BE-User

Added by Tobias Schmidt almost 13 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-06-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Since TYPO3 4.4 it is necessary to remove the prefix from a username if the BE-User is beeing edited through the task center - sys-action interface. Otherwise the prefix is added again to the already prefixed username.

In TYPO3 4.3 this problem was handled by the fixUsername method. It checked if the username began with the prefix and removed it with preg_replace before saving:

function fixUsername($username,$prefix)    {
    $username=trim($username);
    $prefix=trim($prefix);
    $username=preg_replace('/^'.quotemeta($prefix).'/','',$username);
    if ($username) {
        return $prefix.$username;
    } else return false;
}

Since TYPO3 4.4 the fixUsername method is simplified to this:

private function fixUsername($username, $prefix) {
    return trim($prefix) . trim($username);
}

Is there any good reason for this oversimplification?

If not, it would make sense to me to switch back to the old TYPO3 4.3 version of this method. Maybe with a small modification to allow prefix and username to be the same:

private function fixUsername($username, $prefix) {
    $username=trim($username);
    $prefix=trim($prefix);
    if($username !== $prefix){
        $username=preg_replace('/^'.quotemeta($prefix).'/','',$username);
    }
    if ($username)    {
        return $prefix.$username;
    } else {
        return false;
    }


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #25700: Task center - sys_action: Password should not be required when editing BE-UserClosed2011-04-01

Actions
Related to TYPO3 Core - Bug #25329: Task center - sys_action: Usergroups are not selected.Closed2011-03-15

Actions
Related to TYPO3 Core - Bug #31110: unable to edit user in sys_action taskClosed2011-10-19

Actions
Actions

Also available in: Atom PDF