CDRO / simulatebe

Simulatebe allows you to log in to the backend with your frontend user.
0 stars 3 forks source link

TYPO 8 compatible Version? #2

Closed SvenJuergens closed 6 years ago

SvenJuergens commented 6 years ago

hi, do you plan to update this extension für TYPO3 8?

CDRO commented 6 years ago

Hi Sven,

I haven't currently got a project where this is used in TYPO3 8 but AFAIK the extension should work with TYPO3 8 (you can just click "I know what I do" when enabling the installation).

If you encounter any issues and want them fixed (or fix them yourself) I'll gladly provide the bugfixes/merge your fixes into the project.

Best Regards Tizian

SvenJuergens commented 6 years ago

Hi Tizian,

thanks for your fast feedback :)

currently i'm sitting on an update from TYPO3 7.6.23 to current 8.7.9 and it seems that simularebe make 2 extra 302 redirects to the same URL. My problem is that I can not access form data anymore. When I click send, I have the two redirects and the form data is gone. If I uninstall the extension everything works. Unfortunately, I have not found out what the reason is.

Best Regards Sven

CDRO commented 6 years ago

Hello Sven,

I checked the source code and this should only happen if:

  1. the backend user is not yet logged in and the typoscript configuration is set to "allow" (which it obviously should be) and the TSFE->loginUser flag is set (so there was a login attempt)
  2. The logged in user has a be user attached to it OR a backend user has the current frontend user attached to it
  3. the session could be created OR if a session was found

If these three cases match, there will be a redirect to either the backend (if you enabled this in the extension configuration) or to the current location otherwise.

Could you limit the "allow" in the configuration to the login page only so that other pages are not affected by this behaviour? (Just to try, so you have a fix for your issue now)

Regards Tizian

[EDIT] I've just seen that I missed a redirect, this on works like this:

  1. there is a simulatebe cookie (defined in extension configuration) ad if the value is not the same as the value in the be user cookie
  2. there is no session for the backend user with the current value of the be user cookie If this happens the be user cookie and the simulatebe cookie are deleted.
SvenJuergens commented 6 years ago

Hi Tizian,

sorry for my late reply. It looks like I found the problem. In TYPO3 8 there is no longer the $be_user_obj->session_table property. See Breaking-70316

Thus, no session is written to the database. A fast search for "$be_user_obj->session_table" and replace with "be_sessions" works (for me). But a use of the new session framework would certainly be better.

and some offtopic ... This version on github is different than on forge.typo3.org.

It seems the version on forge is more up-to-date, because it also contains the bugfix 81431. The version in the TER does NOT have this fix. Can you maybe look again?

CDRO commented 6 years ago

I'll take a look into it and get back to asap.

Regards Tizian

SvenJuergens commented 6 years ago

hi Tizian,

I have seen you have changed a lot :) Would a TER upload already possible?

Best Regards Sven

CDRO commented 6 years ago

Hi Sven,

If you can confirm that everything works for you again, I'll happily update the extension.

Regards Tizian

SvenJuergens commented 6 years ago

Hi Tizian,

I did an update and everything works as expected. 👍 Many thanks for your work