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 over 13 years ago. Updated about 6 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 #1

Updated by Tobias Schmidt about 11 years ago

This issue is still valid with TYPO3 4.5.29.

Actions #2

Updated by Mathias Schreiber almost 10 years ago

  • Status changed from New to Closed
  • Is Regression set to No

will be tackeld together with #31110

Actions #3

Updated by Gerrit Code Review over 9 years ago

  • Status changed from Closed to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41712

Actions #4

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41712

Actions #5

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41712

Actions #6

Updated by Gerrit Code Review over 9 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41712

Actions #7

Updated by Daniel Goerz over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF