Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to "Login as" in backend and to "autologin" after registration #27

Closed
davidbru opened this issue Sep 5, 2017 · 4 comments
Closed

Comments

@davidbru
Copy link

davidbru commented Sep 5, 2017

Scenario "Login as":
In the backend module when I click the "Login as" button in the desired user line it opens a new tab with the url: http://www.example.com/?eID=femanagerLoginAs&user=18
It then makes a 303 redirect in the new tab to http://www.example.com/ but does not log me in as the desired user.

Scenario "Autologin":
If I enable autologin via typoscript (plugin.tx_femanager.settings.new.login = 1) it also is not working.

Hacky solution
A really dirty hack which fixed the problem for me was to add the following lines to classes/Utility/UserUtility.php
$reflection = new \ReflectionClass($tsfe->fe_user);
$setSessionCookieMethod = $reflection->getMethod('setSessionCookie');
$setSessionCookieMethod->setAccessible(TRUE);
$setSessionCookieMethod->invoke($tsfe->fe_user);

after
$tsfe->fe_user->createUserSession($user);

Like it is described here:
https://forge.typo3.org/issues/62194#note-6

The strange thing is, that on my local MAMP environment it works without those 4 lines and on the production environment it did not.

Any idea how to resolve the error?

Kind regards,
David


System environment (Production)
TYPO3: 8.7.4
femanager: 3.1.1
PHP: 7.0.22-0ubuntu0.16.04.1

System environment (Development)
TYPO3: 8.7.4
femanager: 3.1.1
PHP: 7.0.20

@einpraegsam
Copy link
Collaborator

Hmm, first of all I think that you could be right but I can't reproduce it on my testparcours.
Nevertheless I don't want to add code that is not needed on most cases or let's say I don't want to add code for a bugfix where I cannot reproduce the bug.
If you can tell me how to reproduce it or what's the difference between your both instances, I will do a fix.

@samir-plusb
Copy link

I had the exact same problem. In some cases the session cookie will be reset to a anonymous fe-user cookie, but I could not find the reason why this happened. But this hack did the trick, thanks!

einpraegsam added a commit that referenced this issue Nov 10, 2017
Some users reported that autologin does not work. I'm not final sure what the error is about, but this hacky function seems to work. See details on Github issue.

Related: #27
@einpraegsam
Copy link
Collaborator

Ok, normally I do not fix stuff that I can't reproduce. And that the solution is a reflexion class does not make this situation easier.
Nevertheless I think this is an issue that must be resolved in any way. I just published femanager 3.2.0 with this change. This can be turned on in extension manager settings of femanager.
Thx for reporting and testing.

@nabossha
Copy link

count me in on this fix. enabling it in install-tool is the only way to make it work for me too. thanks for that anyway!

PHP 7.1.4 (running as FPM)
Apache 2.45
OS: Darwin 15.6
TYPO3 8.7.9
femanager 3.3.0

sbusemann pushed a commit that referenced this issue Dec 19, 2023
…-wizard

[FIX] Shows the labels in New Content Wizard again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants