简体   繁体   English

如何为TYPO3 Extbase FE插件代码创建更高的优先级?

[英]How to create higher priority to TYPO3 Extbase FE Plugin code?

I am about to write an own social media login extension for TYPO3 7 (LTS). 我即将为TYPO3 7(LTS)编写一个自己的社交媒体登录扩展名。 The connection to FE users is set up and everything seems to work in general. 与FE用户的连接已建立,并且似乎一切正常。 The extension offers a FE plugin that has the typical login buttons. 该扩展程序提供了一个具有典型登录按钮的FE插件

My problem is now, the login code runs to late (I guess in the FE plugin environment). 我的问题是,登录代码运行到很晚(我想是在FE插件环境中)。 Every other website parts (template extension etc.) that are related to the login state still say the user is logged out. 与登录状态相关的所有其他网站部分(模板扩展名等)仍然表示用户已注销。 Only if you reload the page everything works. 仅当您重新加载页面时,一切正常。

So where and how can I initialize a function that can evaluate Extbase form data and do something like 所以我在哪里以及如何初始化可以评估Extbase表单数据并执行类似操作的函数

$GLOBALS['TSFE']->fe_user->checkPid = 0;
$GLOBALS['TSFE']->fe_user->is_permanent = 0;
$info = $GLOBALS['TSFE']->fe_user->getAuthInfoArray();
$user = $GLOBALS['TSFE']->fe_user->fetchUserRecord($info['db_user'], $username);
$GLOBALS['TSFE']->fe_user->createUserSession($user);

$GLOBALS['TSFE']->loginUser = true;
$GLOBALS['TSFE']->fe_user->setAndSaveSessionData('dummy', TRUE);
$GLOBALS['TSFE']->fe_user->user = $GLOBALS['TSFE']->fe_user->fetchUserSession();

before any other extension comes and check for the login state? 在任何其他扩展名出现之前,请检查登录状态?

What you should do, is look into the Authentication Service layer of TYPO3 - that is the part that authenticates and create a session for both frontend and backend. 您应该做的是查看TYPO3的“身份验证服务”层-这是对前端和后端进行身份验证并创建会话的部分。 The docs are full with great descriptions 文档充满了很棒的描述

https://docs.typo3.org/typo3cms/Typo3ServicesReference/7.6/Developer/NewServiceType/Index.html https://docs.typo3.org/typo3cms/Typo3ServicesReference/7.6/Developer/NewServiceType/Index.html

https://docs.typo3.org/typo3cms/Typo3ServicesReference/7.6/Authentication/Index.html https://docs.typo3.org/typo3cms/Typo3ServicesReference/7.6/Authentication/Index.html

And look at a extension like social_auth 并查看诸如social_auth类的扩展名

https://github.com/kalypso63/social_auth https://github.com/kalypso63/social_auth

for reference 以供参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM