[Zope] Embedding authentication in a Zope Website

Chris McDonough chrism@digicool.com
Mon, 19 Jun 2000 23:53:44 -0400


Knight,

The primary way of obtaining the credentials of the currently logged in
user is through the AUTHENTICATED_USER attribute of the REQUEST object,
ala:

<dtml-unless "REQUEST.AUTHENTICATED_USER.getName() == 'Anonymous'>
   Important stuff
</dtml-unless>
   Unimportant stuff.

You probably don't want to hardcode too much of this stuff into DTML,
this is what permissions assigned to objects and roles assigned to users
are for.  Read the content manager's guide for more information on
permissions and roles.

The subject is a big one.  I'e never used MySQLuserfolder, so I can't
give you much info on that in particular.  I assume it operates much
like the "basic" user folder that comes 'preinstalled' in the Zope root
folder, in which case you'll need to read up on AUTHENTICATED_USER. 
Searching the Zope.org site for "AUTHENTICATED" should turn up a bunch
of hits (although AUTHENTICATED_USER will probably not because of
limitations in our cataloging engine).  The How-tos that you'll find
through this search are probably good for this sort of thing as well.

knight wrote:
> 
> Greetings,
> 
> Please bear with me, I'm still slightly new to Zope, but I'm pretty up on
> the structure, miscellaneous administration, etc. I'm also beginning to do
> well with Python development.
> 
> I wanted to start adding authentication to my site via HTML forms, and I
> saw mysqlUserFolder. There aren't any real docs that come with it. More or
> less, a README that explains the feature set of the Product is all that it
> has.
> 
> Installing mysqlUserFolder wasn't the problem. The problem is now
> dynamically outputting content based upon login information. How do I
> manipulate who is logged in? How do I check to see if a user is logged in,
> etc? Do I need to read some plain zope authentication docs? If so, please
> point me in the right direction.
> 
> What do I embed in my DTML in order to check for authentication?
> 
> I really appreciate the help... The Zope documentation is still a little
> out of order, and slightly confusing to navigate.
> 
> Knight
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )