Review main Merged

21591[TASK] Backend user management: add delete button

Krzysztof Adamczyk CR +2 V +2 Normal +61 −1 updated 06/25/13, 19:10

Commit message

Add remove button in the backend users list with
a confirmation dialog.

Review

  • Code review CR +2
    • Philipp Gampe +2
    • Wouter Wolters +1
  • Verified V +2
    • Philipp Gampe +2
    • Wouter Wolters +1

Issues 1

Files 3

Review log 34

Show 9 earlier messages
  1. Mr. Jenkins commented on patch set 1 06/22/13, 14:02

  2. Philipp Gampe commented on patch set 1 CR -1 06/22/13, 14:50

    wrong position
  3. Wouter Wolters commented on patch set 1 06/22/13, 14:55

    wrong review, this isn't a helpful answer for a new contributor.. now he doesn't know what to improve
  4. Philipp Gampe uploaded patch set 2 06/22/13, 14:56

  5. Mr. Jenkins commented on patch set 2 06/22/13, 14:57

  6. Philipp Gampe commented on patch set 2 V +1 CR +1 06/22/13, 14:57

    Changed the order to be in-line with the list view (first hide, then deleted).
  7. Philipp Gampe commented on patch set 2 V -1 06/22/13, 14:58

    Arg, there is no confirmation dialog.
  8. Philipp Gampe commented on patch set 2 V 0 CR -1 06/22/13, 15:08

    Ok, the idea is good, we just need a confirmation dialog for the deleted button to avoid accidental deletes. You can find the needed code in typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php on line 1105. However you will need to create a new viewhelper for it to be able to use the full PHP calls. You can try if you can do it in pure HTML, but at least for the JS code conversion, you might need a new viewhelper. It would be cool if you could come up with with a new patchset. Otherwise I should have time next week. Just ping me.
  9. Krzysztof Adamczyk commented on patch set 2 06/22/13, 15:29

    ok I can do it but I have time in the first week of July
  1. Krzysztof Adamczyk uploaded patch set 3 06/24/13, 20:28

  2. Mr. Jenkins commented on patch set 3 06/24/13, 20:29

  3. Wouter Wolters commented on patch set 3 06/24/13, 20:39

    He Krzysztof, Thanks for the update. I posted some inline comments. This looks already good but needs a little tweaking:-) If you have any question don't hesitate to contact me. Greetz Wouter

    RemoveUserViewHelper.php:7

    You may replace this with (c) 2013 Krzysztof Adamczyk <k.adamczyk@macopedia.pl>

    RemoveUserViewHelper.php:32

    Because you will get the copyright above already we can leave this one out here:)

    RemoveUserViewHelper.php:40

    $redirect is not used and can be removed.

    RemoveUserViewHelper.php:44

    whitespace can be removed, empty can also be removed.

    RemoveUserViewHelper.php:49

    $redirectUrl is not set before. IMO this can be $redirectUrl : \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI');

    RemoveUserViewHelper.php:51

    I prefer this line written as: $parameters = 'cmd[be_users][' . $backendUser->getUid() . '][delete]=1';

    RemoveUserViewHelper.php:53

    Is $this->arguments['arguments'] used here? The xlf file doesn't contain any %s to replace anything

    RemoveUserViewHelper.php:56

    Empty lines can be removed.

    IndexListRow.html:43

    All ViewHelpers start with lowercase.
  4. Felix Kopp commented on patch set 3 06/24/13, 20:50

    Nice work!

    RemoveUserViewHelper.php:7 Reply

    Absolutely!

    locallang.xlf:124

    Could you change the text to "… delete this backend user?". ... or even better: "… delete backend user <username>?" You could use sprintf for that :)
  5. Krzysztof Adamczyk uploaded patch set 4 06/24/13, 21:01

  6. Mr. Jenkins commented on patch set 4 06/24/13, 21:02

  7. Philipp Gampe voted on patch set 4 V +1 CR +1 06/24/13, 21:18

  8. Wouter Wolters uploaded patch set 5 06/24/13, 21:50

  9. Mr. Jenkins commented on patch set 5 06/24/13, 21:51

  10. Wouter Wolters commented on patch set 5 V +1 CR +1 06/24/13, 21:51

    Added the suggestion from Felix to display the name of the BE user inside the confirm dialog. Fixed also some minor CGL things in the code. Many thanks for this nice improvement Krzysztof!
  11. Krzysztof Adamczyk commented on patch set 5 06/24/13, 21:53

    Thx Wouter for your halp and suggestions
  12. Philipp Gampe commented on patch set 5 CR -1 06/25/13, 01:01

    There is a problem with the JS now if you use a single or double quotes inside a username. Then the confirmation dialog is never showm: testuser'" (single quote, double quote at the end) possible function for this: GeneralUtility::quoteJSvalue(), but I could not get this to work on first try.
  13. Krzysztof Adamczyk commented on patch set 5 06/25/13, 10:23

    Hi ; I tested also htmlentities($backendUser>getUserName(),ENT_QUOTES) but it does't work. Any idea how we can resolve this problem ?
  14. Wouter Wolters commented on patch set 5 V 0 CR 0 06/25/13, 10:29

    I think the most stable solution is to leave the username out. Or there must be a solution for this. Will ask this evening in the chat if there is one that has a better solution.
  15. Felix Kopp commented on patch set 5 06/25/13, 10:46

    No, rather leave the quotes out please
  16. Philipp Gampe commented on patch set 5 06/25/13, 11:07

    I am talking about quotes as part of a username. This might be a rare edge case, but we must somehow be able to filter those out.
  17. Krzysztof Adamczyk commented on patch set 5 06/25/13, 11:15

    I think we can cut out quotes from username
  18. Philipp Gampe commented on patch set 5 06/25/13, 11:52

    think about a name like O'Connor -> OConnor?
  19. Krzysztof Adamczyk commented on patch set 5 06/25/13, 18:28

    Hi Wouter any news ?
  20. Wouter Wolters uploaded patch set 6 06/25/13, 18:50

  21. Mr. Jenkins commented on patch set 6 06/25/13, 18:51

  22. Wouter Wolters commented on patch set 6 V +1 CR +1 06/25/13, 18:52

    Quotes are no problem anymore. I added the quoteJSvalue function to the string that is put into the confirm. Now single and double quotes are possible in a username. Don't know why you should do that but OK it works:)
  23. Philipp Gampe commented on patch set 6 V +2 CR +2 06/25/13, 19:09

    Dam, this was a hard one ... merged.
  24. Philipp Gampe merged patch set 7 06/25/13, 19:09

  25. Krzysztof Adamczyk commented on patch set 7 06/25/13, 19:10

    greate :) thx