textfile LoginHandler

Author Message

Sonia Sanchez

Monday 19 January 2009 10:28:56 am

Hi, I want to login using textfile handler, but I have some problems.

At first, I put the next lines inside the override/site.ini.append.php in to the [UserSettings] section.

LoginHandler[]=standard
LoginHandler[]=textfile

Next I generate a new override for config file override/textfile.ini.append.php with this values:

[TextFileSettings]
TextFileEnabled=true
FileName=users.txt
FilePath=root
FileFieldSeparator=;
DefaultUserGroupType=id
DefaultUserGroup=12
LoginAttribute=1
PasswordAttribute=3
FirstNameAttribute=4
LastNameAttribute=5
EmailAttribute=2

My /users.txt contains this line:

test;email@mydomain.com;test;Test;Test

And finally, I clean the caches and refresh the page.

Now, If I login with user from eZ, all goes ok. Then, if I login with an user that doesn't exist, eZ says me that, but if I login with the textfile user, eZ returns me this error:

Fatal error: eZ Publish did not finish its request
The execution of eZ Publish was abruptly ended, the debug output is present below.

In debug there are not any error...
Anyone knows what happens?

Thank you! :)

André R.

Monday 19 January 2009 12:10:03 pm

If this is locally or developer server / setup: Enable error output for php in it's php.ini file.
Then you'll probably get some more useful debug output.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Carlos Revillo

Monday 19 January 2009 12:51:08 pm

Hi. I've just tried to reproduce your situation, because in a few days we'll need to work with text files for login :)

I've done what Andre said and got this error.

Fatal error: Using $this when not in object context in /var/www/ez1/kernel/classes/datatypes/ezuser/eztextfileuser.php on line 252

After you fix this, you'lll get same error at line 291.

What have worked for me is to change line 252 from

$existUser = $this->fetchByName( $login );

to

$existUser = ezUser::fetchByName( $login );

and line 291 from

$user = $this->create( $userID );

to

$user = eZUser::create( $userID );

I'm working with the trunk version of this file, so, is this maybe a bug?

Hope it helps.

Kristof Coomans

Monday 19 January 2009 11:13:43 pm

http://issues.ez.no/14270

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Sonia Sanchez

Tuesday 20 January 2009 12:50:18 am

Thank you! The bug is solved and all goes ok! ;)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.