[BUGFIX] Fix Online BE-Users->Terminate be user sessions termination 99/34799/7
authorMathias Schreiber <mathias.schreiber@wmdb.de>
Sun, 30 Nov 2014 01:36:15 +0000 (02:36 +0100)
committerFrank Nägler <typo3@naegler.net>
Sun, 30 Nov 2014 20:37:41 +0000 (21:37 +0100)
Wrong view helper notation lead to it not being rendered.
Additionally flash message enqueue is used with a string instead
of a flash message object, which lead to a PHP fatal error.

* Fix the vh notation
* Use addFlashMessage() to add the flash message
* Make the message translatable

Resolves: #63439
Releases: master
Change-Id: Iddbc39ba0fd55d2ee0ac8610e9c8b8b96b614633
Reviewed-on: http://review.typo3.org/34799
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
typo3/sysext/beuser/Classes/Controller/BackendUserController.php
typo3/sysext/beuser/Resources/Private/Language/locallang.xlf
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/OnlineListRow.html

index 3321c3c..4646a04 100644 (file)
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Beuser\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 
 /**
  * Backend module user administration controller
@@ -186,8 +187,7 @@ class BackendUserController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionCont
                        'ses_userid = "' . (int)$backendUser->getUid() . '" AND ses_id = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($sessionId, 'be_sessions') . ' LIMIT 1'
                );
                if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
-                       $message = 'Session successfully terminated.';
-                       $this->controllerContext->getFlashMessageQueue()->enqueue($message, '', \TYPO3\CMS\Core\Messaging\FlashMessage::OK);
+                       $this->addFlashMessage(LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:terminateSessionSuccess', 'beuser'));
                }
                $this->forward('online');
        }
@@ -222,5 +222,4 @@ class BackendUserController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionCont
                        \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl);
                }
        }
-
 }
index 2e11683..5c32375 100644 (file)
                        <trans-unit id="compare" xml:space="preserve">
                                <source>Compare</source>
                        </trans-unit>
+                       <trans-unit id="terminateSessionSuccess" xml:space="preserve">
+                               <source>Session successfully terminated.</source>
+                       </trans-unit>
                </body>
        </file>
 </xliff>
index 1b8f24f..3b58777 100644 (file)
@@ -26,7 +26,7 @@
                                                        action="terminateBackendUserSession"
                                                        controller="BackendUser"
                                                        arguments="{backendUser: onlineUser.backendUser, sessionId: session.id}"
-                                                       onclick="javascript:return confirm('{f:translate(key: \'reallyLogout\')} {onlineUser.backendUser.userName}?');"
+                                                       onclick="javascript:return confirm('{f:translate(key: 'reallyLogout')} {onlineUser.backendUser.userName}?');"
                                                >
                                                        <bu:spriteManagerIcon iconName="actions-document-close" />
                                                        <f:translate key="endSession" />