[cgiapp] :Authentication: log in a user by script

Alex capfan at gmx.de
Wed Oct 21 16:41:05 EDT 2009


Ok, here it is: I tried to get it up to github, but the web interface still
doesn't work for me and I don't want to spend time on syncing my local pc
with github.com.

So here is the code as attachement. I renamed it from .pm to .txt.

So again: what do you think about it?

Regards, Alex

-----Ursprüngliche Nachricht-----
Von: cgiapp-bounces at lists.openlib.org
[mailto:cgiapp-bounces at lists.openlib.org] Im Auftrag von Alex
Gesendet: Dienstag, 20. Oktober 2009 22:40
An: 'CGI Application'
Betreff: Re: [cgiapp] :Authentication: log in a user by script

Dear all!

I created a multi step registration form. It collects some data from a user,
including a email address, asks for a confirmation code and finally set up
some things.

After the last step, when all data is written to the database while creating
a new user, I want to log in this user, set up a message to hail him welcome
and redirect him to his workspace.

There is a tutorial on http://cgiapp.erlbaum.net that shows a similar
approach, although they use their own authentication procedure. I want to
stick with CGI::Application::Plugin::Authentication, because the system is
already implemented using the module. I just reworked the registration part.

So, is there any possibility to easily authenticate a user in the script?
There is no such method like $cgiapp->authen->authenticate_user($username,
$password);
If I got it right, during prerun stage, the query object is queried for
authentication credentials. This process is a singleton, so I cannot simply
add the username and the password in a runmode and call the initialize
method of authen() again (nor would I want that for some reasons).

I was thinking on encapsulating the part of initialize(), that actually
authenticates a user, so it could be used by initialize() and a new method
authenticate_user(). But I'm not sure if this would be a good thing, so I
ask you to judge (the approach).

Regards, Alex



#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Authentication-0.15.txt
Url: http://lists.openlib.org/pipermail/cgiapp/attachments/20091021/8218c1cd/attachment-0001.txt 


More information about the cgiapp mailing list