[TYPO3-english] Switch to other frontend user

Iban Cardona i Subiela icardona at serialnet.net
Mon Mar 12 15:52:02 CET 2012


Thank you so much!

On 03/12/2012 10:09 AM, Richard Davies wrote:
> Hi
>
> Best idea would probably be log the user off and then log them on as the
> other user. To manually log a user on:
> $where = ....
> $user = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
>                 '*',
>                 'fe_users',
>                 $where
>                 );
>                 if($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($user)){
>                     //thanks to sociallogin2t3
>                     $fe_user = $GLOBALS['TSFE']->fe_user;
>                     $fe_user->createUserSession($row);
>                     $fe_user->loginSessionStarted = TRUE;
>                     $fe_user->user = $fe_user->fetchUserSession();
>                     $GLOBALS["TSFE"]->loginUser = 1;
>                     //$this->loginSessionStarted = TRUE;
>                 } else {
>                     //user fetch failed
>                 }
>
> As you can see by the comment, I've used the code from sociallogin2t3 here.
>
> Richard
>
>
> On 12 March 2012 21:45, Iban Cardona i Subiela <icardona at serialnet.net>wrote:
>
>> Hello,
>>
>> I have a question about making a action in my frontend plugin.
>> I have a frontend user logged in my frontend plugin. I would like that
>> after click in a button, switch to other feuser.
>> Does anyone know how can I? What code should I put on my frontend plugin?
>>
>> Thank you so much.
>>
>> --
>> _______________________________________________
>> TYPO3-english mailing list
>> TYPO3-english at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>

-- 

Serialnet SL
*  IBAN CARDONA I SUBIELA*
  SERIALNET NETWORKING I SOFTWARE LLIURE SL
  c/Bailèn, 71Bis 5è 3a
  08009 - Barcelona
  Tel. 93 265 09 37
  http://www.serialnet.cat
  LINKEDIN:http://www.linkedin.com/in/icsbcn
<http://www.linkedin.com/in/icsbcn>

------------------------------------------------------------------------

*AVÍS LEGAL:* La informació continguda en aquest missatge de correu
electrònic és confidencial i pot incloure dades de caràcter reservat.
Aquesta informació va dirigida únicament al seu destinatari. L'accés o
el seu ús per part d'una altra persona no autoritzada pot ésser
il·legal. Si no és Vostè la persona destinatària, si us plau,
esborreu-ne el contingut. D'acord amb la Llei Orgànica 15/1999, de 13 de
desembre, li comuniquem que la seva adreça de correu electrònic forma
part del nostre fitxer per poder mantenir el contacte amb vostè. Si
vostè vol oposar-se, accedir, cancel.lar o rectificar les seves dades
posi's en contacte amb Serialnet Networking i Software Lliure S.L mail
info at serialnet.net <mailto:info at serialnet.net> o al telèfon 93 265 09 37.

*AVISO LEGAL:* La información contenida en este mensaje de correo
electrónico es confidencial y puede revestir el carácter de reservada.
Está destinada exclusivamente a su destinatario. El acceso o uso de este
mensaje, por parte de cualquier otra persona que no esté autorizada,
pueden ser ilegales. Si no es Ud. la persona destinataria, le rogamos
que proceda a eliminar su contenido. Conforme a la Ley Orgánica 15/1999,
de 13 de diciembre, le comunicamos que su dirección de correo
electrónico forma parte de nuestro fichero con el objetivo de poder
mantener el contacto con Ud. Si desea oponerse, acceder, cancelar o
rectificar sus datos, póngase en contacto con Serialnet Networking i
Software Lliure S.L a través del correo electrónico info at serialnet.net
<mailto:info at serialnet.net> o al teléfono 93 265 09 37.

*LEGAL NOTICE:* The information contained in this e-mail is confidential
and can be considered as reserved. It is exclusively destined to its
recipient. The access or use of this message, by any another non
authorized person, can be illegal. If you're not you the intended
person, we beg you that please proceed to eliminate its content.
According to the constitutional law 15/1999, of December 13th, we
communicate you that its e-mail address forms part of our card index
with the purpose to be able to maintain the contact with you. For
cancellation, agreement or rectification of data, please contact
Serialnet Networking i Software Lliure S.L mail info at serialnet.net
<mailto:info at serialnet.net> or telephone number 93 265 09 37



More information about the TYPO3-english mailing list