[FEATURE] Migrate EXT: beuser to Extbase
authorFelix Kopp <felix-source@phorax.com>
Fri, 20 Jul 2012 17:23:34 +0000 (19:23 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 7 Aug 2012 08:30:04 +0000 (10:30 +0200)
This patchset includes a new backend user administration.

Based on extbase a model for BackendUsers is included.
All users can be listed and the listing can be filtered by
* username
* usergroup
* admin/non-admin
* active/inactive
* ever logged in.

The user listing includes the last login column also the
limit of 1.000 users was removed and pagination integrated.

Selected users can be compared in a table view.
All active backend user sessions are listed - can be terminated.

Of course the SU/change user feature was migrated.
Clickmenu was widely integrated to allow editing right away.

Change-Id: I32569c848581a49b3948e093d717dad50e973c5d
Resolves: #39141
Resolves: #5288
Resolves: #37949
Resolves: #33427
Resolves: #18602
Resolves: #15494
Releases: 6.0
Reviewed-on: http://review.typo3.org/12935
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
49 files changed:
typo3/sysext/beuser/Classes/Controller/BackendUserController.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/Domain/Model/BackendUser.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/Domain/Model/BackendUserGroup.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/Domain/Model/Demand.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/Domain/Model/ModuleData.php [new file with mode: 0644]
typo3/sysext/beuser/Classes/Domain/Repository/BackendUserGroupRepository.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/Domain/Repository/BackendUserRepository.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/Domain/Repository/BackendUserSessionRepository.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/Service/ModuleDataStorageService.php [new file with mode: 0644]
typo3/sysext/beuser/Classes/ViewHelpers/Display/PagesViewHelper.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/ViewHelpers/Display/SysFileMountsViewHelper.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/ViewHelpers/Display/SysLanguageViewHelper.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/ViewHelpers/Form/SelectDefaultValueViewHelper.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/ViewHelpers/SUViewHelper.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/ViewHelpers/SectionViewHelper.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/ViewHelpers/SpriteIconForRecordViewHelper.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/ViewHelpers/SpriteManagerIconViewHelper.php [new file with mode: 0755]
typo3/sysext/beuser/Classes/class.tx_beuser_switchbackuser.php [new file with mode: 0755]
typo3/sysext/beuser/Resources/Private/.htaccess [new file with mode: 0755]
typo3/sysext/beuser/Resources/Private/Language/locallang.xlf [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Language/locallang_mod.xlf [new file with mode: 0755]
typo3/sysext/beuser/Resources/Private/Layouts/Default.html [new file with mode: 0755]
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html [new file with mode: 0755]
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/OnlineListRow.html [new file with mode: 0755]
typo3/sysext/beuser/Resources/Private/Partials/Filters/BackendUser/Index.html [new file with mode: 0755]
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Compare.html [new file with mode: 0755]
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Index.html [new file with mode: 0755]
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Online.html [new file with mode: 0755]
typo3/sysext/beuser/Resources/Public/Css/style.css [new file with mode: 0755]
typo3/sysext/beuser/Tests/Unit/Domain/Model/BackendUserTest.php [new file with mode: 0755]
typo3/sysext/beuser/Tests/Unit/Domain/Model/DemandTest.php [new file with mode: 0755]
typo3/sysext/beuser/Tests/Unit/Domain/Repository/BackendUserRepositoryTest.php [new file with mode: 0755]
typo3/sysext/beuser/Tests/Unit/Domain/Repository/BackendUserSessionRepositoryTest.php [new file with mode: 0755]
typo3/sysext/beuser/Tests/Unit/Service/ModuleDataStorageServiceTest.php [new file with mode: 0644]
typo3/sysext/beuser/class.tx_beuser.php [deleted file]
typo3/sysext/beuser/class.tx_beuser_switchbackuser.php [deleted file]
typo3/sysext/beuser/doc/TODO.txt [deleted file]
typo3/sysext/beuser/ext_autoload.php [new file with mode: 0755]
typo3/sysext/beuser/ext_emconf.php
typo3/sysext/beuser/ext_localconf.php [changed mode: 0644->0755]
typo3/sysext/beuser/ext_tables.php
typo3/sysext/beuser/ext_typoscript_setup.txt [new file with mode: 0755]
typo3/sysext/beuser/mod/beuser.gif [deleted file]
typo3/sysext/beuser/mod/clear.gif [deleted file]
typo3/sysext/beuser/mod/conf.php [deleted file]
typo3/sysext/beuser/mod/index.php [deleted file]
typo3/sysext/beuser/mod/locallang.xlf [deleted file]
typo3/sysext/beuser/mod/locallang_mod.xlf [deleted file]

diff --git a/typo3/sysext/beuser/Classes/Controller/BackendUserController.php b/typo3/sysext/beuser/Classes/Controller/BackendUserController.php
new file mode 100755 (executable)
index 0000000..c65e315
--- /dev/null
@@ -0,0 +1,221 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Backend module user administration controller
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Controller_BackendUserController extends Tx_Extbase_MVC_Controller_ActionController {
+
+       /**
+        * @var Tx_Beuser_Domain_Model_ModuleData
+        */
+       protected $moduleData;
+
+       /**
+        * @var Tx_Beuser_Service_ModuleDataStorageService
+        * @inject
+        */
+       protected $moduleDataStorageService;
+
+       /**
+         * @var Tx_Beuser_Domain_Repository_BackendUserRepository
+         * @inject
+         */
+       protected $backendUserRepository;
+
+       /**
+        * @var Tx_Beuser_Domain_Repository_BackendUserGroupRepository
+        * @inject
+        */
+       protected $backendUserGroupRepository;
+
+       /**
+        * @var Tx_Beuser_Domain_Repository_BackendUserSessionRepository
+        * @inject
+        */
+       protected $backendUserSessionRepository;
+
+       /**
+        * Load and persist module data
+        *
+        * @param Tx_Extbase_MVC_RequestInterface $request
+        * @param Tx_Extbase_MVC_ResponseInterface $response
+        * @throws Tx_Extbase_MVC_Exception_StopAction
+        * @return void
+        */
+       public function processRequest(Tx_Extbase_MVC_RequestInterface $request, Tx_Extbase_MVC_ResponseInterface $response) {
+               $this->moduleData = $this->moduleDataStorageService->loadModuleData();
+
+                       // We "finally" persist the module data.
+               try {
+                       parent::processRequest($request, $response);
+                       $this->moduleDataStorageService->persistModuleData($this->moduleData);
+               } catch (Tx_Extbase_MVC_Exception_StopAction $e) {
+                       $this->moduleDataStorageService->persistModuleData($this->moduleData);
+                       throw $e;
+               }
+       }
+
+       /**
+        * Displays all BackendUsers
+        * - Switch session to different user
+        *
+        * @param Tx_Beuser_Domain_Model_Demand $demand
+        * @return void
+        */
+       public function indexAction(Tx_Beuser_Domain_Model_Demand $demand = NULL) {
+               if ($demand === NULL) {
+                       $demand = $this->moduleData->getDemand();
+               } else {
+                       $this->moduleData->setDemand($demand);
+               }
+
+                       // Switch user permanently or only until logout
+               if (t3lib_div::_GP('SwitchUser')) {
+                       $this->switchUser(t3lib_div::_GP('SwitchUser'), t3lib_div::_GP('switchBackUser'));
+               }
+
+               $compareUserList = $this->moduleData->getCompareUserList();
+
+               $this->view->assign('demand', $demand);
+               $this->view->assign('returnUrl', 'mod.php?M=tools_BeuserTxBeuser');
+               $this->view->assign('dateFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']);
+               $this->view->assign('timeFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']);
+               $this->view->assign('backendUsers', $this->backendUserRepository->findDemanded($demand));
+               $this->view->assign('backendUserGroups', array_merge(array(''), $this->backendUserGroupRepository->findAll()->toArray()));
+               $this->view->assign('compareUserList', !empty($compareUserList) ? $this->backendUserRepository->findByUidList($compareUserList) : '');
+       }
+
+       /**
+        * Views all currently logged in BackendUsers and their sessions
+        *
+        * @return void
+        */
+       public function onlineAction() {
+               $onlineUsersAndSessions = array();
+               $onlineUsers = $this->backendUserRepository->findOnline();
+               foreach ($onlineUsers as $onlineUser) {
+                       $onlineUsersAndSessions[] = array(
+                               'backendUser' => $onlineUser,
+                               'sessions' => $this->backendUserSessionRepository->findByBackendUser($onlineUser)
+                       );
+               }
+
+               $this->view->assign('dateFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']);
+               $this->view->assign('timeFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']);
+               $this->view->assign('onlineUsersAndSessions', $onlineUsersAndSessions);
+               $this->view->assign('currentSessionId', $GLOBALS['BE_USER']->user['ses_id']);
+       }
+
+       /**
+        * Compare backend users from demand
+        *
+        * @return void
+        */
+       public function compareAction() {
+               $compareUserList = $this->moduleData->getCompareUserList();
+
+               $this->view->assign('dateFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']);
+               $this->view->assign('timeFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']);
+               $this->view->assign('compareUserList', !empty($compareUserList) ? $this->backendUserRepository->findByUidList($compareUserList) : '');
+       }
+
+       /**
+        * Attaches one backend user to the compare list
+        *
+        * @param integer $uid
+        * @retun void
+        */
+       public function addToCompareListAction($uid) {
+               $this->moduleData->attachUidCompareUser($uid);
+               $this->forward('index');
+       }
+
+       /**
+        * Removes given backend user to the compare list
+        *
+        * @param integer $uid
+        * @retun void
+        */
+       public function removeFromCompareListAction($uid) {
+               $this->moduleData->detachUidCompareUser($uid);
+               $this->forward('index');
+       }
+
+       /**
+        * Terminate BackendUser session and logout corresponding client
+        * Redirects to onlineAction with message
+        *
+        * @param Tx_Beuser_Domain_Model_BackendUser $backendUser
+        * @param string $sessionId
+        * @return void
+        */
+       protected function terminateBackendUserSessionAction(Tx_Beuser_Domain_Model_BackendUser $backendUser, $sessionId) {
+               $GLOBALS['TYPO3_DB']->exec_DELETEquery(
+                       'be_sessions',
+                       'ses_userid = "' . $backendUser->getUid() . '"' .
+                               ' AND ses_id = "' . $sessionId . '"' .
+                               ' LIMIT 1'
+               );
+
+               if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
+                       $message = 'Session successfully terminated.';
+                       $this->flashMessageContainer->add($message, '', t3lib_FlashMessage::OK);
+               }
+
+               $this->forward('online');
+       }
+
+       /**
+        * Switches to a given user (SU-mode) and then redirects to the start page of the backend to refresh the navigation etc.
+        *
+        * @param array $switchUser BE-user record that will be switched to
+        * @param boolean $switchBack
+        * @return void
+        */
+       protected function switchUser($switchUser, $switchBack = FALSE) {
+               $targetUser = t3lib_BEfunc::getRecord('be_users', $switchUser);
+               if (is_array($targetUser) && $GLOBALS['BE_USER']->isAdmin()) {
+                       $updateData['ses_userid'] = $targetUser['uid'];
+
+                               // User switchback or replace current session?
+                       if ($switchBack) {
+                               $updateData['ses_backuserid'] = intval($GLOBALS['BE_USER']->user['uid']);
+                       }
+                       $GLOBALS['TYPO3_DB']->exec_UPDATEquery('be_sessions', 'ses_id=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($GLOBALS['BE_USER']->id, 'be_sessions') . ' AND ses_name=' . $GLOBALS['TYPO3_DB']->fullQuoteStr(t3lib_beUserAuth::getCookieName(), 'be_sessions') . ' AND ses_userid=' . intval($GLOBALS['BE_USER']->user['uid']), $updateData);
+
+                       $redirectUrl = $GLOBALS['BACK_PATH'] . 'index.php' . ($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? '' : '?commandLI=1');
+                       t3lib_utility_Http::redirect($redirectUrl);
+               }
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/Domain/Model/BackendUser.php b/typo3/sysext/beuser/Classes/Domain/Model/BackendUser.php
new file mode 100755 (executable)
index 0000000..fdf9a53
--- /dev/null
@@ -0,0 +1,135 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Model for backend user
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Model_BackendUser extends Tx_Extbase_Domain_Model_BackendUser {
+
+       /**
+        * Comma separated list of uids in multi-select
+        * Might retrieve the labels from TCA/DataMapper
+        *
+        * @var string
+        */
+       protected $allowedLanguages = '';
+
+       /**
+        * @var string
+        */
+       protected $dbMountPoints = '';
+
+       /**
+        * @var string
+        */
+       protected $fileMountPoints = '';
+
+       /**
+        * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Beuser_Domain_Model_BackendUserGroup>
+        */
+       protected $backendUserGroups;
+
+       /**
+        * @param string $allowedLanguages
+        * @return void
+        */
+       public function setAllowedLanguages($allowedLanguages) {
+               $this->allowedLanguages= $allowedLanguages;
+       }
+
+       /**
+        * @return string
+        */
+       public function getAllowedLanguages() {
+               return $this->allowedLanguages;
+       }
+
+       /**
+        * @param string
+        * @return void
+        */
+       public function setDbMountPoints($dbMountPoints) {
+               $this->dbMountPoints = $dbMountPoints;
+       }
+
+       /**
+        * @return string
+        */
+       public function getDbMountPoints() {
+               return $this->dbMountPoints;
+       }
+
+       /**
+        * @param string $fileMountPoints
+        * @return void
+        */
+       public function setFileMountPoints($fileMountPoints) {
+               $this->fileMountPoints = $fileMountPoints;
+       }
+
+       /**
+        * @return string
+        */
+       public function getFileMountPoints() {
+               return $this->fileMountPoints;
+       }
+
+       /**
+        * Check if user is active, not disabled
+        *
+        * @return boolean
+        */
+       public function isActive() {
+               if ($this->getIsDisabled()) {
+                       return FALSE;
+               }
+
+               $now = new DateTime('now');
+               return (!$this->getStartDateAndTime() && !$this->getEndDateAndTime()) ||
+                               ($this->getStartDateAndTime() <= $now && (!$this->getEndDateAndTime() || $this->getEndDateAndTime() > $now));
+       }
+
+       /**
+        * @param \Tx_Extbase_Persistence_ObjectStorage $backendUserGroups
+        */
+       public function setBackendUserGroups($backendUserGroups) {
+               $this->backendUserGroups = $backendUserGroups;
+       }
+
+       /**
+        * @return \Tx_Extbase_Persistence_ObjectStorage
+        */
+       public function getBackendUserGroups() {
+               return $this->backendUserGroups;
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/Domain/Model/BackendUserGroup.php b/typo3/sysext/beuser/Classes/Domain/Model/BackendUserGroup.php
new file mode 100755 (executable)
index 0000000..e57a5a0
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Model for backend user group
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Model_BackendUserGroup extends Tx_Extbase_DomainObject_AbstractEntity {
+
+       /**
+        * @var string
+        */
+       protected $title;
+
+       /**
+        * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Beuser_Domain_Model_BackendUserGroup>
+        * @lazy
+        */
+       protected $subGroups;
+
+       /**
+        * @param string $title
+        */
+       public function setTitle($title) {
+               $this->title = $title;
+       }
+
+       /**
+        * @return string
+        */
+       public function getTitle() {
+               return $this->title;
+       }
+
+       /**
+        * @param \Tx_Extbase_Persistence_ObjectStorage $subGroups
+        */
+       public function setSubGroups($subGroups) {
+               $this->subGroups = $subGroups;
+       }
+
+       /**
+        * @return \Tx_Extbase_Persistence_ObjectStorage
+        */
+       public function getSubGroups() {
+               return $this->subGroups;
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/Domain/Model/Demand.php b/typo3/sysext/beuser/Classes/Domain/Model/Demand.php
new file mode 100755 (executable)
index 0000000..8b25449
--- /dev/null
@@ -0,0 +1,169 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Demand filter for listings
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Model_Demand extends Tx_Extbase_DomainObject_AbstractEntity {
+
+       /**
+        * @var integer
+        */
+       const ALL = 0;
+
+       /**
+        * @var integer
+        */
+       const USERTYPE_ADMINONLY = 1;
+       /**
+        * @var integer
+        */
+       const USERTYPE_USERONLY = 2;
+
+       /**
+        * @var integer
+        */
+       const STATUS_ACTIVE = 1;
+       /**
+        * @var integer
+        */
+       const STATUS_INACTIVE = 2;
+
+       /**
+        * @var integer
+        */
+       const LOGIN_SOME = 1;
+       /**
+        * @var integer
+        */
+       const LOGIN_NONE = 2;
+
+       /**
+        * @var string
+        */
+       protected $userName = '';
+
+       /**
+        * @var integer
+        */
+       protected $userType = self::ALL;
+
+       /**
+        * @var integer
+        */
+       protected $status = self::ALL;
+
+       /**
+        * @var integer
+        */
+       protected $logins = 0;
+
+       /**
+        * @var Tx_Beuser_Domain_Model_BackendUserGroup
+        */
+       protected $backendUserGroup;
+
+       /**
+        * @param string $userName
+        * @return void
+        */
+       public function setUserName($userName) {
+               $this->userName = $userName;
+       }
+
+       /**
+        * @return string
+        */
+       public function getUserName() {
+               return $this->userName;
+       }
+
+       /**
+        * @param integer $userType
+        * @return void
+        */
+       public function setUserType($userType) {
+               $this->userType = $userType;
+       }
+
+       /**
+        * @return integer
+        */
+       public function getUserType() {
+               return $this->userType;
+       }
+
+       /**
+        * @param integer $status
+        * @return void
+        */
+       public function setStatus($status) {
+               $this->status = $status;
+       }
+
+       /**
+        * @return integer
+        */
+       public function getStatus() {
+               return $this->status;
+       }
+
+       /**
+        * @param integer $logins
+        * @return void
+        */
+       public function setLogins($logins) {
+               $this->logins = $logins;
+       }
+
+       /**
+        * @return integer
+        */
+       public function getLogins() {
+               return $this->logins;
+       }
+
+       /**
+        * @param \Tx_Beuser_Domain_Model_BackendUserGroup $backendUserGroup
+        */
+       public function setBackendUserGroup($backendUserGroup) {
+               $this->backendUserGroup = $backendUserGroup;
+       }
+
+       /**
+        * @return \Tx_Beuser_Domain_Model_BackendUserGroup
+        */
+       public function getBackendUserGroup() {
+               return $this->backendUserGroup;
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/Domain/Model/ModuleData.php b/typo3/sysext/beuser/Classes/Domain/Model/ModuleData.php
new file mode 100644 (file)
index 0000000..b749cb2
--- /dev/null
@@ -0,0 +1,95 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Module data object
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @author Nikolas Hagelstein <nikolas.hagelstein@gmail.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Model_ModuleData {
+
+       /**
+        * @var Tx_Beuser_Domain_Model_Demand
+        * @inject
+        */
+       protected $demand;
+
+       /**
+        * @var array
+        */
+       protected $compareUserList;
+
+       /**
+        * @return Tx_Beuser_Domain_Model_Demand
+        */
+       public function getDemand() {
+               return $this->demand;
+       }
+
+       /**
+        * @param Tx_Beuser_Domain_Model_Demand $demand
+        * @return void
+        */
+       public function setDemand(Tx_Beuser_Domain_Model_Demand $demand) {
+               $this->demand = $demand;
+       }
+
+       /**
+        * Returns the compare list as array of user uis
+        *
+        * @return array
+        */
+       public function getCompareUserList() {
+               return array_keys($this->compareUserList);
+       }
+
+       /**
+        * Adds one backend user (by uid) to the compare user list
+        * Cannot be ObjectStorage, must be array
+        *
+        * @param integer $uid
+        * @return void
+        */
+       public function attachUidCompareUser($uid) {
+               $this->compareUserList[$uid] = TRUE;
+       }
+
+       /**
+        * Strip one backend user from the compare user list
+        *
+        * @param integer $uid
+        * @return void
+        */
+       public function detachUidCompareUser($uid) {
+               unset($this->compareUserList[$uid]);
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/Domain/Repository/BackendUserGroupRepository.php b/typo3/sysext/beuser/Classes/Domain/Repository/BackendUserGroupRepository.php
new file mode 100755 (executable)
index 0000000..c92ba67
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Repository for Tx_Beuser_Domain_Model_BackendUserGroup
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Repository_BackendUserGroupRepository extends Tx_Extbase_Persistence_Repository {
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/Domain/Repository/BackendUserRepository.php b/typo3/sysext/beuser/Classes/Domain/Repository/BackendUserRepository.php
new file mode 100755 (executable)
index 0000000..e5b6aed
--- /dev/null
@@ -0,0 +1,153 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Repository for Tx_Beuser_Domain_Model_BackendUser
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Repository_BackendUserRepository extends Tx_Extbase_Domain_Repository_BackendUserRepository {
+
+
+       /**
+        * Finds Backend Users on a given list of uids
+        *
+        * @param array $uidList
+        * @return Tx_Extbase_Persistence_QueryResult<Tx_Beuser_Domain_Model_BackendUser>
+        */
+       public function findByUidList($uidList) {
+               $query = $this->createQuery();
+               return $query->matching(
+                       $query->in('uid', $uidList)
+               )->execute();
+       }
+
+       /**
+        * Find Backend Users matching to Demand object properties
+        *
+        * @param Tx_Beuser_Domain_Model_Demand $demand
+        * @return Tx_Extbase_Persistence_QueryResult<Tx_Beuser_Domain_Model_BackendUser>
+        */
+       public function findDemanded(Tx_Beuser_Domain_Model_Demand $demand) {
+               $constraints = array();
+               $query = $this->createQuery();
+
+                       // Find invisible as well, but not deleted
+
+               $constraints[] = $query->equals('deleted', 0);
+
+               $query->setOrderings(array('userName' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING));
+
+                       // Username
+               if ($demand->getUserName() !== '') {
+                       $constraints[] = $query->like('userName', '%' . $demand->getUserName() . '%');
+               }
+
+                       // Only display admin users
+               if ($demand->getUserType() == Tx_Beuser_Domain_Model_Demand::USERTYPE_ADMINONLY) {
+                       $constraints[] = $query->equals('admin', 1);
+               }
+
+                       // Only display non-admin users
+               if ($demand->getUserType() == Tx_Beuser_Domain_Model_Demand::USERTYPE_USERONLY) {
+                       $constraints[] = $query->equals('admin', 0);
+               }
+
+                       // Only display active users
+               if ($demand->getStatus() == Tx_Beuser_Domain_Model_Demand::STATUS_ACTIVE) {
+                       $constraints[] = $query->equals('disable', 0);
+               }
+
+                       // Only display in-active users
+               if ($demand->getStatus() == Tx_Beuser_Domain_Model_Demand::STATUS_INACTIVE) {
+                       $constraints[] = $query->logicalOr(
+                               $query->equals('disable', 1)
+                       );
+               }
+
+                       // Not logged in before
+               if ($demand->getLogins() == Tx_Beuser_Domain_Model_Demand::LOGIN_NONE) {
+                       $constraints[] = $query->equals('lastlogin', 0);
+               }
+
+                       // At least one login
+               if ($demand->getLogins() == Tx_Beuser_Domain_Model_Demand::LOGIN_SOME) {
+                       $constraints[] = $query->logicalNot($query->equals('lastlogin', 0));
+               }
+
+                       // In backend user group
+                       // @TODO: Refactor for real n:m relations
+               if ($demand->getBackendUserGroup()) {
+                       $constraints[] = $query->logicalOr(
+                               $query->equals('usergroup', $demand->getBackendUserGroup()->getUid()),
+                               $query->like('usergroup', $demand->getBackendUserGroup()->getUid() . ',%'),
+                               $query->like('usergroup', '%,' . $demand->getBackendUserGroup()->getUid()),
+                               $query->like('usergroup', '%,' . $demand->getBackendUserGroup()->getUid() . ',%')
+                       );
+
+                       $query->contains('usergroup', $demand->getBackendUserGroup());
+               }
+
+               $query->matching($query->logicalAnd($constraints));
+
+               return $query->execute();
+       }
+
+       /**
+        * Find Backend Users currently online
+        *
+        * @return Tx_Extbase_Persistence_QueryResult<Tx_Beuser_Domain_Model_BackendUser>
+        */
+       public function findOnline() {
+               $uids = array();
+
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('DISTINCT ses_userid', 'be_sessions', '');
+               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $uids[] = $row['ses_userid'];
+               }
+
+               $query = $this->createQuery();
+               $query->matching($query->in('uid', $uids));
+
+               return $query->execute();
+       }
+
+       /**
+        * Overwrite createQuery to don't respect enable fields
+        *
+        * @return Tx_Extbase_Persistence_QueryInterface
+        */
+       public function createQuery() {
+               $query = parent::createQuery();
+               $query->getQuerySettings()->setRespectEnableFields(FALSE);
+               return $query;
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/Domain/Repository/BackendUserSessionRepository.php b/typo3/sysext/beuser/Classes/Domain/Repository/BackendUserSessionRepository.php
new file mode 100755 (executable)
index 0000000..efdf7cc
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Repository for Tx_Beuser_Domain_Model_BackendUser
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Repository_BackendUserSessionRepository extends Tx_Extbase_Persistence_Repository {
+
+       /**
+        * Find Sessions for specific BackendUser
+        * Delivers Array, not ObjectStorage!
+        *
+        * @param Tx_Beuser_Domain_Model_BackendUser $backendUser
+        * @return array
+        */
+       public function findByBackendUser(Tx_Beuser_Domain_Model_BackendUser $backendUser) {
+               $sessions = array();
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       'ses_id AS id, ses_iplock AS ip, ses_tstamp AS timestamp',
+                       'be_sessions',
+                       'ses_userid = "' . $backendUser->getUid() . '"',
+                       '',
+                       'ses_tstamp ASC'
+               );
+               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $sessions[] = array(
+                               'id' => $row['id'],
+                               'ip' => $row['ip'],
+                               'timestamp' => new DateTime('@' . $row['timestamp'])
+                       );
+               }
+
+               return $sessions;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/Service/ModuleDataStorageService.php b/typo3/sysext/beuser/Classes/Service/ModuleDataStorageService.php
new file mode 100644 (file)
index 0000000..a2a421b
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Module data storage service.
+ * Used to store and retrieve module state (eg. checkboxes, selections).
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @author Nikolas Hagelstein <nikolas.hagelstein@gmail.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Service_ModuleDataStorageService implements t3lib_Singleton {
+
+       /**
+        * @var string
+        */
+       const KEY = 'tx_beuser';
+
+       /**
+        * @var Tx_Extbase_Object_ObjectManagerInterface
+        * @inject
+        */
+       protected $objectManager;
+
+       /**
+        * Loads module data for user settings or returns a fresh object initially
+        *
+        * @return Tx_Beuser_Domain_Model_ModuleData
+        */
+       public function loadModuleData() {
+               $moduleData = $GLOBALS['BE_USER']->getModuleData(self::KEY);
+
+               if (empty($moduleData) || !$moduleData) {
+                       $moduleData = $this->objectManager->create('Tx_Beuser_Domain_Model_ModuleData');
+               } else {
+                       $moduleData = @unserialize($moduleData);
+               }
+
+               return $moduleData;
+       }
+
+       /**
+        * Persists serialized module data to user settings
+        *
+        * @param Tx_Beuser_Domain_Model_ModuleData $moduleData
+        * @return void
+        */
+       public function persistModuleData(Tx_Beuser_Domain_Model_ModuleData $moduleData) {
+               $GLOBALS['BE_USER']->pushModuleData(self::KEY, serialize($moduleData));
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/Display/PagesViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/Display/PagesViewHelper.php
new file mode 100755 (executable)
index 0000000..63dfe33
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Converts comma separated list of pages uids to html unordered list (<ul>) with speaking titles
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_ViewHelpers_Display_PagesViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+
+       /**
+        * @param string $uids
+        * @return string
+        */
+       public function render($uids = '') {
+               if (!$uids) {
+                       return '';
+               }
+
+               $content = '';
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       'uid, title',
+                       'pages',
+                       'uid IN (' . $uids . ')',
+                       'uid ASC'
+               );
+               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $content .= '<li>' . $row['title'] . ' [' . $row['uid'] . ']</li>';
+               }
+
+               return '<ul>' . $content . '</ul>';
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysFileMountsViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysFileMountsViewHelper.php
new file mode 100755 (executable)
index 0000000..4dff7e4
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Converts comma separated list of sys_filemounts uids to html unordered list (<ul>) with speaking titles
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_ViewHelpers_Display_SysFileMountsViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+
+       /**
+        * @param string $uids
+        * @return string
+        */
+       public function render($uids = '') {
+               if (!$uids) {
+                       return '';
+               }
+
+               $content = '';
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       'uid, title',
+                       'sys_filemounts',
+                       '',
+                       'title ASC'
+               );
+               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $content .= '<li>' . $row['title'] . ' [' . $row['uid'] . ']</li>';
+               }
+
+               return '<ul>' . $content . '</ul>';
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysLanguageViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/Display/SysLanguageViewHelper.php
new file mode 100755 (executable)
index 0000000..9471b67
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Converts comma separated list of sys_language uids to html unordered list (<ul>) with speaking titles
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_ViewHelpers_Display_SysLanguageViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+
+       /**
+        * @param string $uids
+        * @return string
+        */
+       public function render($uids = '') {
+               if (!$uids) {
+                       return '';
+               }
+
+               $content = '';
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       'uid, title, flag',
+                       'sys_language',
+                       '',
+                       'title ASC'
+               );
+               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $content .= '<li>' . $row['title'] . ' [' . $row['uid'] . ']</li>';
+               }
+
+               return '<ul>' . $content . '</ul>';
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/Form/SelectDefaultValueViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/Form/SelectDefaultValueViewHelper.php
new file mode 100755 (executable)
index 0000000..cf09cc7
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Extends Tx_Fluid_ViewHelpers_Form_SelectViewHelper with empty default value in select input field
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_ViewHelpers_Form_SelectDefaultValueViewHelper extends Tx_Fluid_ViewHelpers_Form_SelectViewHelper {
+
+       /**
+        * @return void
+        */
+       public function initializeArguments() {
+               parent::initializeArguments();
+               $this->registerArgument('defaultOption', 'string', 'value to prepend', FALSE);
+       }
+
+       /**
+        * @return array
+        */
+       protected function getOptions() {
+               return array('' => $this->arguments['defaultOption']) + parent::getOptions();
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php
new file mode 100755 (executable)
index 0000000..0e07ad5
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Issue command ViewHelper, see TYPO3 Core Engine method issueCommand
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_ViewHelpers_IssueCommandViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+
+       /**
+        * Returns a URL with a command to TYPO3 Core Engine (tce_db.php)
+        *
+        * @param string $parameters Is a set of GET params to send to tce_db.php. Example: "&cmd[tt_content][123][move]=456" or "&data[tt_content][123][hidden]=1&data[tt_content][123][title]=Hello%20World"
+        * @param string $redirectUrl Redirect URL if any other that t3lib_div::getIndpEnv('REQUEST_URI') is wished
+        * @return string URL to tce_db.php + parameters
+        * @see t3lib_BEfunc::editOnClick()
+        * @see template::issueCommand()
+        */
+       public function render($parameters, $redirectUrl = '') {
+               $redirectUrl = $redirectUrl ? $redirectUrl : t3lib_div::getIndpEnv('REQUEST_URI');
+
+               return $GLOBALS['BACK_PATH'] .
+                       'tce_db.php?' . $parameters .
+                       '&redirect=' . ($redirectUrl == '' ? "' + T3_THIS_LOCATION + '" : rawurlencode($redirectUrl)) .
+                       '&vC=' . rawurlencode($GLOBALS['BE_USER']->veriCode()) .
+                       t3lib_BEfunc::getUrlToken('tceAction') .
+                       '&prErr=1&uPT=1';
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/SUViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/SUViewHelper.php
new file mode 100755 (executable)
index 0000000..7b725d9
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Displays 'SU' link with sprite icon to change current backend user to target (non-admin) backendUser
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_ViewHelpers_SUViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+
+       /**
+        * @param Tx_Beuser_Domain_Model_BackendUser $backendUser Target backendUser to switch active session to
+        * @param boolean $emulate Return to current session or logout after target session termination?
+        * @return string
+        */
+       public function render(Tx_Beuser_Domain_Model_BackendUser $backendUser, $emulate = FALSE) {
+               if ($backendUser->getIsAdministrator()) {
+                       return '';
+               }
+
+               $title = $GLOBALS['LANG']->getLL('switchUserTo', TRUE) . ' ' . $backendUser->getUserName() . ' ' . $GLOBALS['LANG']->getLL('switchBackMode', TRUE);
+
+               return '<a href="' . t3lib_div::linkThisScript(array('SwitchUser' => $backendUser->getUid(), 'switchBackUser' => $emulate)) .
+                       '" target="_top" title="' . htmlspecialchars($title) . '">' .
+                       t3lib_iconWorks::getSpriteIcon('actions-system-backend-user-' . ($emulate ? 'emulate' : 'switch')) .
+                       '</a>';
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/SectionViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/SectionViewHelper.php
new file mode 100755 (executable)
index 0000000..6f02dbb
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Displays a section in backend module template, similar to template::section()
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_ViewHelpers_SectionViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+
+       /**
+        * Display section with title and content
+        *
+        * @param string $title
+        * @param boolean $collapsible
+        * @return string
+        * @see template::section()
+        */
+       public function render($title, $collapsible = FALSE) {
+               if ($collapsible) {
+                       $uniqueId = 'section_' . md5(microtime() . rand());
+
+                       return '<h3 class="collapsibleSection"><a href="#" onClick="$(\'' . $uniqueId . '\').toggle(); return false;">' . $title . '</a></h3>' .
+                               '<div id="' . $uniqueId . '" class="collapsibleSection">' . $this->renderChildren() . '</div>';
+               }
+
+               return '<h3>' . $title . '</h3>' . $this->renderChildren();
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/SpriteIconForRecordViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/SpriteIconForRecordViewHelper.php
new file mode 100755 (executable)
index 0000000..5d27a87
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Views sprite icon for a record (object)
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_ViewHelpers_SpriteIconForRecordViewHelper extends Tx_Fluid_ViewHelpers_Be_AbstractBackendViewHelper {
+
+       /**
+        * Displays spriteIcon for database table and object
+        *
+        * @param string $table
+        * @param object $object
+        * @return string
+        * @see t3lib_iconWorks::getSpriteIconForRecord($table, $row)
+        */
+       public function render($table, $object) {
+               if (!is_object($object) || !method_exists($object, 'getUid')) {
+                       return '';
+               }
+
+               $row = array(
+                       'uid' => $object->getUid(),
+                       'startTime' => FALSE,
+                       'endTime' => FALSE,
+               );
+
+               if (method_exists($object, 'getIsDisabled')) {
+                       $row['disable'] = $object->getIsDisabled();
+               }
+
+               if ($table === 'be_users' && get_class($object) === 'Tx_Beuser_Domain_Model_BackendUser') {
+                       $row['admin'] = $object->getIsAdministrator();
+               }
+
+               if (method_exists($object, 'getStartDateAndTime')) {
+                       $row['startTime'] = $object->getStartDateAndTime();
+               }
+
+               if (method_exists($object, 'getEndDateAndTime')) {
+                       $row['endTime'] = $object->getEndDateAndTime();
+               }
+
+               return t3lib_iconWorks::getSpriteIconForRecord($table, $row);
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/SpriteManagerIconViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/SpriteManagerIconViewHelper.php
new file mode 100755 (executable)
index 0000000..e75ad5d
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Displays sprite icon identified by iconName key
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_ViewHelpers_SpriteManagerIconViewHelper extends Tx_Fluid_ViewHelpers_Be_AbstractBackendViewHelper {
+
+       /**
+        * Prints sprite icon html for $iconName key
+        *
+        * @param string $iconName
+        * @param array $options
+        * @return string
+        */
+       public function render($iconName, $options = array()) {
+               return t3lib_iconWorks::getSpriteIcon($iconName, $options);
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Classes/class.tx_beuser_switchbackuser.php b/typo3/sysext/beuser/Classes/class.tx_beuser_switchbackuser.php
new file mode 100755 (executable)
index 0000000..7b48938
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Backend user switchback, for logoff_pre_processing hook within t3lib_userauth class
+ *
+ * @author Kasper Skårhøj (kasperYYYY@typo3.com)
+ * @author Sebastian Kurfürst <sebastian@garbage-group.de>
+ * @author Felix Kopp <felix-source@phorax.com>
+ */
+class tx_beuser_switchbackuser {
+
+       /**
+        * Switch backen user session
+        *
+        * @param array $params
+        * @param t3lib_userAuth $that
+        * @see t3lib_userauth::logoff()
+        */
+       function switchBack($params, $that) {
+
+                       // Is a backend session handled?
+               if ($that->session_table !== 'be_sessions' || !$that->user['uid'] || !$that->user['ses_backuserid'])
+                       return;
+
+                       // @TODO: Move update functionality to Tx_Beuser_Domain_Repository_BackendUserSessionRepository
+               $updateData = array(
+                       'ses_userid' => $that->user['ses_backuserid'],
+                       'ses_backuserid' => 0
+               );
+
+               $GLOBALS['TYPO3_DB']->exec_UPDATEquery(
+                       'be_sessions',
+                       'ses_id = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($GLOBALS['BE_USER']->id, 'be_sessions') .
+                                       ' AND ses_name = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr(t3lib_beUserAuth::getCookieName(), 'be_sessions') .
+                                       ' AND ses_userid=' . intval($GLOBALS['BE_USER']->user['uid']),
+                       $updateData
+               );
+
+               $redirectUrl = $GLOBALS['BACK_PATH'] . 'index.php' . ($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? '' : '?commandLI=1');
+               t3lib_utility_Http::redirect($redirectUrl);
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/.htaccess b/typo3/sysext/beuser/Resources/Private/.htaccess
new file mode 100755 (executable)
index 0000000..3418e55
--- /dev/null
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Language/locallang.xlf b/typo3/sysext/beuser/Resources/Private/Language/locallang.xlf
new file mode 100644 (file)
index 0000000..32f3865
--- /dev/null
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0">
+       <file source-language="en" datatype="plaintext" original="messages" date="2012-07-16T10:11:32Z" product-name="beuser">
+               <header/>
+               <body>
+                       <trans-unit id="activeSessions" xml:space="preserve">
+                               <source>Active Sessions</source>
+                       </trans-unit>
+                       <trans-unit id="userName" xml:space="preserve">
+                               <source>Username</source>
+                       </trans-unit>
+                       <trans-unit id="realName" xml:space="preserve">
+                               <source>Real Name</source>
+                       </trans-unit>
+                       <trans-unit id="lastAccess" xml:space="preserve">
+                               <source>Last access</source>
+                       </trans-unit>
+                       <trans-unit id="ipAddress" xml:space="preserve">
+                               <source>IP address</source>
+                       </trans-unit>
+                       <trans-unit id="backendUserListing" xml:space="preserve">
+                               <source>Backend User Listing</source>
+                       </trans-unit>
+                       <trans-unit id="email" xml:space="preserve">
+                               <source>Email</source>
+                       </trans-unit>
+                       <trans-unit id="admin" xml:space="preserve">
+                               <source>Admin</source>
+                       </trans-unit>
+                       <trans-unit id="yes" xml:space="preserve">
+                               <source>Yes</source>
+                       </trans-unit>
+                       <trans-unit id="no" xml:space="preserve">
+                               <source>No</source>
+                       </trans-unit>
+                       <trans-unit id="never" xml:space="preserve">
+                               <source>Never</source>
+                       </trans-unit>
+                       <trans-unit id="disable" xml:space="preserve">
+                               <source>Disable</source>
+                       </trans-unit>
+                       <trans-unit id="startDateAndTime" xml:space="preserve">
+                               <source>Start</source>
+                       </trans-unit>
+                       <trans-unit id="endDateAndTime" xml:space="preserve">
+                               <source>Stop</source>
+                       </trans-unit>
+                       <trans-unit id="lastLogin" xml:space="preserve">
+                               <source>Last login</source>
+                       </trans-unit>
+                       <trans-unit id="allowedLanguages" xml:space="preserve">
+                               <source>Limit to languages</source>
+                       </trans-unit>
+                       <trans-unit id="dbMountPoints" xml:space="preserve">
+                               <source>DB mountpoints</source>
+                       </trans-unit>
+                       <trans-unit id="fileMounts" xml:space="preserve">
+                               <source>File mountpoints</source>
+                       </trans-unit>
+                       <trans-unit id="disableIpLock" xml:space="preserve">
+                               <source>Disable IP lock</source>
+                       </trans-unit>
+                       <trans-unit id="compareBackendUsers" xml:space="preserve">
+                               <source>Compare backend users</source>
+                       </trans-unit>
+                       <trans-unit id="status" xml:space="preserve">
+                               <source>Status</source>
+                       </trans-unit>
+                       <trans-unit id="both" xml:space="preserve">
+                               <source>Both</source>
+                       </trans-unit>
+                       <trans-unit id="any" xml:space="preserve">
+                               <source>Any</source>
+                       </trans-unit>
+                       <trans-unit id="adminOnly" xml:space="preserve">
+                               <source>Admin only</source>
+                       </trans-unit>
+                       <trans-unit id="normalUserOnly" xml:space="preserve">
+                               <source>Normal users only</source>
+                       </trans-unit>
+                       <trans-unit id="activeOnly" xml:space="preserve">
+                               <source>Active only</source>
+                       </trans-unit>
+                       <trans-unit id="inactiveOnly" xml:space="preserve">
+                               <source>Inactive only</source>
+                       </trans-unit>
+                       <trans-unit id="loginBefore" xml:space="preserve">
+                               <source>Login before</source>
+                       </trans-unit>
+                       <trans-unit id="neverLoggedIn" xml:space="preserve">
+                               <source>Never logged in</source>
+                       </trans-unit>
+                       <trans-unit id="filter" xml:space="preserve">
+                               <source>Filter</source>
+                       </trans-unit>
+                       <trans-unit id="reallyLogout" xml:space="preserve">
+                               <source>Really logout</source>
+                       </trans-unit>
+                       <trans-unit id="endSession" xml:space="preserve">
+                               <source>End session</source>
+                       </trans-unit>
+                       <trans-unit id="backendUsers" xml:space="preserve">
+                               <source>Backend users</source>
+                       </trans-unit>
+                       <trans-unit id="onlineUsers" xml:space="preserve">
+                               <source>Online users</source>
+                       </trans-unit>
+                       <trans-unit id="backendUserAdministration" xml:space="preserve">
+                               <source>Backend User Administration</source>
+                       </trans-unit>
+                       <trans-unit id="backendUserGroup" xml:space="preserve">
+                               <source>User group</source>
+                       </trans-unit>
+                       <trans-unit id="backendUserGroups" xml:space="preserve">
+                               <source>Member of groups</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Language/locallang_mod.xlf b/typo3/sysext/beuser/Resources/Private/Language/locallang_mod.xlf
new file mode 100755 (executable)
index 0000000..5ac1b03
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0">
+       <file source-language="en" datatype="plaintext" original="messages" date="2012-02-06T16:10:22Z" product-name="beuser">
+               <header/>
+               <body>
+                       <trans-unit id="mlang_labels_tablabel" xml:space="preserve">
+                               <source>Backend Users</source>
+                       </trans-unit>
+                       <trans-unit id="mlang_labels_tabdescr" xml:space="preserve">
+                               <source>Admin backend users</source>
+                       </trans-unit>
+                       <trans-unit id="mlang_tabs_tab" xml:space="preserve">
+                               <source>Backend users</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Layouts/Default.html b/typo3/sysext/beuser/Resources/Private/Layouts/Default.html
new file mode 100755 (executable)
index 0000000..c7acc6c
--- /dev/null
@@ -0,0 +1,35 @@
+<f:be.container addCssFile="{f:uri.resource(path:'Css/style.css')}">
+       <div class="typo3-fullDoc">
+               <div id="typo3-docheader">
+                       <div class="typo3-docheader-functions">
+                               <div class="left">
+                                       <f:be.buttons.csh />
+                                       <f:be.menus.actionMenu>
+                                               <f:be.menus.actionMenuItem label="{f:translate(key: 'backendUsers')}" controller="BackendUser" action="index" />
+                                               <f:be.menus.actionMenuItem label="{f:translate(key: 'onlineUsers')}" controller="BackendUser" action="online" />
+                                       </f:be.menus.actionMenu>
+                               </div>
+                               <div class="right">
+                               </div>
+                       </div>
+                       <div class="typo3-docheader-buttons">
+                               <div class="left">
+                                       <f:render section="iconButtons" />
+                               </div>
+                               <div class="right">
+                                       <f:be.buttons.shortcut />
+                               </div>
+                       </div>
+               </div>
+               <div id="typo3-docbody">
+                       <div id="typo3-inner-docbody">
+                               <h2><f:translate key="backendUserAdministration">Backend User Administration</f:translate></h2>
+
+                               <f:flashMessages renderMode="div" />
+
+                               <f:render section="content" />
+
+                       </div>
+               </div>
+       </div>
+</f:be.container>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html b/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html
new file mode 100755 (executable)
index 0000000..df8216c
--- /dev/null
@@ -0,0 +1,61 @@
+{namespace bu = Tx_Beuser_ViewHelpers}
+
+<tr class="db_list_normal">
+       <td class="col-icon">
+               <a href="#" onClick="showClickmenu('be_users', '{backendUser.uid}', '1', '', '', ''); return false;" title="id={backendUser.uid}">
+                       <bu:spriteIconForRecord table="be_users" object="{backendUser}" />
+               </a>
+       </td>
+       <td>
+               <b>{backendUser.userName}</b>
+       </td>
+       <td>{backendUser.realName}</td>
+       <td>
+               <f:link.action
+                       action="addToCompareList"
+                       arguments="{uid: backendUser.uid}"
+               >
+                       <bu:spriteManagerIcon iconName="actions-edit-add"/>
+                       <f:translate key="compare">Compare</f:translate>
+               </f:link.action>
+       </td>
+       <td>
+               <a href="#" onclick="top.launchView('be_users', '{backendUser.uid}'); return false;">
+                       <bu:spriteManagerIcon iconName="actions-document-info" />
+               </a>
+               <a href="alt_doc.php?edit[be_users][{backendUser.uid}]=edit&returnUrl={returnUrl}">
+                       <bu:spriteManagerIcon iconName="actions-document-open" />
+               </a>
+               <f:if condition="{backendUser.isDisabled} == 1">
+                       <f:then>
+                               <a href="<bu:issueCommand parameters="tce_db.php?&data[be_users][{backendUser.uid}][disable]=0&redirect={redirectUrl}" />">
+                                       <bu:spriteManagerIcon iconName="actions-edit-unhide" options="{title: 'unhide'}" />
+                               </a>
+                       </f:then>
+                       <f:else>
+                               <a href="<bu:issueCommand parameters="tce_db.php?&data[be_users][{backendUser.uid}][disable]=1&redirect={redirectUrl}" />">
+                                       <bu:spriteManagerIcon iconName="actions-edit-hide" options="{title: 'hide'}" />
+                               </a>
+                       </f:else>
+               </f:if>
+               <f:comment>
+                       No need to check if currently listed user is current user.
+                       SU does not work with admin users and current user must always be admin.
+                       Only admin users may use the backend user administration.
+               </f:comment>
+               <f:if condition="{backendUser.active} == 1">
+                       <bu:SU backendUser="{backendUser}" emulate="TRUE" />
+                       <bu:SU backendUser="{backendUser}" emulate="FALSE" />
+               </f:if>
+       </td>
+       <td>
+               <f:if condition="{backendUser.lastLoginDateAndTime}">
+                       <f:then>
+                               <f:format.date format="{dateFormat} {timeFormat}">{backendUser.lastLoginDateAndTime}</f:format.date>
+                       </f:then>
+                       <f:else>
+                               <f:translate key="never">Never</f:translate>
+                       </f:else>
+               </f:if>
+       </td>
+</tr>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/OnlineListRow.html b/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/OnlineListRow.html
new file mode 100755 (executable)
index 0000000..b8e6bed
--- /dev/null
@@ -0,0 +1,43 @@
+{namespace bu = Tx_Beuser_ViewHelpers}
+
+<tr class="db_list_normal">
+       <td>
+               <b>{onlineUser.backendUser.userName}</b>
+       </td>
+       <td>
+               {onlineUser.backendUser.realName}
+       </td>
+       <td>
+               <a href="#" onclick="top.launchView('be_users', '{onlineUser.backendUser.uid}',''); return false;">
+                       <bu:SpriteManagerIcon iconName="actions-document-info" />
+               </a>
+       </td>
+
+       <f:for each="{onlineUser.sessions}" as="session" key="sessionKey">
+               <f:if condition="{sessionKey} > 0">
+                       <f:then>
+                               <tr class="db_list_normal">
+                                       <td colspan="3"></td>
+                       </f:then>
+               </f:if>
+               <td>
+                       <f:format.date format="{dateFormat} {timeFormat}">{session.timestamp}</f:format.date>
+               </td>
+               <td>{session.ip}</td>
+               <td>
+                       <f:if condition="{currentSessionId} == {session.id}">
+                               <f:else>
+                                       <f:link.action
+                                               action="terminateBackendUserSession"
+                                               controller="BackendUser"
+                                               arguments="{backendUser: onlineUser.backendUser, sessionId: session.id}"
+                                               onclick="javascript:return confirm('{f:translate(key: \"reallyLogout\")} {onlineUser.backendUser.userName}?');"
+                                       >
+                                               <bu:spriteManagerIcon iconName="actions-document-close" />
+                                               <f:translate key="endSession">End session</f:translate>
+                                       </f:link.action>
+                               </f:else>
+                       </f:if>
+               </td>
+       </tr>
+</f:for>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Partials/Filters/BackendUser/Index.html b/typo3/sysext/beuser/Resources/Private/Partials/Filters/BackendUser/Index.html
new file mode 100755 (executable)
index 0000000..4244bbf
--- /dev/null
@@ -0,0 +1,47 @@
+{namespace bu = Tx_Beuser_ViewHelpers}
+
+<bu:Section title="Filter" collapsible="TRUE">
+       <f:form action="index" objectName="demand" object="{demand}">
+               <div>
+                       <label for="tx_Beuser_username"><f:translate key="userName">Username</f:translate></label>
+                       <f:form.textfield
+                               id="tx_Beuser_username"
+                               property="userName"
+                       />
+               </div>
+               <div>
+                       <label for="tx_Beuser_usertype"><f:translate key="admin">Admin</f:translate></label>
+                       <f:form.select
+                               id="tx_Beuser_usertype"
+                               property="userType"
+                               options="{0: '{f:translate(key:\"both\")}', 1: '{f:translate(key:\"adminOnly\")}', 2: '{f:translate(key:\"normalUserOnly\")}'}"
+                       />
+               </div>
+               <div>
+                       <label for="tx_Beuser_status"><f:translate key="status">Status</f:translate></label>
+                       <f:form.select
+                               id="tx_Beuser_status"
+                               property="status"
+                               options="{0: '{f:translate(key:\"both\")}', 1: '{f:translate(key:\"activeOnly\")}', 2: '{f:translate(key:\"inactiveOnly\")}'}"
+                       />
+               </div>
+               <div>
+                       <label for="tx_Beuser_logins"><f:translate key="login">Login</f:translate></label>
+                       <f:form.select
+                               id="tx_Beuser_logins"
+                               property="logins"
+                               options="{0: '{f:translate(key:\"both\")}', 1: '{f:translate(key:\"loginBefore\")}', 2: '{f:translate(key:\"neverLoggedIn\")}'}"
+                       />
+               </div>
+               <div>
+                       <label for="tx_beuser_backendUserGroup"><f:translate key="backendUserGroup">User Group</f:translate></label>
+                       <f:form.select
+                               id="tx_beuser_backendUserGroup"
+                               property="backendUserGroup"
+                               options="{backendUserGroups}"
+                               optionLabelField="title"
+                       />
+               </div>
+               <f:form.submit class="indent" value="{f:translate(key: 'filter')}" />
+       </f:form>
+</bu:Section>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Compare.html b/typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Compare.html
new file mode 100755 (executable)
index 0000000..d440850
--- /dev/null
@@ -0,0 +1,199 @@
+{namespace bu = Tx_Beuser_ViewHelpers}
+
+<f:layout name="Default" />
+
+<f:section name="iconButtons">
+       <f:link.action action="index"><bu:SpriteManagerIcon iconName="actions-view-go-back" /></f:link.action>
+</f:section>
+
+<f:section name="content">
+       <h3><f:translate key="compareBackendUsers">Compare backend users</f:translate></h3>
+
+       <table border="0" cellpadding="0" cellspacing="0" id="tx_beuser_compare" class="typo3-dblist">
+               <tr class="t3-row-header">
+                       <td class="label"></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <a href="#" onClick="showClickmenu('be_users', '{compareUser.uid}', '1', '', '', ''); return false;" title="id={compareUser.uid}">
+                                               <bu:SpriteIconForRecord table="be_users" object="{compareUser}" />
+                                       </a>
+                                       {compareUser.userName}
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="realName">Real name</f:translate></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>{compareUser.realName}</td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="email">Email</f:translate></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:if condition="{compareUser.email}">
+                                               <f:then>
+                                                       <f:link.email email="{compareUser.email}" />
+                                               </f:then>
+                                               <f:else>
+                                                       -
+                                               </f:else>
+                                       </f:if>
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="admin">Admin</f:translate></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:if condition="{compareUser.isAdministrator}">
+                                               <f:then>
+                                                       <f:translate key="yes">Yes</f:translate>
+                                               </f:then>
+                                               <f:else>
+                                                       <f:translate key="no">No</f:translate>
+                                               </f:else>
+                                       </f:if>
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="disable">Disable</f:translate></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:if condition="{compareUser.isDisabled} == 1">
+                                               <f:then>
+                                                       <a href="<bu:issueCommand parameters="tce_db.php?&data[be_users][{compareUser.uid}][disable]=0&redirect={redirectUrl}" />">
+                                                               <bu:SpriteManagerIcon iconName="actions-edit-unhide" options="{title: 'unhide'}" />
+                                                       </a>
+                                               </f:then>
+                                               <f:else>
+                                                       <a href="<bu:issueCommand parameters="tce_db.php?&data[be_users][{compareUser.uid}][disable]=1&redirect={redirectUrl}" />">
+                                                               <bu:SpriteManagerIcon iconName="actions-edit-hide" options="{title: 'hide'}" />
+                                                       </a>
+                                               </f:else>
+                                       </f:if>
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="startDateAndTime" /></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:if condition="{compareUser.startDateAndTime}">
+                                               <f:then>
+                                                       <f:format.date format="{dateFormat} {timeFormat}">{compareUser.startDateAndTime}</f:format.date>
+                                               </f:then>
+                                               <f:else>
+                                                       -
+                                               </f:else>
+                                       </f:if>
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="endDateAndTime" /></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:if condition="{compareUser.endDateAndTime}">
+                                               <f:then>
+                                                       <f:format.date format="{dateFormat} {timeFormat}">{compareUser.endDateAndTime}</f:format.date>
+                                               </f:then>
+                                               <f:else>
+                                                       -
+                                               </f:else>
+                                       </f:if>
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="lastLogin">Last login</f:translate></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:if condition="{compareUser.lastLoginDateAndTime}">
+                                               <f:then>
+                                                       <f:format.date format="{dateFormat} {timeFormat}">{compareUser.lastLoginDateAndTime}</f:format.date>
+                                               </f:then>
+                                               <f:else>
+                                                       <f:translate key="never">Never</f:translate>
+                                               </f:else>
+                                       </f:if>
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="backendUserGroups">Member of groups</f:translate></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:for each="{compareUser.BackendUserGroups}" as="backendUserGroup">
+                                               <a href="#" onClick="showClickmenu('be_groups', '{backendUserGroup.uid}', '1', '', '', ''); return false;" title="id={backendUserGroup.uid}">
+                                                       <bu:SpriteIconForRecord table="be_users" object="{backendUserGroup}" />
+                                               </a>
+                                               {backendUserGroup.title}<br />
+                                       </f:for>
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="allowedLanguages">Limit to languages</f:translate></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:if condition="{compareUser.allowedLanguages}">
+                                               <f:then>
+                                                       <bu:display.sysLanguage uids="{compareUser.allowedLanguages}" />
+                                               </f:then>
+                                               <f:else>
+                                                       -
+                                               </f:else>
+                                       </f:if>
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="dbMountPoints">DB mountpoints</f:translate></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:if condition="{compareUser.dbMountPoints}">
+                                               <f:then>
+                                                       <bu:display.pages uids="{compareUser.dbMountPoints}" />
+                                               </f:then>
+                                               <f:else>
+                                                       -
+                                               </f:else>
+                                       </f:if>
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="fileMounts">File mountpoints</f:translate></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:if condition="{compareUser.fileMountPoints}">
+                                               <f:then>
+                                                       <bu:display.sysFileMounts uids="{compareUser.fileMountPoints}" />
+                                               </f:then>
+                                               <f:else>
+                                                       -
+                                               </f:else>
+                                       </f:if>
+                               </td>
+                       </f:for>
+               </tr>
+               <tr class="db_list_normal">
+                       <td><h5><f:translate key="disableIpLock">Disable IP lock</f:translate></h5></td>
+                       <f:for each="{compareUserList}" as="compareUser">
+                               <td>
+                                       <f:if condition="{compareUser.ipLockIsDisabled} == 1">
+                                               <f:then>
+                                                       Yes
+                                               </f:then>
+                                               <f:else>
+                                                       No
+                                               </f:else>
+                                       </f:if>
+                               </td>
+                       </f:for>
+               </tr>
+       </table>
+
+</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Index.html b/typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Index.html
new file mode 100755 (executable)
index 0000000..76af732
--- /dev/null
@@ -0,0 +1,103 @@
+{namespace bu = Tx_Beuser_ViewHelpers}
+
+<f:layout name="Default" />
+
+<f:section name="iconButtons">
+       <a href="#" onclick="window.location.href='alt_doc.php?returnUrl='+T3_THIS_LOCATION+'&edit[be_users][0]=new'; return false;"><bu:SpriteManagerIcon iconName="actions-document-new" /></a>
+</f:section>
+
+<f:section name="content">
+       <f:comment>
+               Listing of users on compare list
+       </f:comment>
+
+       <f:if condition="{compareUserList}">
+               <bu:Section title="Compare" collapsible="TRUE">
+                       <ul id="compareUsers">
+                               <f:for each="{compareUserList}" as="compareUser">
+                                       <li>
+                                               <f:link.action
+                                                       action="removeFromCompareList"
+                                                       arguments="{uid: compareUser.uid}"
+                                               ><bu:SpriteManagerIcon iconName="actions-selection-delete" /></f:link.action>
+
+                                               <a href="#" onClick="showClickmenu('be_users', '{compareUser.uid}', '1', '', '', ''); return false;" title="id={compareUser.uid}">
+                                                       <bu:SpriteIconForRecord table="be_users" object="{compareUser}" />
+                                               </a>
+
+                                               {compareUser.userName}
+                                       </li>
+                               </f:for>
+                       </ul>
+
+                       <f:form action="compare">
+                               <f:form.submit value="Compare user list" />
+                       </f:form>
+
+               </bu:Section>
+       </f:if>
+
+       <f:comment>
+               Filter section
+       </f:comment>
+
+       <f:render partial="Filters/BackendUser/Index" arguments="{demand: demand, backendUserGroups: backendUserGroups}" />
+
+       <f:comment>
+               Listing of all users
+       </f:comment>
+
+       <h3><f:translate key="backendUserListing">Backend User Listing</f:translate></h3>
+
+       <f:if condition="<f:count subject='{backendUsers}' /> > 50">
+               <f:then>
+                       <f:widget.paginate objects="{backendUsers}" as="paginatedBackendUsers" configuration="{itemsPerPage: 50, insertAbove: 1, insertBelow: 1}">
+                               <table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">
+                                       <tr class="t3-row-header">
+                                               <td></td>
+                                               <td><f:translate key="userName">Username</f:translate></td>
+                                               <td><f:translate key="realName">Real name</f:translate></td>
+                                               <td>&nbsp;</td>
+                                               <td>&nbsp;</td>
+                                               <td><f:translate key="lastLogin">Last login</f:translate></td>
+                                       </tr>
+                                       <f:for each="{paginatedBackendUsers}" as="backendUser">
+                                               <f:render partial="BackendUser/IndexListRow" arguments="{demand: demand, backendUser: backendUser, dateFormat: dateFormat, timeFormat: timeFormat, returnUrl: returnUrl}" />
+                                       </f:for>
+                                       <f:comment>
+                                               Footer row: no officially defined style yet
+                                       </f:comment>
+                                       <tr>
+                                               <td colspan="6">
+                                                       <f:count subject="{backendUsers}" /> Users
+                                               </td>
+                                       </tr>
+                               </table>
+                       </f:widget.paginate>
+               </f:then>
+               <f:else>
+                       <table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">
+                               <tr class="t3-row-header">
+                                       <td></td>
+                                       <td><f:translate key="userName">Username</f:translate></td>
+                                       <td><f:translate key="realName">Real name</f:translate></td>
+                                       <td>&nbsp;</td>
+                                       <td>&nbsp;</td>
+                                       <td><f:translate key="lastLogin">Last login</f:translate></td>
+                               </tr>
+                               <f:for each="{backendUsers}" as="backendUser">
+                                       <f:render partial="BackendUser/IndexListRow" arguments="{demand: demand, backendUser: backendUser, dateFormat: dateFormat, timeFormat: timeFormat, returnUrl: returnUrl}" />
+                               </f:for>
+                               <f:comment>
+                                       Footer row: no officially defined style yet
+                               </f:comment>
+                               <tr>
+                                       <td colspan="6">
+                                               <f:count subject="{backendUsers}" /> Users
+                                       </td>
+                               </tr>
+                       </table>
+               </f:else>
+       </f:if>
+
+</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Online.html b/typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Online.html
new file mode 100755 (executable)
index 0000000..13b01e6
--- /dev/null
@@ -0,0 +1,34 @@
+{namespace bu = Tx_Beuser_ViewHelpers}
+
+<f:layout name="Default" />
+
+<f:section name="iconButtons">
+       <f:link.action controller="BackendUser" action="online">{onlineUser.backendUser.realName}</f:link.action>
+</f:section>
+
+<f:section name="content">
+       <h3><f:translate key="activeSessions">Active Sessions</f:translate></h3>
+
+       <table border="0" cellspacing="0" cellpadding="0" class="typo3-dblist">
+               <tr class="t3-row-header">
+                       <td>
+                               <f:translate key="userName">Username</f:translate>
+                       </td>
+                       <td colspan="2">
+                               <f:translate key="realName">Real name</f:translate>
+                       </td>
+                       <td>
+                               <f:translate key="lastAccess">Last access</f:translate>
+                       </td>
+                       <td>
+                               <f:translate key="ipAddress">IP address</f:translate>
+                       </td>
+                       <td></td>
+               </tr>
+
+               <f:for each="{onlineUsersAndSessions}" as="onlineUser">
+                       <f:render partial="BackendUser/OnlineListRow" arguments="{onlineUser: onlineUser, dateFormat: dateFormat, timeFormat: timeFormat, currentSessionId: currentSessionId}" />
+               </f:for>
+       </table>
+
+</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Public/Css/style.css b/typo3/sysext/beuser/Resources/Public/Css/style.css
new file mode 100755 (executable)
index 0000000..10c502e
--- /dev/null
@@ -0,0 +1,47 @@
+/**
+ * @group: Structure
+ */
+
+#compareUsers { margin-bottom: 10px; }
+
+div.collapsibleSection { background-color: #DADADA; padding: 7px; margin-bottom: 10px; }
+
+#tx_beuser_compare td { min-width: 170px; }
+
+/**
+ * @end
+ */
+
+/**
+ * @group: Form
+ */
+
+form label { float: left; height: 20px; line-height: 20px; margin-right: 10px; width: 90px; }
+form div { clear: both; margin-bottom: 5px; }
+
+       form .field-row,
+       form .button-row { clear: both; margin-bottom: 10px; }
+       form .indent { margin-left: 100px; }
+
+/**
+ * @end
+ */
+
+/**
+ * @group: Paginate
+ */
+
+.f3-widget-paginator { display: block; float: left; margin: 0 0 10px; }
+
+       .f3-widget-paginator li { font-weight: bold; display: block; float: left; width: 30px; text-align: center; margin: 0 2px 2px; }
+
+       .f3-widget-paginator li.current { border: 1px solid black; padding: 2px; }
+
+       .f3-widget-paginator li.next,
+       .f3-widget-paginator li.previous { width: auto; }
+
+       .f3-widget-paginator a { font-weight: normal; display: block; border: 1px solid black; padding: 2px; }
+
+/**
+ * @end
+ */
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Tests/Unit/Domain/Model/BackendUserTest.php b/typo3/sysext/beuser/Tests/Unit/Domain/Model/BackendUserTest.php
new file mode 100755 (executable)
index 0000000..ebb0944
--- /dev/null
@@ -0,0 +1,120 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Test case for class Tx_Beuser_Domain_Model_BackendUser
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Model_BackendUserTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
+       /**
+        * @var Tx_Beuser_Domain_Model_BackendUser
+        */
+       protected $fixture;
+
+       public function setUp() {
+               $this->fixture = new Tx_Beuser_Domain_Model_BackendUser();
+       }
+
+       public function tearDown() {
+               unset($this->fixture);
+       }
+
+       /**
+        * @test
+        */
+       public function getUidReturnsInitialValueForInt() {
+               $this->assertTrue($this->fixture->getUid() === NULL, 'Not uid set after initialization.');
+       }
+
+       /**
+        * @test
+        */
+       public function getUserNameReturnsInitialValueForString() {
+               $this->assertTrue($this->fixture->getUserName() === '', 'Username not empty');
+       }
+
+       /**
+        * @test
+        */
+       public function setUserNameForStringSetsUserName() {
+               $newUserName = 'DonJuan';
+               $this->fixture->setUserName($newUserName);
+
+               $this->assertSame(
+                       $this->fixture->getUserName(),
+                       $newUserName
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function getRealNameReturnInitialValueForString() {
+               $this->assertTrue($this->fixture->getRealName() === '', 'Real name not empty');
+       }
+
+       /**
+        * @test
+        */
+       public function setRealNameForStringSetsName() {
+               $realName = 'Conceived at T3CON2018';
+               $this->fixture->setRealName($realName);
+
+               $this->assertSame(
+                       $this->fixture->getRealName(),
+                       $realName
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function getAdminReturnInitialValueForBoolean() {
+               $this->assertTrue($this->fixture->getIsAdministrator() === FALSE, 'Admin status is correct.');
+       }
+
+       /**
+        * @test
+        */
+       public function setAdminToTrueSetsAdmin() {
+               $this->fixture->setIsAdministrator(TRUE);
+               $this->assertTrue($this->fixture->getIsAdministrator(), 'Admin status is not true, after setting to true.');
+       }
+
+       /**
+        * @test
+        */
+       public function setAdminToFalseSetsAdmin() {
+               $this->fixture->setIsAdministrator(FALSE);
+               $this->assertFalse($this->fixture->getIsAdministrator(), 'Admin status is not false, after setting to false.');
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Tests/Unit/Domain/Model/DemandTest.php b/typo3/sysext/beuser/Tests/Unit/Domain/Model/DemandTest.php
new file mode 100755 (executable)
index 0000000..85414a6
--- /dev/null
@@ -0,0 +1,153 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Test case for class Tx_Beuser_Domain_Model_Demand
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Model_DemandTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
+
+       /**
+        * @var Tx_Beuser_Domain_Model_Demand
+        */
+       protected $fixture;
+
+       public function setUp() {
+               $this->fixture = new Tx_Beuser_Domain_Model_Demand();
+       }
+
+       public function tearDown() {
+               unset($this->fixture);
+       }
+
+       /**
+        * @test
+        */
+       public function setUserTypeAllExpectedValueForInt() {
+               $userType = Tx_Beuser_Domain_Model_Demand::ALL;
+               $this->fixture->setUserType($userType);
+               $this->assertSame($this->fixture->getUserType(), $userType);
+       }
+
+       /**
+        * @test
+        */
+       public function setUserTypeAdminOnlyExpectedValueForInt() {
+               $userType = Tx_Beuser_Domain_Model_Demand::USERTYPE_ADMINONLY;
+               $this->fixture->setUserType($userType);
+               $this->assertSame($this->fixture->getUserType(), $userType);
+       }
+
+       /**
+        * @test
+        */
+       public function setUserTypeUserOnlyExpectedValueForInt() {
+               $userType = Tx_Beuser_Domain_Model_Demand::USERTYPE_USERONLY;
+               $this->fixture->setUserType($userType);
+               $this->assertSame($this->fixture->getUserType(), $userType);
+       }
+
+       /**
+        * @test
+        */
+       public function setStatusAllExpectedValueForInt() {
+               $status = Tx_Beuser_Domain_Model_Demand::ALL;
+               $this->fixture->setStatus($status);
+               $this->assertSame($this->fixture->getStatus(), $status);
+       }
+
+       /**
+        * @test
+        */
+       public function setStatusActiveExpectedValueForInt() {
+               $status = Tx_Beuser_Domain_Model_Demand::STATUS_ACTIVE;
+               $this->fixture->setStatus($status);
+               $this->assertSame($this->fixture->getStatus(), $status);
+       }
+
+       /**
+        * @test
+        */
+       public function setStatusInactiveExpectedValueForInt() {
+               $status = Tx_Beuser_Domain_Model_Demand::STATUS_INACTIVE;
+               $this->fixture->setStatus($status);
+               $this->assertSame($this->fixture->getStatus(), $status);
+       }
+
+       /**
+        * @test
+        */
+       public function setLoginAllExpectedValueForInt() {
+               $login = Tx_Beuser_Domain_Model_Demand::ALL;
+               $this->fixture->setLogins($login);
+               $this->assertSame($this->fixture->getLogins(), $login);
+       }
+
+       /**
+        * @test
+        */
+       public function setLoginNoneExpectedValueForInt() {
+               $login = Tx_Beuser_Domain_Model_Demand::LOGIN_NONE;
+               $this->fixture->setLogins($login);
+               $this->assertSame($this->fixture->getLogins(), $login);
+       }
+
+       /**
+        * @test
+        */
+       public function setLoginxSameExpectedValueForInt() {
+               $login = Tx_Beuser_Domain_Model_Demand::LOGIN_SOME;
+               $this->fixture->setLogins($login);
+               $this->assertSame($this->fixture->getLogins(), $login);
+       }
+
+
+       /**
+        * @test
+        */
+       public function getUserNameInitialValueForString() {
+               $this->assertSame($this->fixture->getUserName(), '', 'UserName must be empty string.');
+       }
+
+       /**
+        * @test
+        */
+       public function setUserNameReturnExpectedValueForString() {
+               $newUserName = 'User#ää*%^name';
+               $this->fixture->setUserName($newUserName);
+               $this->assertSame(
+                       $this->fixture->getUserName(),
+                       $newUserName,
+                       'UserName is not as set before.'
+               );
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Tests/Unit/Domain/Repository/BackendUserRepositoryTest.php b/typo3/sysext/beuser/Tests/Unit/Domain/Repository/BackendUserRepositoryTest.php
new file mode 100755 (executable)
index 0000000..97a8b3b
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Felix Kopp <felix-source@phorax.com>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Testcase for the Tx_Beuser_Domain_Repository_BackendUserRepository class.
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Repository_BackendUserRepositoryTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
+
+       /**
+        * @var Tx_Beuser_Domain_Repository_BackendUserRepository
+        */
+       protected $fixture;
+
+       public function setUp() {
+               $this->objectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
+               $this->fixture = new Tx_Beuser_Domain_Repository_BackendUserRepository($this->objectManager);
+       }
+
+       public function tearDown() {
+               unset($this->fixture);
+               unset($this->objectManager);
+       }
+
+       /**
+        * @test
+        */
+       public function classCanBeInstantiated() {
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Tests/Unit/Domain/Repository/BackendUserSessionRepositoryTest.php b/typo3/sysext/beuser/Tests/Unit/Domain/Repository/BackendUserSessionRepositoryTest.php
new file mode 100755 (executable)
index 0000000..50fef2b
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Felix Kopp <felix-source@phorax.com>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Testcase for the Tx_Beuser_Domain_Repository_BackendUserSessionRepository class.
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Domain_Repository_BackendUserSessionRepositoryTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
+
+       /**
+        * @var Tx_Beuser_Domain_Repository_BackendUserSessionRepository
+        */
+       protected $fixture;
+
+       public function setUp() {
+               $this->objectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
+               $this->fixture = new Tx_Beuser_Domain_Repository_BackendUserSessionRepository($this->objectManager);
+       }
+
+       public function tearDown() {
+               unset($this->fixture);
+               unset($this->objectManager);
+       }
+
+       /**
+        * @test
+        */
+       public function classCanBeInstantiated() {
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Tests/Unit/Service/ModuleDataStorageServiceTest.php b/typo3/sysext/beuser/Tests/Unit/Service/ModuleDataStorageServiceTest.php
new file mode 100644 (file)
index 0000000..7cf66b5
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Test case for class Tx_Beuser_Service_ModuleDataStorageService
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @author Nikolas Hagelstein <nikolas.hagelstein@gmail.com>
+ * @package TYPO3
+ * @subpackage beuser
+ */
+class Tx_Beuser_Service_ModuleDataStorageServiceTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
+
+       /**
+        * @var Tx_Beuser_Service_ModuleDataStorageService
+        */
+       protected $fixture;
+
+       public function setUp() {
+               $this->fixture = $this->objectManager->get('Tx_Beuser_Service_ModuleDataStorageService');
+       }
+
+       public function tearDown() {
+               unset($this->fixture);
+       }
+
+       /**
+        * @test
+        */
+       public function loadModuleDataReturnsModuleDataObjectForEmptyModuleData() {
+                       // Simulate empty module data
+               unset ($GLOBALS['BE_USER']->uc['moduleData'][Tx_Beuser_Service_ModuleDataStorageService::KEY]);
+
+               $result = $this->fixture->loadModuleData();
+               $this->assertInstanceOf('Tx_Beuser_Domain_Model_ModuleData', $result);
+       }
+
+
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/class.tx_beuser.php b/typo3/sysext/beuser/class.tx_beuser.php
deleted file mode 100644 (file)
index b843ab4..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-/**
- * Class, adding SU link to context menu
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-
-
-
-
-
-
-
-
-
-
-
-
-/**
- * Class, adding SU link to context menu
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage tx_beuser
- */
-class tx_beuser {
-
-       /**
-        * Adding various standard options to the context menu.
-        * This includes both first and second level.
-        *
-        * @param       object          The calling object. Value by reference.
-        * @param       array           Array with the currently collected menu items to show.
-        * @param       string          Table name of clicked item.
-        * @param       integer         UID of clicked item.
-        * @return      array           Modified $menuItems array
-        */
-       function main(&$backRef, $menuItems, $table, $uid) {
-               $localItems = array();  // Accumulation of local items.
-
-                       // Detecting menu level
-               if ($GLOBALS['BE_USER']->isAdmin() && !$backRef->cmLevel && $table == 'be_users') {
-                       // LEVEL: Primary menu.
-
-                               // "SU" element added:
-                       $url = 'mod.php?M=tools_beuser&SwitchUser='.rawurlencode($uid).'&switchBackUser=1';
-                       $localItems[] = $backRef->linkItem(
-                               'Switch To User',
-                               $backRef->excludeIcon(t3lib_iconWorks::getSpriteIcon('actions-system-backend-user-emulate')),
-                               $backRef->urlRefForCM($url, '', 1, 'top'),
-                               1
-                       );
-
-                       $menuItems=array_merge($menuItems, $localItems);
-               }
-               return $menuItems;
-       }
-
-       /**
-        * Include local lang file.
-        *
-        * @return      array           Local lang array.
-        */
-       function includeLL() {
-               global $LANG;
-
-               $LOCAL_LANG = $GLOBALS['LANG']->includeLLFile('EXT:extra_page_cm_options/locallang.php', FALSE);
-               return $LOCAL_LANG;
-       }
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/class.tx_beuser_switchbackuser.php b/typo3/sysext/beuser/class.tx_beuser_switchbackuser.php
deleted file mode 100644 (file)
index 1bc3c6a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-/**
- * Backend user switchback
- *
- * @author     Sebastian Kurfürst <sebastian@garbage-group.de>
- */
-class tx_beuser_switchbackuser {
-       function switchBack($params, $that) {
-               if($that->session_table == 'be_sessions' && $that->user['uid'] && $that->user['ses_backuserid']) {
-                       $updateData = array(
-                               'ses_userid' => $that->user['ses_backuserid'],
-                               'ses_backuserid' => 0
-                               );
-                       $GLOBALS['TYPO3_DB']->exec_UPDATEquery('be_sessions', 'ses_id=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($GLOBALS['BE_USER']->id, 'be_sessions') . ' AND ses_name=' . $GLOBALS['TYPO3_DB']->fullQuoteStr(t3lib_beUserAuth::getCookieName(), 'be_sessions') . ' AND ses_userid=' . intval($GLOBALS['BE_USER']->user['uid']), $updateData);
-
-                       $redirectUrl = $GLOBALS['BACK_PATH'] . 'index.php' . ($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? '' : '?commandLI=1');
-                       t3lib_utility_Http::redirect($redirectUrl);
-               }
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/doc/TODO.txt b/typo3/sysext/beuser/doc/TODO.txt
deleted file mode 100755 (executable)
index 2e55337..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-- Ability to create groups incl. filemounts in users/groups dirs.
-- Ability to compare groups
-- Show x number of users in the list + ability to browse/search for a user.
-- Compare only "checked" users.
-- Link to Web>List, id=0
diff --git a/typo3/sysext/beuser/ext_autoload.php b/typo3/sysext/beuser/ext_autoload.php
new file mode 100755 (executable)
index 0000000..2bf4add
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+$extensionPath = t3lib_extMgm::extPath('beuser');
+
+return array(
+       'tx_beuser_switchbackuser' => $extensionPath . 'Classes/class.tx_beuser_switchbackuser.php'
+);
+
+?>
\ No newline at end of file
index 4ccd894..2429734 100755 (executable)
@@ -1,43 +1,40 @@
 <?php
 
-/***************************************************************
-* Extension Manager/Repository config file for ext "beuser".
-*
-* Auto generated 25-10-2011 13:10
-*
-* Manual updates:
-* Only the data in the array - everything else is removed by next
-* writing. "version" and "dependencies" must not be touched!
-***************************************************************/
+########################################################################
+# Extension Manager/Repository config file for ext "backend_users".
+#
+# Auto generated 01-04-2012 20:27
+#
+# Manual updates:
+# Only the data in the array - everything else is removed by next
+# writing. "version" and "dependencies" must not be touched!
+########################################################################
 
 $EM_CONF[$_EXTKEY] = array(
-       'title' => 'Tools>User Admin',
+       'title' => 'Backend User Administration',
        'description' => 'Backend user administration and overview. Allows you to compare the settings of users and verify their permissions and see who is online.',
        'category' => 'module',
-       'shy' => 1,
-       'dependencies' => '',
-       'conflicts' => '',
+       'author' => 'Felix Kopp',
+       'author_email' => 'felix-source@phorax.com',
+       'author_company' => 'PHORAX',
+       'shy' => '',
+       'dependencies' => 'extbase,fluid',
        'priority' => '',
-       'loadOrder' => '',
        'module' => 'mod',
-       'state' => 'stable',
-       'internal' => 0,
+       'state' => 'beta',
+       'internal' => '',
        'uploadfolder' => 0,
        'createDirs' => '',
        'modify_tables' => '',
        'clearCacheOnLoad' => 0,
        'lockType' => '',
-       'author' => 'Kasper Skaarhoj',
-       'author_email' => 'kasperYYYY@typo3.com',
-       'author_company' => 'Curby Soft Multimedia',
-       'CGLcompliance' => '',
-       'CGLcompliance_note' => '',
-       'version' => '1.1.0',
-       '_md5_values_when_last_written' => 'a:12:{s:19:"class.tx_beuser.php";s:4:"fac2";s:34:"class.tx_beuser_switchbackuser.php";s:4:"f010";s:12:"ext_icon.gif";s:4:"8f11";s:17:"ext_localconf.php";s:4:"c778";s:14:"ext_tables.php";s:4:"21c0";s:12:"doc/TODO.txt";s:4:"02ed";s:14:"mod/beuser.gif";s:4:"87e3";s:13:"mod/clear.gif";s:4:"cc11";s:12:"mod/conf.php";s:4:"fbc9";s:13:"mod/index.php";s:4:"f012";s:17:"mod/locallang.xlf";s:4:"921b";s:21:"mod/locallang_mod.xlf";s:4:"d713";}',
+       'version' => '2.0.0',
        'constraints' => array(
                'depends' => array(
                        'php' => '5.3.0-0.0.0',
-                       'typo3' => '4.6.0-0.0.0',
+                       'typo3' => '4.7.0-0.0.0',
+                       'extbase' => '4.7.0-0.0.0',
+                       'fluid' => '4.7.0-0.0.0',
                ),
                'conflicts' => array(
                ),
@@ -46,6 +43,8 @@ $EM_CONF[$_EXTKEY] = array(
        ),
        'suggests' => array(
        ),
+       'conflicts' => '',
+       '_md5_values_when_last_written' => 'a:38:{s:12:"ext_icon.gif";s:4:"8f11";s:14:"ext_tables.php";s:4:"ceab";s:28:"ext_typoscript_constants.txt";s:4:"bc87";s:24:"ext_typoscript_setup.txt";s:4:"be94";s:13:"locallang.xlf";s:4:"71f2";s:44:"Classes/Controller/BackendUserController.php";s:4:"23ff";s:49:"Classes/Controller/BackendUserGroupController.php";s:4:"e27c";s:36:"Classes/Domain/Model/BackendUser.php";s:4:"4109";s:41:"Classes/Domain/Model/BackendUserGroup.php";s:4:"8df4";s:31:"Classes/Domain/Model/Demand.php";s:4:"a66a";s:56:"Classes/Domain/Repository/BackendUserGroupRepository.php";s:4:"4375";s:51:"Classes/Domain/Repository/BackendUserRepository.php";s:4:"f9b5";s:58:"Classes/Domain/Repository/BackendUserSessionRepository.php";s:4:"2b01";s:46:"Classes/ViewHelpers/IssueCommandViewHelper.php";s:4:"3f29";s:36:"Classes/ViewHelpers/SUViewHelper.php";s:4:"7912";s:51:"Classes/ViewHelpers/SpriteManagerIconViewHelper.php";s:4:"eccc";s:53:"Classes/ViewHelpers/SpriteManagerRecordViewHelper.php";s:4:"23f4";s:33:"Configuration/TCA/BackendUser.php";s:4:"7174";s:38:"Configuration/TCA/BackendUserGroup.php";s:4:"2d57";s:38:"Configuration/TypoScript/constants.txt";s:4:"9647";s:34:"Configuration/TypoScript/setup.txt";s:4:"f901";s:46:"Resources/Private/Backend/Layouts/Default.html";s:4:"b339";s:58:"Resources/Private/Backend/Templates/BackendUser/Index.html";s:4:"91cc";s:59:"Resources/Private/Backend/Templates/BackendUser/Online.html";s:4:"0d20";s:57:"Resources/Private/Backend/Templates/BackendUser/Show.html";s:4:"f0ef";s:63:"Resources/Private/Backend/Templates/BackendUserGroup/Index.html";s:4:"f2e2";s:40:"Resources/Private/Language/locallang.xlf";s:4:"51cc";s:40:"Resources/Private/Language/locallang.xml";s:4:"8556";s:46:"Resources/Private/Language/locallang_admin.xml";s:4:"76bd";s:85:"Resources/Private/Language/locallang_csh_Tx_Beuser_domain_model_backenduser.xml";s:4:"8333";s:90:"Resources/Private/Language/locallang_csh_Tx_Beuser_domain_model_backendusergroup.xml";s:4:"ed7e";s:43:"Resources/Private/Language/locallang_db.xml";s:4:"ef24";s:38:"Resources/Private/Layouts/Default.html";s:4:"96db";s:35:"Resources/Public/Icons/relation.gif";s:4:"e615";s:67:"Resources/Public/Icons/Tx_Beuser_domain_model_backenduser.gif";s:4:"1103";s:72:"Resources/Public/Icons/Tx_Beuser_domain_model_backendusergroup.gif";s:4:"1103";s:48:"Tests/Unit/Domain/Model/BackendUserGroupTest.php";s:4:"d5a1";s:43:"Tests/Unit/Domain/Model/BackendUserTest.php";s:4:"7c60";}',
 );
 
 ?>
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index 0ce1108..d8767e7
@@ -1,10 +1,9 @@
 <?php
+
 if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
 
-require_once(t3lib_extMgm::extPath('beuser') . 'class.tx_beuser_switchbackuser.php');
-
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][] = 'tx_beuser_switchbackuser->switchBack';
 
 ?>
\ No newline at end of file
index a8f361d..5b802a1 100755 (executable)
@@ -1,14 +1,27 @@
 <?php
+
 if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
 
-if (TYPO3_MODE=='BE') {
-       t3lib_extMgm::addModule('tools', 'beuser', 'top', t3lib_extMgm::extPath($_EXTKEY).'mod/');
+if (TYPO3_MODE === 'BE') {
 
-       $GLOBALS['TBE_MODULES_EXT']['xMOD_alt_clickmenu']['extendCMclasses'][] = array(
-               'name' => 'tx_beuser',
-               'path' => t3lib_extMgm::extPath($_EXTKEY).'class.tx_beuser.php'
+               // Module Admin > Backend Users
+       Tx_Extbase_Utility_Extension::registerModule(
+               $_EXTKEY,
+               'tools',
+               'tx_Beuser',
+               'top',
+               array(
+                       'BackendUser' => 'index, addToCompareList, removeFromCompareList, compare, online, terminateBackendUserSession',
+               ),
+               array(
+                       'access' => 'user,group',
+                       'icon'   => 'EXT:' . $_EXTKEY . '/ext_icon.gif',
+                       'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod.xlf',
+               )
        );
+
 }
+
 ?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/ext_typoscript_setup.txt b/typo3/sysext/beuser/ext_typoscript_setup.txt
new file mode 100755 (executable)
index 0000000..3edab89
--- /dev/null
@@ -0,0 +1,31 @@
+module.tx_beuser {
+       persistence {
+               storagePid = 0
+       }
+}
+
+config.tx_extbase {
+       persistence {
+               classes {
+                       Tx_Beuser_Domain_Model_BackendUser {
+                               mapping {
+                                       tableName = be_users
+                                       columns {
+                                               allowed_languages.mapOnProperty = allowedLanguages
+                                               file_mountpoints.mapOnProperty = fileMountPoints
+                                               db_mountpoints.mapOnProperty = dbMountPoints
+                                               usergroup.mapOnProperty = backendUserGroups
+                                       }
+                               }
+                       }
+                       Tx_Beuser_Domain_Model_BackendUserGroup {
+                               mapping {
+                                       tableName = be_groups
+                                       columns {
+                                               subgroup.mapOnProperty = subGroups
+                                       }
+                               }
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/typo3/sysext/beuser/mod/beuser.gif b/typo3/sysext/beuser/mod/beuser.gif
deleted file mode 100755 (executable)
index fedf785..0000000
Binary files a/typo3/sysext/beuser/mod/beuser.gif and /dev/null differ
diff --git a/typo3/sysext/beuser/mod/clear.gif b/typo3/sysext/beuser/mod/clear.gif
deleted file mode 100755 (executable)
index 9ed1269..0000000
Binary files a/typo3/sysext/beuser/mod/clear.gif and /dev/null differ
diff --git a/typo3/sysext/beuser/mod/conf.php b/typo3/sysext/beuser/mod/conf.php
deleted file mode 100755 (executable)
index 3f55964..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-$MLANG['default']['tabs_images']['tab'] = 'beuser.gif';
-$MLANG['default']['ll_ref']='LLL:EXT:beuser/mod/locallang_mod.xml';
-
-$MCONF['script']='_DISPATCH';
-$MCONF['access']='admin';
-$MCONF['name']='tools_beuser';
-?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/mod/index.php b/typo3/sysext/beuser/mod/index.php
deleted file mode 100755 (executable)
index 0524615..0000000
+++ /dev/null
@@ -1,1491 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-/**
- * Backend User Administration Module
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-
-$GLOBALS['LANG']->includeLLFile('EXT:beuser/mod/locallang.xml');
-
-$BE_USER->modAccess($MCONF, 1);
-
-/**
- * Base Extension class for printing a page tree (non-browsable though)
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage tx_beuser
- */
-class localPageTree extends t3lib_browseTree {
-       var $expandFirst=0;
-       var $expandAll=0;
-
-       /**
-        * Local backend user (not the GLOBALS[] backend user!!)
-        *
-        * @var t3lib_beUserAuth
-        */
-       var $BE_USER;
-
-       /**
-        * Constructor for the local page tree.
-        *
-        * @param       object          Local backend user (not the GLOBALS[] backend user!!)
-        * @param       array           Webmounts for the backend user.
-        * @return      void
-        */
-       function __construct($BE_USER, $WEBMOUNTS='') {
-               $this->init();
-
-               $this->BE_USER = $BE_USER;
-               $this->MOUNTS = $WEBMOUNTS;
-               $this->clause = $this->ext_permsC();    // Notice, this clause does NOT filter out un-readable pages. This is the POINT since this class is ONLY used for the main overview where ALL is shown! Otherwise "AND '.$this->BE_USER->getPagePermsClause(1).'" should be added.
-               $this->orderByFields = 'sorting';
-       }
-
-       /**
-        * Return select permissions.
-        *
-        * @return      string          WHERE query part.
-        */
-       function ext_permsC() {
-               return '';
-       }
-
-       /**
-        * Wraps the title.
-        *
-        * @param       string          [See parent]
-        * @param       array           [See parent]
-        * @return      string
-        */
-       function wrapTitle($str, $row) {
-               return $str;
-       }
-
-       /**
-        * Wraps the plus/minus icon - in this case we just return blank which means we STRIP AWAY the plus/minus icon!
-        *
-        * @param       string          [See parent]
-        * @param       string          [See parent]
-        * @param       string          [See parent]
-        * @return      string
-        */
-       function PM_ATagWrap($icon, $cmd, $bMark = '') {
-               return '';
-       }
-
-       /**
-        * Wrapping the icon of the element/page. Normally a click menu is wrapped around the icon, but in this case only a title parameter is set.
-        *
-        * @param       string          Icon image tag.
-        * @param       array           Row.
-        * @return      string          Icon with title attribute added.
-        */
-       function wrapIcon($icon, $row) {
-                       // Add title attribute to input icon tag
-               $title = '['.$row['uid'].'] '.t3lib_BEfunc::getRecordPath($row['uid'], '', 15);
-               $theIcon = $this->addTagAttributes($icon, ($this->titleAttrib ? $this->titleAttrib.'="'.htmlspecialchars($title).'"' : '').' border="0"');
-
-               return $theIcon;
-       }
-
-       /**
-        * This will make sure that no position data is acquired from the BE_USER uc variable.
-        *
-        * @return      void
-        */
-       function initializePositionSaving() {
-               $this->stored=array();
-       }
-}
-
-/**
- * Extension class for printing a page tree: All pages of a mount point.
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage tx_beuser
- */
-class printAllPageTree extends localPageTree {
-       var $expandFirst=1;
-       var $expandAll=1;
-
-       /**
-        * Return select permissions.
-        *
-        * @return      string          WHERE query part.
-        */
-       function ext_permsC() {
-               return ' AND '.$this->BE_USER->getPagePermsClause(1);
-       }
-
-       /**
-        * Returns the plus/minus icon.
-        *
-        * @param       string          [See parent]
-        * @param       string          [See parent]
-        * @param       string          [See parent]
-        * @return      string
-        */
-       function PM_ATagWrap($icon, $cmd, $bMark='') {
-               return $icon;
-       }
-
-       /**
-        * Wrapping the icon of the element/page. Normally a click menu is wrapped around the icon, but in this case only a title parameter is set.
-        *
-        * @param       string          Icon image tag.
-        * @param       array           Row.
-        * @return      string          Icon with title attribute added.
-        */
-       function wrapIcon($icon, $row) {
-                       // Add title attribute to input icon tag
-               $title = '['.$row['uid'].']';
-               $theIcon = $this->addTagAttributes($icon, ($this->titleAttrib ? $this->titleAttrib.'="'.htmlspecialchars($title).'"' : '').' border="0"');
-
-               return $theIcon;
-       }
-}
-
-/**
- * Extension class for printing a page tree: Printing all pages, with permissions.
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage tx_beuser
- */
-class printAllPageTree_perms extends printAllPageTree {
-
-       /**
-        * Print the tree of pages.
-        *
-        * @param       array           The tree items
-        * @param       boolean         If set, the path of the pages in the tree is printed (only done for pages outside of mounts).
-        * @return      string          HTML content.
-        */
-       function printTree($treeArr='', $printPath=0) {
-               $titleLen=intval($this->BE_USER->uc['titleLen']);
-
-               $be_user_Array = t3lib_BEfunc::getUserNames();
-               $be_group_Array = t3lib_BEfunc::getGroupNames();
-               $lines=array();
-               $lines[]='<tr class="bgColor5">
-                       <td nowrap="nowrap"><strong>' . $GLOBALS['LANG']->getLL('pageTitle', TRUE) . '</strong></td>
-                       ' . ($printPath?'<td nowrap="nowrap"><strong>' . $GLOBALS['LANG']->getLL('path', TRUE) . '</strong></td>':'') . '
-                       <td nowrap="nowrap" colspan="2"><strong>' . $GLOBALS['LANG']->getLL('user', TRUE) . '</strong></td>
-                       <td nowrap="nowrap" colspan="2"><strong>' . $GLOBALS['LANG']->getLL('group', TRUE) . ' &nbsp;</strong></td>
-                       <td nowrap="nowrap"><strong>' . $GLOBALS['LANG']->getLL('everybody', TRUE) . ' &nbsp;</strong></td>
-                       <td nowrap="nowrap"><strong>' . $GLOBALS['LANG']->getLL('thisUser', TRUE) . ' &nbsp;</strong></td>
-                       <td nowrap="nowrap"><strong>' . $GLOBALS['LANG']->getLL('mainGroup', TRUE) . '</strong></td>
-               </tr>';
-
-               if (!is_array($treeArr)) {
-                       $treeArr = $this->tree;
-               }
-               foreach ($treeArr as $v) {
-                       $col1 = ' bgcolor="'.t3lib_div::modifyHtmlColor($GLOBALS['SOBE']->doc->bgColor4, +10, +10, +10).'"';
-                       $row = $v['row'];
-                       $title = htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'], $this->BE_USER->uc['titleLen']));
-                       $lines[]='<tr class="bgColor4">
-                               <td nowrap="nowrap">'.$v['HTML'].$title.' &nbsp;</td>
-                               '.($printPath?'<td nowrap="nowrap">'.htmlspecialchars(t3lib_BEfunc::getRecordPath ($row['pid'], '', 15)).' &nbsp;</td>':'').'
-                               <td nowrap="nowrap"'.$col1.'>'.$be_user_Array[$row['perms_userid']]['username'].' &nbsp;</td>
-                               <td nowrap="nowrap"'.$col1.'>'.$this->ext_printPerms($row['perms_user']).' &nbsp;</td>
-                               <td nowrap="nowrap">'.$be_group_Array[$row['perms_groupid']]['title'].' &nbsp;</td>
-                               <td nowrap="nowrap">'.$this->ext_printPerms($row['perms_group']).' &nbsp;</td>
-                               <td nowrap="nowrap" align="center" '.$col1.'>'.$this->ext_printPerms($row['perms_everybody']).' &nbsp;</td>
-                               <td nowrap="nowrap" align="center">' . ($row['editlock'] ? t3lib_iconWorks::getSpriteIcon('status-warning-in-use', array('title' => $GLOBALS['LANG']->getLL('editLock', TRUE))) : $this->ext_printPerms($this->BE_USER->calcPerms($row))) . ' &nbsp;</td>
-                               <td nowrap="nowrap" align="center">'.$this->ext_printPerms($this->ext_groupPerms($row, $be_group_Array[$this->BE_USER->firstMainGroup])).' &nbsp;</td>
-                       </tr>';
-               }
-               return '<table border="0" cellpadding="0" cellspacing="0">'.implode('', $lines).'</table>';
-       }
-
-       /**
-        * Print a set of permissions
-        *
-        * @param       integer         The permissions integer.
-        * @return      string          HTML formatted.
-        */
-       function ext_printPerms($int) {
-               $str='';
-               $str.= (($int&1)?'*':'<font color="red">x</font>');
-               $str.= (($int&16)?'*':'<font color="red">x</font>');
-               $str.= (($int&2)?'*':'<font color="red">x</font>');
-               $str.= (($int&4)?'*':'<font color="red">x</font>');
-               $str.= (($int&8)?'*':'<font color="red">x</font>');
-
-               return '<strong style="color:green;">'.$str.'</strong>';
-       }
-
-       /**
-        * returns the permissions for a group based of the perms_groupid of $row. If the $row[perms_groupid] equals the $firstGroup[uid] then the function returns perms_everybody OR'ed with perms_group, else just perms_everybody
-        *
-        * @param       array           Page record.
-        * @param       array           First-group record.
-        * @return      integer         Permissions.
-        */
-       function ext_groupPerms($row, $firstGroup) {
-               if (is_array($row)) {
-                       $out=intval($row['perms_everybody']);
-                       if ($row['perms_groupid'] && $firstGroup['uid']==$row['perms_groupid']) {
-                               $out|= intval($row['perms_group']);
-                       }
-                       return $out;
-               }
-       }
-}
-
-/**
- * Base Extension class for printing a folder tree (non-browsable though)
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage tx_beuser
- */
-class localFolderTree extends t3lib_folderTree {
-       var $expandFirst=0;
-       var $expandAll=0;
-
-       /**
-        * Local backend user (not the GLOBALS[] backend user!!)
-        *
-        * @var t3lib_beUserAuth
-        */
-       var $BE_USER;
-
-       /**
-        * Constructor for the local folder tree.
-        *
-        * @param       object          Local backend user (not the GLOBALS[] backend user!!)
-        * @param       array           Filemounts for the backend user.
-        * @return      void
-        */
-       function __construct($BE_USER) {
-               $this->init();
-
-               $this->BE_USER = $BE_USER;
-               $this->storages = $BE_USER->getFileStorages();
-               $this->clause = '';     // Notice, this clause does NOT filter out un-readable pages. This is the POINT since this class is ONLY used for the main overview where ALL is shown! Otherwise "AND '.$this->BE_USER->getPagePermsClause(1).'" should be added.
-       }
-
-       /**
-        * Wraps the title.
-        *
-        * @param       string          [See parent]
-        * @param       array           [See parent]
-        * @return      string
-        */
-       function wrapTitle($str, $row) {
-               return $str;
-       }
-
-       /**
-        * Wraps the plus/minus icon - in this case we just return blank which means we STRIP AWAY the plus/minus icon!
-        *
-        * @param       string          [See parent]
-        * @param       string          [See parent]
-        * @param       string          [See parent]
-        * @return      string
-        */
-       function PM_ATagWrap($icon, $cmd, $bMark='') {
-               return '';
-       }
-
-       /**
-        * Wrapping the icon of the element/page. Normally a click menu is wrapped around the icon, but in this case only a title parameter is set.
-        *
-        * @param string $icon The image tag for the icon
-        * @param t3lib_file_Folder $folderObject The row for the current element
-        * @return string The processed icon input value.
-        * @internal
-        */
-       public function wrapIcon($icon, t3lib_file_Folder $folderObject) {
-                       // Add title attribute to input icon tag
-               $theFolderIcon = $this->addTagAttributes($icon, ($this->titleAttrib ? $this->titleAttrib . '="' . $this->getTitleAttrib($folderObject) . '"' : ''));
-               return $theFolderIcon;
-       }
-
-
-       /**
-        * This will make sure that no position data is acquired from the BE_USER uc variable.
-        *
-        * @return      void
-        */
-       function initializePositionSaving() {
-               $this->stored=array();
-       }
-}
-
-/**
- * Extension class for printing a folder tree: All folders
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage tx_beuser
- */
-class printAllFolderTree extends localFolderTree {
-       var $expandFirst=1;
-       var $expandAll=1;
-
-       /**
-        * Wraps the plus/minus icon - in this case we just return blank which means we STRIP AWAY the plus/minus icon!
-        *
-        * @param       string          [See parent]
-        * @param       string          [See parent]
-        * @param       string          [See parent]
-        * @return      string
-        */
-       function PM_ATagWrap($icon, $cmd, $bMark='') {
-               return $icon;
-       }
-}
-
-/**
- * Extension class of beuserauth class.
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage tx_beuser
- */
-class local_beUserAuth extends t3lib_beUserAuth {
-       var $ext_pageIdsFromMounts='';                                  // List of mounted page ids (from browsetree class when selecting mountpoints)
-       var $ext_non_readAccessPageArray=array();               // Storage for non-readable webmounts, see returnWebmounts()
-
-       /**
-        * Returns an array of the webmounts for the user, with non-readable webmounts filtered out.
-        * If there are non-readable webmounts they are registered in $this->ext_non_readAccessPageArray
-        * (Extending function in parent class)
-        *
-        * @param       string          alternative select clause (default is getPagePermsClause(1)). For instance to make sure that ALL webmounts are selected regardless of whether the user has read access or not, you can set this to "1=1".
-        * @return      array           Webmounts id's
-        */
-       function returnWebmounts($pClause='') {
-
-                       // Get array of webmounts:
-               $webmounts = (string)($this->groupData['webmounts'])!='' ? explode(',', $this->groupData['webmounts']) : Array();
-
-                       // Get select clause:
-               $pClause=$pClause?$pClause:$this->getPagePermsClause(1);
-
-                       // Traverse mounts, check if they are readable:
-               foreach ($webmounts as $k => $id) {
-                       $rec=t3lib_BEfunc::getRecord('pages', $id, '*', ' AND '.$pClause);
-                       if (!is_array($rec)) {
-                               $this->ext_non_readAccessPageArray[$id]=t3lib_BEfunc::getRecord('pages', $id);
-                               unset($webmounts[$k]);
-                       }
-               }
-               return $webmounts;
-       }
-
-       /**
-        * Based on the content of ->ext_non_readAccessPageArray (see returnWebmounts()) it generates visually formatted information about these non-readable mounts.
-        *
-        * @return      string          HTML content showing which DB-mounts were not accessible for the user
-        */
-       function ext_non_readAccessPages() {
-               $lines=array();
-
-               foreach ($this->ext_non_readAccessPageArray as $pA) {
-                       if ($pA) {
-                               $lines[] = t3lib_BEfunc::getRecordPath($pA['uid'], '', 15);
-                       }
-               }
-               if (count($lines)) {
-                       return '<table bgcolor="red" border="0" cellpadding="0" cellspacing="0">
-                               <tr>
-                                       <td align="center"><font color="white"><strong>' . $GLOBALS['LANG']->getLL('noReadAccess', TRUE) . '</strong></font></td>
-                               </tr>
-                               <tr>
-                                       <td>'.implode('</td></tr><tr><td>', $lines).'</td>
-                               </tr>
-                       </table>';
-               }
-       }
-
-       /**
-        * This returns the where-clause needed to select the user with respect flags like deleted, hidden, starttime, endtime
-        *
-        * @return      string
-        */
-       function user_where_clause() {
-               return  'AND pid=0 ';
-       }
-
-       /**
-        * Creates the overview information based on which analysis topics were selected.
-        *
-        * @param       array           Array of analysis topics
-        * @param       array           Array of the selected analysis topics (from session variable somewhere)
-        * @param       boolean         If set, the full trees of pages/folders are printed.
-        * @return      array           Array with accumulated HTML content.
-        */
-       function ext_printOverview($uInfo, $compareFlags, $printTrees=0) {
-                       // Prepare for file storages and db-mount
-               if ($printTrees)        {       // ... this is if we see the detailed view for a user:
-                               // Page tree object:
-                       $pagetree = t3lib_div::makeInstance(!$this->isAdmin() ? 'printAllPageTree_perms' : 'printAllPageTree', $this, $this->returnWebmounts());        // Here, only readable webmounts are returned (1=1)
-                       $pagetree->addField('perms_user', 1);
-                       $pagetree->addField('perms_group', 1);
-                       $pagetree->addField('perms_everybody', 1);
-                       $pagetree->addField('perms_userid', 1);
-                       $pagetree->addField('perms_groupid', 1);
-                       $pagetree->addField('editlock', 1);
-
-                               // Folder tree object:
-                       $foldertree = t3lib_div::makeInstance('printAllFolderTree', $this);
-               } else {
-                               // Page tree object:
-                       $pagetree = t3lib_div::makeInstance('localPageTree', $this, $this->returnWebmounts('1=1'));     // Here, ALL webmounts are returned (1=1)
-
-                               // Folder tree object:
-                       $foldertree = t3lib_div::makeInstance('localFolderTree', $this);
-               }
-
-                       // Names for modules:
-               $modNames = array(
-                       'web' => 'Web',
-                       'web_layout' => 'Page',
-                       'web_modules' => 'Modules',
-                       'web_info' => 'Info',
-                       'web_perms' => 'Access',
-                       'web_func' => 'Func',
-                       'web_list' => 'List',
-                       'web_ts' => 'Template',
-                       'file' => 'File',
-                       'file_list' => 'List',
-                       'file_images' => 'Images',
-                       'doc' => 'Doc.',
-                       'help' => 'Help',
-                       'help_about' => 'About',
-                       'help_quick' => 'User manual',
-                       'help_welcome' => 'Welcome',
-                       'user' => 'User',
-                       'user_setup' => 'Setup',
-                       'user_task' => 'Task center'
-               );
-
-                       // Traverse the enabled analysis topics:
-               $out=array();
-               foreach ($uInfo as $k => $v) {
-                       if ($compareFlags[$k]) {
-                               switch($k) {
-                                       case 'filemounts':
-                                       case 'filestorages':
-                                               $out[$k] = $foldertree->getBrowsableTree();
-                                       break;
-                                       case 'webmounts':
-                                                       // Print webmounts:
-                                               $pagetree->addSelfId=1;
-                                               $out[$k] = $this->ext_non_readAccessPages();    // Add HTML for non-readable webmounts (only shown when viewing details of a user - in overview/comparison ALL mounts are shown)
-                                               $out[$k].= $pagetree->getBrowsableTree();               // Add HTML for readable webmounts.
-                                               $this->ext_pageIdsFromMounts=implode(',', array_unique($pagetree->ids));                // List of mounted page ids
-                                       break;
-                                       case 'tempPath':
-                                               $out[$k] = $GLOBALS['SOBE']->localPath($v);
-                                       break;
-                                       case 'pagetypes_select':
-                                               $pageTypes = explode(',', $v);
-                                               foreach ($pageTypes as &$vv) {
-                                                       $vv = $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('pages', 'doktype', $vv));
-                                               }
-                                               unset($vv);
-                                               $out[$k] = implode('<br />', $pageTypes);
-                                       break;
-                                       case 'tables_select':
-                                       case 'tables_modify':
-                                               $tables = explode(',', $v);
-                                               foreach ($tables as &$vv) {
-                                                       if ($vv) {
-                                                               $vv = '<span class="nobr">'.t3lib_iconWorks::getSpriteIconForRecord($vv, array()).$GLOBALS['LANG']->sL($GLOBALS['TCA'][$vv]['ctrl']['title']).'</span>';
-                                                       }
-                                               }
-                                               unset($vv);
-                                               $out[$k] = implode('<br />', $tables);
-                                       break;
-                                       case 'non_exclude_fields':
-                                               $nef = explode(',', $v);
-                                               $table='';
-                                               $pout=array();
-                                               foreach ($nef as $vv) {
-                                                       if ($vv) {
-                                                               list($thisTable,$field) = explode(':', $vv);
-                                                               if ($thisTable!=$table) {
-                                                                       $table=$thisTable;
-                                                                       t3lib_div::loadTCA($table);
-                                                                       $pout[]='<span class="nobr">'.t3lib_iconWorks::getSpriteIconForRecord($table, array()).$GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['ctrl']['title']).'</span>';
-                                                               }
-                                                               if ($GLOBALS['TCA'][$table]['columns'][$field]) {
-                                                                       $pout[]='<span class="nobr"> - '.rtrim($GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['columns'][$field]['label']), ':').'</span>';
-                                                               }
-                                                       }
-                                               }
-                                               $out[$k] = implode('<br />', $pout);
-                                       break;
-                                       case 'groupList':
-                                       case 'firstMainGroup':
-                                               $uGroups = explode(',', $v);
-                                               $table='';
-                                               $pout=array();
-                                               foreach ($uGroups as $vv) {
-                                                       if ($vv) {
-                                                               $uGRow = t3lib_BEfunc::getRecord('be_groups', $vv);
-                                                               $title = t3lib_BEfunc::getRecordTitle('be_groups', $uGRow);
-                                                               $pout[] = '<tr><td nowrap="nowrap">' . t3lib_iconWorks::getSpriteIconForRecord('be_groups', $uGRow) .
-                                                                       '&nbsp;' . htmlspecialchars($title) . '&nbsp;&nbsp;</td><td width="1%" nowrap="nowrap">' .
-                                                                       $GLOBALS['SOBE']->elementLinks('be_groups', $uGRow) . '</td></tr>';
-                                                       }
-                                               }
-                                               $out[$k] = '<table border="0" cellpadding="0" cellspacing="0" width="100%">'.implode('', $pout).'</table>';
-                                       break;
-                                       case 'modules':
-                                               $mods = explode(',', $v);
-                                               $mainMod='';
-                                               $pout=array();
-                                               foreach ($mods as $vv) {
-                                                       if ($vv) {
-                                                               list($thisMod,$subMod) = explode('_', $vv);
-                                                               if ($thisMod!=$mainMod) {
-                                                                       $mainMod=$thisMod;
-                                                                       $pout[]='<span class="nobr">'.($modNames[$mainMod]?$modNames[$mainMod]:$mainMod).'</span>';
-                                                               }
-                                                               if ($subMod) {
-                                                                       $pout[]='<span class="nobr"> - '.($modNames[$mainMod.'_'.$subMod]?$modNames[$mainMod.'_'.$subMod]:$mainMod.'_'.$subMod).'</span>';
-                                                               }
-                                                       }
-                                               }
-                                               $out[$k] = implode('<br />', $pout);
-                                       break;
-                                       case 'userTS':
-
-                                               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');  // Defined global here!
-                                               $tmpl->tt_track = 0;    // Do not log time-performance information
-
-                                               $tmpl->fixedLgd=0;
-                                               $tmpl->linkObjects=0;
-                                               $tmpl->bType='';
-                                               $tmpl->ext_expandAllNotes=1;
-                                               $tmpl->ext_noPMicons=1;
-                                               $out[$k] = $tmpl->ext_getObjTree($v, '', '', '', '', '1');
-                                       break;
-                                       case 'userTS_hl':
-                                               $tsparser = t3lib_div::makeInstance('t3lib_TSparser');
-                                               $tsparser->lineNumberOffset=0;
-                                               $out[$k] = $tsparser->doSyntaxHighlight($v, 0, 1);
-                                       break;
-                                       case 'explicit_allowdeny':
-
-                                                       // Explode and flip values:
-                                               $nef = array_flip(explode(',', $v));
-                                               $pout = array();
-
-                                               $theTypes = t3lib_BEfunc::getExplicitAuthFieldValues();
-
-                                                               // Icons:
-                                               $icons = array(
-                                                       'ALLOW' => t3lib_iconWorks::getSpriteIcon('status-dialog-ok'),
-                                                       'DENY'  => t3lib_iconWorks::getSpriteIcon('status-dialog-error'),
-                                               );
-
-                                                       // Traverse types:
-                                               foreach ($theTypes as $tableFieldKey => $theTypeArrays) {
-                                                       if (is_array($theTypeArrays['items'])) {
-                                                               $pout[] = '<strong>'.$theTypeArrays['tableFieldLabel'].'</strong>';
-                                                                       // Traverse options for this field:
-                                                               foreach ($theTypeArrays['items'] as $itemValue => $itemContent) {
-                                                                       $v = $tableFieldKey.':'.$itemValue.':'.$itemContent[0];
-                                                                       if (isset($nef[$v])) {
-                                                                               unset($nef[$v]);
-                                                                               $pout[] = $icons[$itemContent[0]].'['.$itemContent[2].'] '.$itemContent[1];
-                                                                       } else {
-                                                                               $pout[] = '<em style="color: #666666;">'.$icons[($itemContent[0]=='ALLOW' ? 'DENY' : 'ALLOW')].'['.$itemContent[2].'] '.$itemContent[1].'</em>';
-                                                                       }
-                                                               }
-                                                               $pout[] = '';
-                                                       }
-                                               }
-
-                                                       // Add remaining:
-                                               if (count($nef)) {
-                                                       $pout = array_merge($pout, array_keys($nef));
-                                               }
-
-                                                       // Implode for display:
-                                               $out[$k] = implode('<br />', $pout);
-                                       break;
-                                       case 'allowed_languages':
-
-                                                       // Explode and flip values:
-                                               $nef = array_flip(explode(',', $v));
-                                               $pout = array();
-
-                                                       // Get languages:
-                                               $items = t3lib_BEfunc::getSystemLanguages();
-
-                                                       // Traverse values:
-                                               foreach ($items as $iCfg) {
-                                                       if (isset($nef[$iCfg[1]])) {
-                                                               unset($nef[$iCfg[1]]);
-                                                               if (strpos($iCfg[2], '.gif') === FALSE) {
-                                                                       $icon = t3lib_iconWorks::getSpriteIcon($iCfg[2]) . '&nbsp;';
-                                                               } elseif (strlen($iCfg[2])) {
-                                                                       $icon = '<img '.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/'.$iCfg[2]).' class="absmiddle" style="margin-right: 5px;" alt="" />';
-                                                               } else {
-                                                                       $icon = '';
-                                                               }
-                                                               $pout[] = $icon.$iCfg[0];
-                                                       }
-                                               }
-
-                                                       // Add remaining:
-                                               if (count($nef)) {
-                                                       $pout = array_merge($pout, array_keys($nef));
-                                               }
-
-                                                       // Implode for display:
-                                               $out[$k] = implode('<br />', $pout);
-                                       break;
-                                       case 'workspace_perms':
-                                               $out[$k] = implode('<br/>', explode(', ', t3lib_BEfunc::getProcessedValue('be_users', 'workspace_perms', $v)));
-                                       break;
-                                       case 'workspace_membership':
-                                               $out[$k] = implode('<br/>', $this->ext_workspaceMembership());
-                                       break;
-                                       case 'custom_options':
-
-                                                       // Explode and flip values:
-                                               $nef = array_flip(explode(',', $v));
-                                               $pout = array();
-
-                                                       // Initialize:
-                                               $customOptions = $GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions'];
-                                               if (is_array($customOptions)) {
-                                                       foreach ($customOptions as $coKey => $coValue) {
-                                                               if (is_array($coValue['items'])) {
-                                                                               // Traverse items:
-                                                                       foreach ($coValue['items'] as $itemKey => $itemCfg) {
-                                                                               $v = $coKey.':'.$itemKey;
-                                                                               if (isset($nef[$v])) {
-                                                                                       unset($nef[$v]);
-                                                                                       $pout[] = $GLOBALS['LANG']->sl($coValue['header']).' / '.$GLOBALS['LANG']->sl($itemCfg[0]);
-                                                                               }
-                                                                       }
-                                                               }
-                                                       }
-                                               }
-
-                                                       // Add remaining:
-                                               if (count($nef)) {
-                                                       $pout = array_merge($pout, array_keys($nef));
-                                               }
-
-                                                       // Implode for display:
-                                               $out[$k] = implode('<br />', $pout);
-                                       break;
-                               }
-                       }
-               }
-               return $out;
-       }
-
-       /**
-        * Get HTML code for the pages which were mounted, but NOT readable!
-        *
-        * @return      string          HTML code.
-        */
-       function ext_getReadableButNonmounted() {
-
-                       // List of page id mounts which ARE mounted (and should therefore not be selected)
-               if (!$this->ext_pageIdsFromMounts) {
-                       $this->ext_pageIdsFromMounts=0;
-               }
-
-                       // User and group names:
-               $be_user_Array = t3lib_BEfunc::getUserNames();
-               $be_group_Array = t3lib_BEfunc::getGroupNames();
-
-                       // Create query:
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                               'pid,uid,title,doktype,perms_user,perms_group,perms_everybody,perms_userid,perms_groupid'.(t3lib_extMgm::isLoaded('cms')?',media,layout,hidden,starttime,endtime,fe_group,extendToSubpages':''),
-                                               'pages',
-                                               'uid NOT IN ('.$this->ext_pageIdsFromMounts.') AND '.$this->getPagePermsClause(1).t3lib_BEfunc::deleteClause('pages')
-                                       );
-               $dat = array();
-               while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $dat[] = array(
-                               'row'=>$row,
-                               'HTML'=>t3lib_iconWorks::getSpriteIconForRecord('pages', $row, array('title' => '[' . $row['uid'] . ']'))
-                       );
-               }
-               $pp = t3lib_div::makeInstance('printAllPageTree_perms', $this);
-               return $pp->printTree($dat, 1);
-       }
-
-       /**
-        * Print a set of permissions
-        *
-        * @param       integer         The permissions integer.
-        * @return      string          HTML formatted.
-        */
-       function ext_printPerms($int) {
-               $str='';
-               $str.= (($int&1)?'*':'<font color="red">x</font>');
-               $str.= (($int&16)?'*':'<font color="red">x</font>');
-               $str.= (($int&2)?'*':'<font color="red">x</font>');
-               $str.= (($int&4)?'*':'<font color="red">x</font>');
-               $str.= (($int&8)?'*':'<font color="red">x</font>');
-
-               return '<strong style="color:green;">'.$str.'</strong>';
-       }
-
-       /**
-        * returns the permissions for a group based of the perms_groupid of $row. If the $row[perms_groupid] equals the $firstGroup[uid] then the function returns perms_everybody OR'ed with perms_group, else just perms_everybody
-        *
-        * @param       array           Page record.
-        * @param       array           First-group record.
-        * @return      integer         Permissions.
-        */
-       function ext_groupPerms($row, $firstGroup) {
-               if (is_array($row)) {
-                       $out=intval($row['perms_everybody']);
-                       if ($row['perms_groupid'] && $firstGroup['uid']==$row['perms_groupid']) {
-                               $out|= intval($row['perms_group']);
-                       }
-                       return $out;
-               }
-       }
-
-       /**
-        * Creates uInfo array for the user.
-        *
-        * @param       array           Might contain array where keys/values indicate whether to render a certain value
-        * @return      array           Array with the information of the user for each analysis topic.
-        */
-       function ext_compileUserInfoForHash($filter=NULL) {
-               $uInfo=array();
-               $renderAll = !is_array($filter);
-
-                       // Filemounts:
-               if ($renderAll || $filter['filemounts']) {
-                       $uInfo['filemounts'] = $this->ext_uniqueAndSortList(implode(',', array_keys($this->groupData['filemounts'])));
-               }
-
-                       // DBmounts:
-               if ($renderAll || $filter['webmounts']) {
-                       $uInfo['webmounts'] = $this->ext_uniqueAndSortList($this->groupData['webmounts']);
-               }
-
-                       // Sharing Upload Folder
-               if ($renderAll || $filter['tempPath']) {
-                       $fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
-                       $fileProcessor->init($this->groupData['filemounts'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
-                       $uInfo['tempPath'] = $fileProcessor->findTempFolder();  // The closest TEMP-path is found
-               }
-
-                       // First Main Group:
-               if ($renderAll || $filter['firstMainGroup']) {
-                       $uInfo['firstMainGroup'] = $this->firstMainGroup;
-               }
-
-                       // Group List:
-               if ($renderAll || $filter['groupList']) {
-                               // This gives a list that shows in which order the groups are processed. This may result in a list of groups which is similar to
-                               // that of another user regarding which group but not the order of groups. For now, I believe it's most useful to let separate
-                               // orders of groups appear as different group settings for a user.
-                       $uInfo['groupList'] = $this->groupList;
-               }
-
-                       // Page Types:
-               if ($renderAll || $filter['pagetypes_select']) {
-                       $uInfo['pagetypes_select'] = $this->ext_uniqueAndSortList($this->groupData['pagetypes_select']);
-               }
-
-                       // Tables select:
-               if ($renderAll || $filter['tables_select']) {
-                       $uInfo['tables_select'] = $this->ext_uniqueAndSortList($this->groupData['tables_select'].','.$this->groupData['tables_modify']);
-               }
-
-                       // Tables modify:
-               if ($renderAll || $filter['tables_modify']) {
-                       $uInfo['tables_modify'] = $this->ext_uniqueAndSortList($this->groupData['tables_modify']);
-               }
-
-                       // Non-exclude fields:
-               if ($renderAll || $filter['non_exclude_fields']) {
-                       $uInfo['non_exclude_fields'] = $this->ext_uniqueAndSortList($this->groupData['non_exclude_fields']);
-               }
-
-                       // Explicit Allow/Deny:
-               if ($renderAll || $filter['explicit_allowdeny']) {
-                       $uInfo['explicit_allowdeny'] = $this->ext_uniqueAndSortList($this->groupData['explicit_allowdeny']);
-               }
-
-                       // Limit to languages:
-               if ($renderAll || $filter['allowed_languages']) {
-                       $uInfo['allowed_languages'] = $this->ext_uniqueAndSortList($this->groupData['allowed_languages']);
-               }
-
-                       // Workspace permissions
-               if ($renderAll || $filter['workspace_perms']) {
-                       $uInfo['workspace_perms'] = $this->ext_uniqueAndSortList($this->groupData['workspace_perms']);
-               }
-
-                       // Workspace membership
-               if ($renderAll || $filter['workspace_membership']) {
-                       $uInfo['workspace_membership'] = $this->ext_workspaceMembership();
-               }
-
-                       // Custom options:
-               if ($renderAll || $filter['custom_options']) {
-                       $uInfo['custom_options'] = $this->ext_uniqueAndSortList($this->groupData['custom_options']);
-               }
-
-                       // Modules:
-               if ($renderAll || $filter['modules']) {
-                       $uInfo['modules'] = $this->ext_uniqueAndSortList($this->groupData['modules']);
-               }
-
-                       // User TS:
-               $this->ext_ksortArrayRecursive($this->userTS);
-               if ($renderAll || $filter['userTS']) {
-                       $uInfo['userTS'] = $this->userTS;
-               }
-
-               if ($renderAll || $filter['userTS_hl']) {
-                       $uInfo['userTS_hl'] = $this->userTS_text;
-               }
-
-               return $uInfo;
-       }
-
-       /**
-        * Sorts a commalist of values and removes duplicates.
-        *
-        * @param       string          Commalist.
-        * @return      string          Sorted, unique commalist.
-        */
-       function ext_uniqueAndSortList($list) {
-               $uList=t3lib_div::trimExplode(',', $list, 1);
-               sort($uList);
-               $uList=array_unique($uList);
-               $uList=implode(',', $uList);
-               return $uList;
-       }
-
-       /**
-        * Key sort input array recursively.
-        *
-        * @param       array           Multidimensional array (value by reference!)
-        * @return      void
-        */
-       function ext_ksortArrayRecursive(&$arr) {
-               krsort($arr);
-               foreach ($arr as &$v) {
-                       if (is_array($v)) {
-                               $this->ext_ksortArrayRecursive($v);
-                       }
-               }
-               unset($v);
-       }
-
-       /**
-        * Returns all workspaces that are accessible for the BE_USER
-        *
-        * @return      array   with key / value pairs of available workspaces (filtered by BE_USER check)
-        */
-       function ext_workspaceMembership() {
-                       // Create accessible workspace arrays:
-               $options = array();
-               if ($this->checkWorkspace(array('uid' => 0))) {
-                       $options[0] = '0: ' . $GLOBALS['LANG']->getLL('live', TRUE);
-               }
-
-                       // Add custom workspaces (selecting all, filtering by BE_USER check):
-               if (t3lib_extMgm::isLoaded('workspaces')) {
-                       $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,adminusers,members,reviewers,db_mountpoints', 'sys_workspace', 'pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'), '', 'title');
-                       if (count($workspaces)) {
-                               foreach ($workspaces as $rec) {
-                                       if ($this->checkWorkspace($rec)) {
-                                               $options[$rec['uid']] = $rec['uid'].': '.htmlspecialchars($rec['title']);
-
-                                                       // Check if all mount points are accessible, otherwise show error:
-                                               if (trim($rec['db_mountpoints'])!=='') {
-                                                       $mountPoints = t3lib_div::intExplode(',', $this->workspaceRec['db_mountpoints'], 1);
-                                                       foreach ($mountPoints as $mpId) {
-                                                               if (!$this->isInWebMount($mpId, '1=1')) {
-                                                                       $options[$rec['uid']].= '<br> \- ' . $GLOBALS['LANG']->getLL('notAccessible', TRUE) . ' ' . $mpId;
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               return $options;
-       }
-}
-
-/**
- * Main script class
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage tx_beuser
- */
-class SC_mod_tools_be_user_index {
-       var $MCONF=array();
-       var $MOD_MENU=array();
-       var $MOD_SETTINGS=array();
-
-       /**
-        * document emplate object
-        *
-        * @var noDoc
-        */
-       var $doc;
-
-       var $include_once=array();
-       var $content;
-
-       /**
-        * Basic initialization of the class
-        *
-        * @return      void
-        */
-       function init() {
-               $this->MCONF = $GLOBALS['MCONF'];
-
-               $this->menuConfig();
-               $this->switchUser(t3lib_div::_GP('SwitchUser'));
-
-               // **************************
-               // Initializing
-               // **************************
-               $this->doc = t3lib_div::makeInstance('template');
-               $this->doc->backPath = $GLOBALS['BACK_PATH'];
-               $this->doc->setModuleTemplate('templates/beuser.html');
-               $this->doc->form = '<form action="" method="post">';
-
-                               // JavaScript
-               $this->doc->JScode = $this->doc->wrapScriptTags('
-                       script_ended = 0;
-                       function jumpToUrl(URL) {       //
-                               window.location.href = URL;
-                       }
-               ' . $this->doc->redirectUrls());
-       }
-
-       /**
-        * Initialization of the module menu configuration
-        *
-        * @return      void
-        */
-       function menuConfig() {
-               // MENU-ITEMS:
-                       // If array, then it's a selector box menu
-                       // If empty string it's just a variable, that'll be saved.
-                       // Values NOT in this array will not be saved in the settings-array for the module.
-               $this->MOD_MENU = array(
-                       'function' => array(
-                               'compare' => $GLOBALS['LANG']->getLL('compareUserSettings', TRUE),
-                               'whoisonline' => $GLOBALS['LANG']->getLL('listUsersOnline', TRUE)
-                       )
-               );
-                       // CLEAN SETTINGS
-               $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], 'ses');
-       }
-
-       /**
-        * This functions builds the content of the page
-        *
-        * @return      void
-        */
-       function main() {
-               $this->content = $this->doc->header($GLOBALS['LANG']->getLL('backendUserAdministration', TRUE));
-
-               switch($this->MOD_SETTINGS['function']) {
-                       case 'compare':
-                               if (t3lib_div::_GP('ads')) {
-                                       $compareFlags = t3lib_div::_GP('compareFlags');
-                                       $GLOBALS['BE_USER']->pushModuleData('tools_beuser/index.php/compare', $compareFlags);
-                               } else {
-                                       $compareFlags = $GLOBALS['BE_USER']->getModuleData('tools_beuser/index.php/compare', 'ses');
-                               }
-                               $this->content.=$this->compareUsers($compareFlags);
-                       break;
-                       case 'whoisonline':
-                               $this->content.=$this->whoIsOnline();
-                       break;
-               }
-                       // Setting up the buttons and markers for docheader
-               $docHeaderButtons = $this->getButtons();
-               $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
-               $markers['CONTENT'] = $this->content;
-
-                       // Build the <body> for the module
-               $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
-                       // Renders the module page
-               $this->content = $this->doc->render(
-                       'Backend User Administration',
-                       $this->content
-               );
-       }
-
-       /**
-        * Prints the content of the page
-        *
-        * @return      void
-        */
-       function printContent() {
-               echo $this->content;
-       }
-
-       /**
-        * Create the panel of buttons for submitting the form or otherwise perform operations.
-        *
-        * @return      array   all available buttons as an assoc. array
-        */
-       protected function getButtons() {
-               $buttons = array(
-                       'add' => '',
-                       'csh' => '',
-                       'shortcut' => '',
-                       'save' => ''
-               );
-
-                       // Add user
-               if ($this->MOD_SETTINGS['function'] === 'compare') {
-                       $buttons['add'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick('&edit[be_users][0]=new', $this->doc->backPath, -1)) .
-                               '" title="' . $GLOBALS['LANG']->getLL('newUser', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-new') . '</a>';
-               }
-
-                       // Shortcut
-               if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
-                       $buttons['shortcut'] = $this->doc->makeShortcutIcon('be_user_uid,compareFlags', 'function', $this->MCONF['name']);
-               }
-
-               return $buttons;
-       }
-
-       /***************************
-        *
-        * OTHER FUNCTIONS:
-        *
-        ***************************/
-
-       /**
-        * Compares the users with the given flags
-        *
-        * @param       array           options that should be taking into account to compare the users
-        * @return      string          the content
-        */
-       function compareUsers($compareFlags) {
-                       // Menu:
-               $options = array(
-                       'filemounts' => $GLOBALS['LANG']->getLL('filemounts', TRUE),
-                       'webmounts' => $GLOBALS['LANG']->getLL('webmounts', TRUE),
-                       'tempPath' => $GLOBALS['LANG']->getLL('defaultUploadPath', TRUE),
-                       'firstMainGroup' => $GLOBALS['LANG']->getLL('mainUserGroup', TRUE),
-                       'groupList' => $GLOBALS['LANG']->getLL('memberOfGroups', TRUE),
-                       'pagetypes_select' => $GLOBALS['LANG']->getLL('pageTypesAccess', TRUE),
-                       'tables_select' => $GLOBALS['LANG']->getLL('selectTables', TRUE),
-                       'tables_modify' => $GLOBALS['LANG']->getLL('modifyTables', TRUE),
-                       'non_exclude_fields' => $GLOBALS['LANG']->getLL('nonExcludeFields', TRUE),
-                       'explicit_allowdeny' => $GLOBALS['LANG']->getLL('explicitAllowDeny', TRUE),
-                       'allowed_languages' => $GLOBALS['LANG']->getLL('limitToLanguages', TRUE),
-                       'workspace_perms' => $GLOBALS['LANG']->getLL('workspacePermissions', TRUE),
-                       'workspace_membership' => $GLOBALS['LANG']->getLL('workspaceMembership', TRUE),
-                       'custom_options' => $GLOBALS['LANG']->getLL('customOptions', TRUE),
-                       'modules' => $GLOBALS['LANG']->getLL('modules', TRUE),
-                       'userTS' => $GLOBALS['LANG']->getLL('tsconfig', TRUE),
-                       'userTS_hl' => $GLOBALS['LANG']->getLL('tsconfigHL', TRUE),
-               );
-
-               $be_user_uid = t3lib_div::_GP('be_user_uid');
-               if ($be_user_uid) {
-                               // This is used to test with other users. Development ONLY!
-                       $tempBE_USER = t3lib_div::makeInstance('local_beUserAuth');     // New backend user object
-                       $tempBE_USER->userTS_dontGetCached=1;
-                       $tempBE_USER->OS = TYPO3_OS;
-                       $tempBE_USER->setBeUserByUid($be_user_uid);
-                       $tempBE_USER->fetchGroupData();
-
-                       $uInfo = $tempBE_USER->ext_compileUserInfoForHash();
-                       $uInfo_dat = $tempBE_USER->ext_printOverview($uInfo, $options, 1);
-
-                       $lines=array();
-                       foreach ($options as $kk => $vv) {
-                               $lines[]='<tr class="bgColor4">
-                                       <td nowrap="nowrap" valign="top">'.$vv.':&nbsp;&nbsp;</td>
-                                       <td>'.$uInfo_dat[$kk].'&nbsp;</td>
-                               </tr>';
-
-                               if ($kk=='webmounts' && !$tempBE_USER->isAdmin()) {
-                                       $lines[]='<tr class="bgColor4">
-                                               <td nowrap="nowrap" valign="top">' . $GLOBALS['LANG']->getLL('nonMountedReadablePages', TRUE) . '&nbsp;&nbsp;</td>
-                                               <td>'.$tempBE_USER->ext_getReadableButNonmounted().'&nbsp;</td>
-                                       </tr>';
-                               }
-                       }
-
-                       $email = htmlspecialchars($tempBE_USER->user['email']);
-                       $realname = htmlspecialchars($tempBE_USER->user['realName']);
-                       $outTable = '<table border="0" cellpadding="1" cellspacing="1"><tr class="bgColor5"><td>'.t3lib_iconWorks::getSpriteIconForRecord('be_users', $tempBE_USER->user, array('title'=>$tempBE_USER->user['uid'])).htmlspecialchars($tempBE_USER->user['username']).'</td>';
-                       $outTable.= '<td>'.($realname?$realname.', ':'').($email ? '<a href="mailto:'.$email.'">'.$email.'</a>' : '').'</td>';
-                       $outTable.= '<td>'.$this->elementLinks('be_users', $tempBE_USER->user).'</td></tr></table>';
-                       $outTable.= '<strong><a href="'.htmlspecialchars($this->MCONF['_']).'">' . $GLOBALS['LANG']->getLL('backToOverview', TRUE) . '</a></strong><br />';
-
-                       $outTable.= '<br /><table border="0" cellpadding="2" cellspacing="1">'.implode('', $lines).'</table>';
-                       $content .= $this->doc->section($GLOBALS['LANG']->getLL('userInfo', TRUE), $outTable, FALSE, TRUE);
-               } else {
-                       $menu = array(0 => array());
-                       $rowCounter = 0;
-                       $columnCounter = 0;
-                       $itemsPerColumn = ceil(count($options) / 3);
-                       foreach ($options as $kk => $vv) {
-                               if ($rowCounter == $itemsPerColumn) {
-                                       $rowCounter = 0;
-                                       $columnCounter++;
-                                       $menu[$columnCounter] = array();
-                               }
-                               $rowCounter++;
-                               $menu[$columnCounter][]='<input type="checkbox" class="checkbox" value="1" name="compareFlags['.$kk.']" id="checkCompare_'.$kk.'"'.($compareFlags[$kk]?' checked="checked"':'').'> <label for="checkCompare_'.$kk.'">'.htmlspecialchars($vv).'</label>';
-                       }
-                       $outCode = '<p>' . $GLOBALS['LANG']->getLL('groupBy', TRUE) . '</p>';
-                       $outCode .= '<table border="0" cellpadding="3" cellspacing="1" class="compare-checklist valign-top"><tr>';
-                       foreach ($menu as $column) {
-                               $outCode .= '<td>' . implode('<br />', $column) . '</td>';
-                       }
-                       $outCode .= '</tr></table>';
-                       $outCode.='<br /><input type="submit" name="ads" value="' . $GLOBALS['LANG']->getLL('update', TRUE) . '">';
-                       $content = $this->doc->section($GLOBALS['LANG']->getLL('groupAndCompareUsers', TRUE), $outCode, FALSE, TRUE);
-
-                               // Traverse all users
-                       $users = t3lib_BEfunc::getUserNames();
-                       $comparation=array();
-                       $counter=0;
-
-                       $offset=0;
-                       $numberAtTime=1000;
-                       $tooManyUsers='';
-
-                       foreach ($users as $r) {
-                               if ($counter>=$offset) {
-                                               // This is used to test with other users. Development ONLY!
-                                       $tempBE_USER = t3lib_div::makeInstance('local_beUserAuth');     // New backend user object
-                                       /* @var $tempBE_USER local_beUserAuth */
-                                       $tempBE_USER->OS = TYPO3_OS;
-                                       $tempBE_USER->setBeUserByUid($r['uid']);
-                                       $tempBE_USER->fetchGroupData();
-
-                                               // Making group data
-                                       $md5pre='';
-                                       $menu=array();
-                                       $uInfo = $tempBE_USER->ext_compileUserInfoForHash((array)$compareFlags);
-                                       foreach ($options as $kk => $vv) {
-                                               if ($compareFlags[$kk]) {
-                                                       $md5pre.=serialize($uInfo[$kk]).'|';
-                                               }
-                                       }
-                                               // setting md5:
-                                       $md5=md5($md5pre);
-                                       if (!isset($comparation[$md5])) {
-                                               $comparation[$md5]=$tempBE_USER->ext_printOverview($uInfo, $compareFlags);
-                                               $comparation[$md5]['users']=array();
-                                       }
-                                       $comparation[$md5]['users'][]=$tempBE_USER->user;
-                                       unset($tempBE_USER);
-                               }
-                               $counter++;
-                               if ($counter>=($numberAtTime+$offset)) {
-                                       $tooManyUsers=$GLOBALS['LANG']->getLL('tooManyUsers', TRUE) . ' ' . count($users) . '. ' . $GLOBALS['LANG']->getLL('canOnlyDisplay', TRUE) . ' ' . $numberAtTime . '.';
-                                       break;
-                               }
-                       }
-
-                               // Print the groups:
-                       $allGroups=array();
-                               // Header:
-                       $allCells = array();
-
-                       $allCells['USERS'] = '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td><strong>' . $GLOBALS['LANG']->getLL('usernames', TRUE) . '</strong></td></table>';
-
-                       foreach ($options as $kk => $vv) {
-                               if ($compareFlags[$kk]) {
-                                       $allCells[$kk] = '<strong>'.$vv.':</strong>';
-                               }
-                       }
-                       $allGroups[]=$allCells;
-
-                       foreach ($comparation as $dat) {
-                               $allCells = array();
-
-                               $curUid = $GLOBALS['BE_USER']->user['uid'];
-                               $uListArr=array();
-
-                               foreach ($dat['users'] as $uDat) {
-                                       $uItem = '<tr><td width="130">' . t3lib_iconWorks::getSpriteIconForRecord('be_users', $uDat, array('title'=> $uDat['uid'] )) . $this->linkUser($uDat['username'], $uDat) . '&nbsp;&nbsp;</td><td nowrap="nowrap">' . $this->elementLinks('be_users', $uDat);
-                                       if ($curUid != $uDat['uid'] && !$uDat['disable'] && ($uDat['starttime'] == 0 ||
-                                               $uDat['starttime'] < $GLOBALS['EXEC_TIME']) && ($uDat['endtime'] == 0 ||
-                                               $uDat['endtime'] > $GLOBALS['EXEC_TIME'])) {
-                                               $uItem .= '<a href="' . t3lib_div::linkThisScript(array('SwitchUser'=>$uDat['uid'])) . '" target="_top" title="' . htmlspecialchars($GLOBALS['LANG']->getLL('switchUserTo', TRUE) . ' ' . $uDat['username']) . ' ' . $GLOBALS['LANG']->getLL('changeToMode', TRUE) . '">' .
-                                                               t3lib_iconWorks::getSpriteIcon('actions-system-backend-user-switch') .
-                                                       '</a>'.
-                                                       '<a href="' . t3lib_div::linkThisScript(array('SwitchUser'=>$uDat['uid'], 'switchBackUser' => 1)) . '" target="_top" title="' . htmlspecialchars($GLOBALS['LANG']->getLL('switchUserTo', TRUE) . ' ' . $uDat['username']) . ' ' . $GLOBALS['LANG']->getLL('switchBackMode', TRUE) . '">' .
-                                                               t3lib_iconWorks::getSpriteIcon('actions-system-backend-user-emulate') .
-                                                       '</a>';
-                                       }
-                                       $uItem .= '</td></tr>';
-                                       $uListArr[] = $uItem;
-                               }
-                               $allCells['USERS'] = '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.implode('', $uListArr).'</table>';
-
-                               foreach ($options as $kk => $vv) {
-                                       if ($compareFlags[$kk]) {
-                                               $allCells[$kk] = $dat[$kk];
-                                       }
-                               }
-                               $allGroups[]=$allCells;
-                       }
-
-                               // Make table
-                       $outTable='';
-                       $TDparams=' nowrap="nowrap" class="bgColor5" valign="top"';
-                       $i = 0;
-                       foreach ($allGroups as $allCells) {
-                               $outTable.='<tr><td'.$TDparams.'>'.implode('</td><td'.$TDparams.'>', $allCells).'</td></tr>';
-                               $TDparams=' nowrap="nowrap" class="'.($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6').'" valign="top"';
-                       }
-                       $outTable='<table border="0" cellpadding="2" cellspacing="2">' . $outTable . '</table>';
-                       $flashMessageCachedGrouplistsUpdated = t3lib_div::makeInstance(
-                               't3lib_FlashMessage',
-                               '',
-                               $GLOBALS['LANG']->getLL('cachedGrouplistsUpdated', TRUE),
-                               t3lib_FlashMessage::INFO
-                       );
-                       t3lib_FlashMessageQueue::addMessage($flashMessageCachedGrouplistsUpdated);
-                       if ($tooManyUsers) {
-                               $flashMessageTooManyUsers = t3lib_div::makeInstance(
-                                       't3lib_FlashMessage',
-                                       '',
-                                       $tooManyUsers,
-                                       t3lib_FlashMessage::ERROR
-                               );
-                               t3lib_FlashMessageQueue::addMessage($flashMessageTooManyUsers);
-                       }
-                       $content.= $this->doc->spacer(10);
-                       $content.= $this->doc->section($GLOBALS['LANG']->getLL('result', TRUE), $outTable, 0, 1);
-               }
-               return $content;
-       }
-
-       /**
-        * Creates a HTML anchor to the user record
-        *
-        * @param       string          the string used to identify the user (inside the <a>...</a>)
-        * @param       array           the BE user record to link
-        * @return      string          the HTML anchor
-        */
-       function linkUser($str, $rec) {
-               return '<a href="'.htmlspecialchars($this->MCONF['_']).'&be_user_uid='.$rec['uid'].'">' . htmlspecialchars($str) . '</a>';
-       }
-
-       /**
-        * Builds a list of all links for a specific element (here: BE user) and returns it for print.
-        *
-        * @param       string          the db table that should be used
-        * @param       array           the BE user record to use
-        * @return      string          a HTML formatted list of the link
-        */
-       function elementLinks($table, $row) {
-                       // Info:
-               $cells[]='<a href="#" onclick="top.launchView(\'' . $table . '\', \'' . $row['uid'] . '\',\'' . $GLOBALS['BACK_PATH'] . '\'); return false;" title="' . $GLOBALS['LANG']->getLL('showInformation', TRUE) . '">' .
-                               t3lib_iconWorks::getSpriteIcon('actions-document-info') .
-                       '</a>';
-
-                       // Edit:
-               $params='&edit[' . $table . '][' . $row['uid'] . ']=edit';
-               $cells[]='<a href="#" onclick="' . t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], '') . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:edit', TRUE) . '">' .
-                               t3lib_iconWorks::getSpriteIcon('actions-document-open') .
-                       '</a>';
-
-                       // Hide:
-               $hiddenField = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'];
-               if ($row[$hiddenField]) {
-                       $params='&data[' . $table . '][' . $row['uid'] . '][' . $hiddenField . ']=0';
-                       $cells[]='<a href="' . $this->doc->issueCommand($params) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:enable', TRUE) . '">' .
-                               t3lib_iconWorks::getSpriteIcon('actions-edit-unhide') .
-                       '</a>';
-               } else {
-                       $params='&data[' . $table . '][' . $row['uid'] . '][' . $hiddenField . ']=1';
-                       $cells[]='<a href="' . $this->doc->issueCommand($params) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:disable', TRUE) . '">' .
-                               t3lib_iconWorks::getSpriteIcon('actions-edit-hide') .
-                       '</a>';
-               }
-
-                       // Delete
-               $params='&cmd[' . $table . '][' . $row['uid'] . '][delete]=1';
-               $cells[]='<a href="' . $this->doc->issueCommand($params) . '" onclick="return confirm(unescape(\'' . $GLOBALS['LANG']->getLL('sureToDelete', TRUE) . '\'));" title="' . $GLOBALS['LANG']->getLL('delete', TRUE) . '">' .
-                               t3lib_iconWorks::getSpriteIcon('actions-edit-delete') .
-                       '</a>';
-
-               return implode('', $cells);
-       }
-
-       /**
-        * Inits all BE-users available, for development ONLY!
-        *
-        * @return      void
-        */
-       function initUsers() {
-                       // Initializing all users in order to generate the usergroup_cached_list
-               $users = t3lib_BEfunc::getUserNames();
-
-                       // This is used to test with other users. Development ONLY!
-               foreach ($users as $r) {
-                       $tempBE_USER = t3lib_div::makeInstance('local_beUserAuth');     // New backend user object
-                       /* @var $tempBE_USER local_beUserAuth */
-                       $tempBE_USER->OS = TYPO3_OS;
-                       $tempBE_USER->setBeUserByUid($r['uid']);
-                       $tempBE_USER->fetchGroupData();
-               }
-       }
-
-       /**
-        * Returns the local path for this string (removes the PATH_site if it is included)
-        *
-        * @param       string          the path that will be checked
-        * @return      string          the local path
-        */
-       function localPath($str) {
-               if (substr($str, 0, strlen(PATH_site))==PATH_site) {
-                       return substr($str, strlen(PATH_site));
-               } else {
-                       return $str;
-               }
-       }
-
-       /**
-        * Switches to a given user (SU-mode) and then redirects to the start page of the backend to refresh the navigation etc.
-        *
-        * @param       array           BE-user record that will be switched to
-        * @return      void
-        */
-       function switchUser($switchUser) {
-               $uRec=t3lib_BEfunc::getRecord('be_users', $switchUser);
-               if (is_array($uRec) && $GLOBALS['BE_USER']->isAdmin()) {
-                       $updateData['ses_userid'] = $uRec['uid'];
-                               // user switchback
-                       if (t3lib_div::_GP('switchBackUser')) {
-                               $updateData['ses_backuserid'] = intval($GLOBALS['BE_USER']->user['uid']);
-                       }
-                       $GLOBALS['TYPO3_DB']->exec_UPDATEquery('be_sessions', 'ses_id=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($GLOBALS['BE_USER']->id, 'be_sessions') . ' AND ses_name=' . $GLOBALS['TYPO3_DB']->fullQuoteStr(t3lib_beUserAuth::getCookieName(), 'be_sessions') . ' AND ses_userid=' . intval($GLOBALS['BE_USER']->user['uid']), $updateData);
-
-                       $redirectUrl = $GLOBALS['BACK_PATH'] . 'index.php' . ($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? '' : '?commandLI=1');
-                       t3lib_utility_Http::redirect($redirectUrl);
-               }
-       }
-
-       /***************************
-        *
-        * "WHO IS ONLINE" FUNCTIONS:
-        *
-        ***************************/
-
-       /**
-        * @author Martin Kutschker
-        */
-       function whoIsOnline() {
-               $select_fields = 'ses_id, ses_tstamp, ses_iplock, u.uid,u.username, u.admin, u.realName, u.disable, u.starttime, u.endtime, u.deleted, bu.uid AS bu_uid,bu.username AS bu_username, bu.realName AS bu_realName';
-               $from_table = 'be_sessions INNER JOIN be_users u ON ses_userid=u.uid LEFT OUTER JOIN be_users bu ON ses_backuserid=bu.uid';
-               $where_clause = '';
-               $orderBy = 'u.username';
-
-               $timeout = intval($GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout']);
-               if ($timeout > 0) {
-                       $where_clause = 'ses_tstamp > ' . ($GLOBALS['EXEC_TIME'] - $timeout);
-               }
-
-                       // Fetch active sessions of other users from storage:
-               $sessions = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($select_fields, $from_table, $where_clause, '', $orderBy);
-                       // Process and visualized each active session as a table row:
-               if (is_array($sessions)) {
-                       foreach ($sessions as $session) {
-                               $ip = $session['ses_iplock'];
-                               $hostName = '';
-                               if ($session['ses_iplock'] == '[DISABLED]' || $GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP'] == 0) {
-                                       $ip = '-';
-                               } elseif ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP'] == 4) {
-                                       $hostName = ' title="' . @gethostbyaddr($session['ses_iplock']) . '"';
-                               } else {
-                                       $ip .= str_repeat('.*', 4-$GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP']);
-                               }
-                               $outTable .= '
-                                       <tr class="bgColor4" height="17" valign="top">' .
-                                               '<td nowrap="nowrap">' .
-                                                       t3lib_BEfunc::datetime($session['ses_tstamp']) .
-                                               '</td>' .
-                                               '<td nowrap="nowrap">' .
-                                                       '<span'.$hostName.'>'.$ip.'</span>' .
-                                               '</td>' .
-                                               '<td width="130">' .
-                                                       t3lib_iconWorks::getSpriteIconForRecord('be_users', $session, array('title'=>$session['uid'])).htmlspecialchars($session['username']).'&nbsp;' .
-                                               '</td>' .
-                                               '<td nowrap="nowrap">'.htmlspecialchars($session['realName']).'&nbsp;&nbsp;</td>' .
-                                               '<td nowrap="nowrap">'.$this->elementLinks('be_users', $session).'</td>' .
-                                               '<td nowrap="nowrap" valign="top">'.($session['bu_username'] ? '&nbsp;SU from: ' : '').htmlspecialchars($session['bu_username']).'&nbsp;</td>' .
-                                               '<td nowrap="nowrap" valign="top">&nbsp;'.htmlspecialchars($session['bu_realName']).'</td>' .
-                                       '</tr>';
-                       }
-               }
-                       // Wrap <table> tag around the rows:
-               $outTable = '
-               <table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">
-                       <tr class="t3-row-header">
-                               <td>' . $GLOBALS['LANG']->getLL('timestamp', TRUE) . '</td>
-                               <td>' . $GLOBALS['LANG']->getLL('host', TRUE) . '</td>
-                               <td colspan="5">' . $GLOBALS['LANG']->getLL('username', TRUE) . '</td>
-                       </tr>' . $outTable . '
-               </table>';
-
-               $content .= $this->doc->section($GLOBALS['LANG']->getLL('whoIsOnline', TRUE), $outTable, FALSE, TRUE);
-               return $content;
-       }
-
-}
-
-// Make instance:
-$SOBE = t3lib_div::makeInstance('SC_mod_tools_be_user_index');
-$SOBE->init();
-$SOBE->main();
-$SOBE->printContent();
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/mod/locallang.xlf b/typo3/sysext/beuser/mod/locallang.xlf
deleted file mode 100644 (file)
index 9300f92..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xliff version="1.0">
-       <file source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:32Z" product-name="beuser">
-               <header/>
-               <body>
-                       <trans-unit id="pageTitle" xml:space="preserve">
-                               <source>Page title:</source>
-                       </trans-unit>
-                       <trans-unit id="path" xml:space="preserve">
-                               <source>Path:</source>
-                       </trans-unit>
-                       <trans-unit id="user" xml:space="preserve">
-                               <source>User:</source>
-                       </trans-unit>
-                       <trans-unit id="group" xml:space="preserve">
-                               <source>Group:</source>
-                       </trans-unit>
-                       <trans-unit id="everybody" xml:space="preserve">
-                               <source>Everybody:</source>
-                       </trans-unit>
-                       <trans-unit id="thisUser" xml:space="preserve">
-                               <source>This user:</source>
-                       </trans-unit>
-                       <trans-unit id="mainGroup" xml:space="preserve">
-                               <source>Main group:</source>
-                       </trans-unit>
-                       <trans-unit id="editLock" xml:space="preserve">
-                               <source>Edit lock prevents all editing</source>
-                       </trans-unit>
-                       <trans-unit id="noReadAccess" xml:space="preserve">
-                               <source>The user has no read-access to these DB-mounts!</source>
-                       </trans-unit>
-                       <trans-unit id="live" xml:space="preserve">
-                               <source>[LIVE]</source>
-                       </trans-unit>
-                       <trans-unit id="defaultDraft" xml:space="preserve">
-                               <source>[Default Draft]</source>
-                       </trans-unit>
-                       <trans-unit id="notAccessible" xml:space="preserve">
-                               <source>WARNING: Workspace Webmount page id not accessible:</source>
-                       </trans-unit>
-                       <trans-unit id="compareUserSettings" xml:space="preserve">
-                               <source>Compare User Settings</source>
-                       </trans-unit>
-                       <trans-unit id="listUsersOnline" xml:space="preserve">
-                               <source>List Users Online</source>
-                       </trans-unit>
-                       <trans-unit id="backendUserAdministration" xml:space="preserve">
-                               <source>Backend User Administration</source>
-                       </trans-unit>
-                       <trans-unit id="filemounts" xml:space="preserve">
-                               <source>Filemounts</source>
-                       </trans-unit>
-                       <trans-unit id="webmounts" xml:space="preserve">
-                               <source>Webmounts</source>
-                       </trans-unit>
-                       <trans-unit id="defaultUploadPath" xml:space="preserve">
-                               <source>Default upload path</source>
-                       </trans-unit>
-                       <trans-unit id="mainUserGroup" xml:space="preserve">
-                               <source>Main user group</source>
-                       </trans-unit>
-                       <trans-unit id="memberOfGroups" xml:space="preserve">
-                               <source>Member of groups</source>
-                       </trans-unit>
-                       <trans-unit id="pageTypesAccess" xml:space="preserve">
-                               <source>Page types access</source>
-                       </trans-unit>
-                       <trans-unit id="selectTables" xml:space="preserve">
-                               <source>Select tables</source>
-                       </trans-unit>
-                       <trans-unit id="modifyTables" xml:space="preserve">
-                               <source>Modify tables</source>
-                       </trans-unit>
-                       <trans-unit id="nonExcludeFields" xml:space="preserve">
-                               <source>Non-exclude fields</source>
-                       </trans-unit>
-                       <trans-unit id="explicitAllowDeny" xml:space="preserve">
-                               <source>Explicit Allow/Deny</source>
-                       </trans-unit>
-                       <trans-unit id="limitToLanguages" xml:space="preserve">
-                               <source>Limit to languages</source>
-                       </trans-unit>
-                       <trans-unit id="workspacePermissions" xml:space="preserve">
-                               <source>Workspace permissions</source>
-                       </trans-unit>
-                       <trans-unit id="workspaceMembership" xml:space="preserve">
-                               <source>Workspace membership</source>
-                       </trans-unit>
-                       <trans-unit id="customOptions" xml:space="preserve">
-                               <source>Custom options</source>
-                       </trans-unit>
-                       <trans-unit id="modules" xml:space="preserve">
-                               <source>Modules</source>
-                       </trans-unit>
-                       <trans-unit id="tsconfig" xml:space="preserve">
-                               <source>TSconfig</source>
-                       </trans-unit>
-                       <trans-unit id="tsconfigHL" xml:space="preserve">
-                               <source>TSconfig HL</source>
-                       </trans-unit>
-                       <trans-unit id="nonMountedReadablePages" xml:space="preserve">
-                               <source>Non-mounted readable pages:</source>
-                       </trans-unit>
-                       <trans-unit id="backToOverview" xml:space="preserve">
-                               <source>&lt; Back to overview</source>
-                       </trans-unit>
-                       <trans-unit id="userInfo" xml:space="preserve">
-                               <source>User Info</source>
-                       </trans-unit>
-                       <trans-unit id="groupBy" xml:space="preserve">
-                               <source>Group by:</source>
-                       </trans-unit>
-                       <trans-unit id="update" xml:space="preserve">
-                               <source>Update</source>
-                       </trans-unit>
-                       <trans-unit id="groupAndCompareUsers" xml:space="preserve">
-                               <source>Group and Compare Users</source>
-                       </trans-unit>
-                       <trans-unit id="tooManyUsers" xml:space="preserve">
-                               <source>There were too many users:</source>
-                       </trans-unit>
-                       <trans-unit id="canOnlyDisplay" xml:space="preserve">
-                               <source>This tool can only display the following number of users at a time:</source>
-                       </trans-unit>
-                       <trans-unit id="newUser" xml:space="preserve">
-                               <source>Create new user</source>
-                       </trans-unit>
-                       <trans-unit id="usernames" xml:space="preserve">
-                               <source>Usernames:</source>
-                       </trans-unit>
-                       <trans-unit id="switchUserTo" xml:space="preserve">
-                               <source>Switch user to:</source>
-                       </trans-unit>
-                       <trans-unit id="changeToMode" xml:space="preserve">
-                               <source>[change-to mode]</source>
-                       </trans-unit>
-                       <trans-unit id="switchBackMode" xml:space="preserve">
-                               <source>[switch-back mode]</source>
-                       </trans-unit>
-                       <trans-unit id="cachedGrouplistsUpdated" xml:space="preserve">
-                               <source>(All cached group-lists updated.)</source>
-                       </trans-unit>
-                       <trans-unit id="result" xml:space="preserve">
-                               <source>Result</source>
-                       </trans-unit>
-                       <trans-unit id="showInformation" xml:space="preserve">
-                               <source>Show information</source>
-                       </trans-unit>
-                       <trans-unit id="sureToDelete" xml:space="preserve">
-                               <source>Are you sure you want to delete this element?</source>
-                       </trans-unit>
-                       <trans-unit id="delete" xml:space="preserve">
-                               <source>Delete(!)</source>
-                       </trans-unit>
-                       <trans-unit id="timestamp" xml:space="preserve">
-                               <source>Timestamp:</source>
-                       </trans-unit>
-                       <trans-unit id="host" xml:space="preserve">
-                               <source>Host:</source>
-                       </trans-unit>
-                       <trans-unit id="username" xml:space="preserve">
-                               <source>Username:</source>
-                       </trans-unit>
-                       <trans-unit id="whoIsOnline" xml:space="preserve">
-                               <source>Who Is Online</source>
-                       </trans-unit>
-               </body>
-       </file>
-</xliff>
diff --git a/typo3/sysext/beuser/mod/locallang_mod.xlf b/typo3/sysext/beuser/mod/locallang_mod.xlf
deleted file mode 100644 (file)
index bcd741c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xliff version="1.0">
-       <file source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:32Z" product-name="beuser">
-               <header/>
-               <body>
-                       <trans-unit id="mlang_labels_tablabel" xml:space="preserve">
-                               <source>Administration of Backend Users</source>
-                       </trans-unit>
-                       <trans-unit id="mlang_labels_tabdescr" xml:space="preserve">
-                               <source>The User Admin module provides you with an overview of all backend users. You can group them by their properties so you're able to monitor their permissions, filemounts, TSconfig, member groups etc.. This module is an indispensable tool in order to make sure the users are correctly configured.&lt;br /&gt;&lt;em&gt;Access for 'admin' users only!&lt;/em&gt;</source>
-                       </trans-unit>
-                       <trans-unit id="mlang_tabs_tab" xml:space="preserve">
-                               <source>User Admin</source>
-                       </trans-unit>
-               </body>
-       </file>
-</xliff>