Review main Abandoned

69333[TASK] Streamline some ext:beuser code smells

Christian Kuhn CR 0 V 0 Hard +269 −200 updated 06/02/21, 12:45

Commit message

* The switch user functionality is now a proper extbase
  action instead of a GeneralUtility::_GP() based switch
  in indexAction().
* The switch user view helper is obsoleted by adding a helper
  to BackendUser model and moving markup to fluid.
* The BackendUser model uses strict typing and no longer
  extends extbase generic BackendUser model since ext:beuser
  overrides some details and needs some more specific things.
  Further patches in this area will follow.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 11

Review log 1725

  1. Christian Kuhn uploaded patch set 1 05/31/21, 11:09

  2. core-ci voted on patch set 1 V +1 05/31/21, 11:21 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12027

  3. Christian Kuhn uploaded patch set 2 05/31/21, 13:54

  4. core-ci voted on patch set 2 V +1 05/31/21, 14:03 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12040

  5. Christian Kuhn uploaded patch set 3 05/31/21, 14:07

  6. core-ci voted on patch set 3 V +1 05/31/21, 14:17 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12041

  7. Christian Kuhn uploaded patch set 4 06/01/21, 05:50

  8. Christian Kuhn commented on patch set 4 06/01/21, 05:56

    resolved conflict
  9. core-ci voted on patch set 4 V +1 06/01/21, 05:59 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12056

  10. Oli Bartsch commented on patch set 4 06/01/21, 06:46

    BackendUserController.php:547

    Is this check really required? Actually the models' `isAllowedToSwitchTo` function checks, if the target user is not the current user, is active (disable=0) and if not already in switch user session.

    BackendUser.php:70

    Missing empty line here and also for the other setters below.

    BackendUser.php:82

    :void should be added to those setters.

    BackendUser.php:90

    This sounds odd. Should be "isAdministrator".

    Classes.php:12

    Isn't "is.." more a name for the getter then? So the fields should IMO just be named "administrator" and "disabled".

    Classes.php:21

    No really strong preference, but I would name it "startDateTime". Don't get the additional "and".

    IndexListRow.html:115

    Since this will return a bool, I would prefer !{backendUser.allowedToSwitchTo} here. However, not really that important.
  11. Jochen Roth commented on patch set 4 06/01/21, 09:36

    BackendUserController.php:561

    Multiple spaces

    BackendUser.php:102

    If above comment applies this should also be changed to "isDisabled"
  12. Anja Leichsenring commented on patch set 4 06/01/21, 17:17

    BackendUserController.php:550

    using a use statement for a top level Exception is not prefered
  13. Christian Kuhn commented on patch set 4 06/01/21, 18:14

    BackendUserController.php:547 Reply

    I'd opt to keep it this way at the moment: I'll change the BackendUser model with a next patch anyways and could then fetch the user with a repository->findBy here and use it ... maybe keep for now and adapt then?

    BackendUserController.php:550 Reply

    Done

    BackendUserController.php:561 Reply

    Done

    BackendUser.php:70 Reply Unresolved

    i think it's better readable if these getters/setters are paired. the setters will vanish with my next patch anyways ;)

    BackendUser.php:82 Reply

    Done

    BackendUser.php:90 Reply

    Done

    BackendUser.php:102 Reply

    Done

    Classes.php:12 Reply

    Done

    Classes.php:21 Reply

    let's not do that now ... this file will vanish soon, and it's currently a copy of those things I needed from the extbase base model.

    IndexListRow.html:115 Reply Unresolved

    I wanted the "empty" icon in "then" to be in line with the other things above.
  14. Christian Kuhn uploaded patch set 5 06/01/21, 18:15

  15. core-ci voted on patch set 5 V -1 06/01/21, 18:17 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12096

  16. Christian Kuhn uploaded patch set 6 06/01/21, 18:38

  17. core-ci voted on patch set 6 V +1 06/01/21, 18:50 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12101

  18. Oli Bartsch uploaded patch set 7 06/01/21, 20:36

  19. Oli Bartsch commented on patch set 7 V +1 CR +1 06/01/21, 20:41

    BackendUserController.php:547 Reply

    Done

    Classes.php:21 Reply

    Done
  20. core-ci voted on patch set 7 V +1 06/01/21, 20:45 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12109

  21. Benjamin Franzke uploaded patch set 8 06/02/21, 02:54

  22. Benjamin Franzke commented on patch set 8 06/02/21, 02:54

    BackendUser.php:240 Unresolved

    I think the usage of `$GLOBALS['BE_USER']` reveals that this method is not "really" properly suited for being added to this data model. Yes, isPasswordResetEnabled() does the same, but I'd rather see the usages of $GLOBALS['BE_USER'] to be reduced. Any chance to split this into two commits? a) switch user handling b) model adaptions (and then including the follow ups you already mention in the commit message)

    IndexListRow.html:120 Unresolved

    As already discussed in slack, let's additionally use a POST request instead of GET. Separate action is good though (and although a separate route would be nicer, I guess actions are fine in this extbase context).
  23. core-ci voted on patch set 8 V +1 06/02/21, 03:05 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12116

  24. Christian Kuhn abandoned the change 06/02/21, 12:37

  25. Christian Kuhn commented on patch set 8 06/02/21, 12:45

    this is maybe split into smaller patches.