Skip to content
Snippets Groups Projects
Commit c915b0ab authored by Philipp Kitzberger's avatar Philipp Kitzberger Committed by Steffen Ritter
Browse files

[BUGFIX] BE user switch impossible when in adminOnly mode

Enables the switching of BE users when the BE is in adminOnly mode.

Change-Id: I5fb6606acbe53885335619e2edfe9448b6988458
Fixes: #32686
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7469
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
parent f20dfac9
No related merge requests found
......@@ -366,6 +366,7 @@ class t3lib_beUserAuth extends t3lib_userAuthGroup {
* + backend user is a regular user and adminOnly is not defined
* + backend user is an admin user
* + backend user is used in CLI context and adminOnly is explicitely set to "2"
* + backend user is being controlled by an admin user
*
* @return boolean Whether a backend user is allowed to access the backend
*/
......@@ -379,6 +380,13 @@ class t3lib_beUserAuth extends t3lib_userAuthGroup {
// Backend user is allowed if adminOnly is set to 2 (CLI) and a CLI process is running:
} elseif ($adminOnlyMode == 2 && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI)) {
$isUserAllowedToLogin = TRUE;
// Backend user is allowed if an admin has switched to that user
} elseif ($this->user['ses_backuserid']) {
$backendUserId = intval($this->user['ses_backuserid']);
$whereAdmin = 'uid=' . $backendUserId . ' AND admin=1' . t3lib_BEfunc::BEenableFields('be_users');
if ($GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'be_users', $whereAdmin) > 0) {
$isUserAllowedToLogin = TRUE;
}
}
return $isUserAllowedToLogin;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment