[TYPO3-english] Login user

Dawid Pacholczyk dpacholczyk at gmail.com
Thu Aug 12 09:32:04 CEST 2010


sure

$loginData=array(
            'uname' => $postvars['username'], //usernmae
            'uident' => $postvars['pass1'], //password
            'status' => 'login'
        );
            $GLOBALS['TSFE']->fe_user->checkPid = 0; //do not use a
particular pid
            $info= $GLOBALS['TSFE']->fe_user->getAuthInfoArray();
            $user=$GLOBALS['TSFE']->fe_user->fetchUserRecord(
               $info['db_user'],$loginData['uname']);
            $ok=$GLOBALS['TSFE']->fe_user->compareUident($user,$loginData);
            if($ok) {
              //login successfull
              $GLOBALS['TSFE']->fe_user->createUserSession($user);
            }

probles was in $loginData

instead "=" you need to use "=>"

the second problem was here: $GLOBALS['TSFE']->fe_user-checkPid = 0; //do
not use a particular pid

you need to make it like this: $GLOBALS['TSFE']->fe_user->checkPid = 0; //do
not use a particular pid

Best regards,
Dawid Pacholczyk






2010/8/12 Georg Ringer <mail at ringerge.org>

> Am 12.08.2010 09:22, schrieb Dawid Pacholczyk:
> > Thank you Georg.
> >
> > But there are few mistakes in the code :)
> >
> > That works great !
>
> so can you please post here a working code? thanks
>
> georg
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>



-- 
Dawid Pacholczyk
tel: 502-054-334
gg: 5564051
skype: dpacholczyk
http://typo3blog.pl (only polish version at the moment)


More information about the TYPO3-english mailing list