<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY style="COLOR: #000000; FONT-FAMILY: Arial" hb_focus_attach="true">
<DIV><SPAN class=531130923-26092003><FONT size=2>Hey all,</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>Wanted to share some specifics
because this shouldn't have taken 3 hours!</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>Install
exUserFolder</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>Why? Want to
authenticate users against a database or external source instead of Plone or
Zope native acl_users.</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>How
long? Hopefully less than 1 hour with this doc!</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT
size=2>Environment:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>Windows 2000
Server, Plone 1.0.5</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>(Instead of speaking
generically and full of theory and foo-bar crap and " ... " everywhere we NEED
the fricking code example, </FONT></SPAN><SPAN class=531130923-26092003><FONT
size=2>I am going to list EXACT specifics for my
environment.)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003></SPAN><SPAN class=531130923-26092003><FONT
size=2>Specific Steps:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>1) At "Root Folder" in the ZMI,
add (Z ODBC Database Connection) mine is: [bosdev_odbc]</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>which
connects to an Interbase (Borland) database. (It shouldn't
matter what db you use. It's </FONT></SPAN><SPAN
class=531130923-26092003><FONT size=2>easy to test your connection with any sql
you want.</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>2) Download exUserFolder <A
href="http://www.zope.org/Members/TheJester/exUserFolder">http://www.zope.org/Members/TheJester/exUserFolder</A> 0-10-10
was latest non-dev release. Extract files to Product directory.
Restart Zope.</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>3) In ZMI, Inside my plone
site [/dev], (NOT at the root), deleted the acl_users
folder.</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>4) In ZMI, in Plone
site /dev, Added "ex User Folder"</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>Choose
Sources:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT
size=2> Auth Source: MySql, Property
Source: MySql, Membership Source: Basic, Group: Null</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2> MySQL Auth:
(follow your own database schema of course)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2> Database
conn: "bosdev_odbc"</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>Table:
"login_user"</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>Username
column: "login_name"</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>Password:
"webpassword"</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>Roles:
"description" (not doing anything useful with this yet, but give it a
valid field.)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2> Edit Basic
Membership:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003>
<FONT size=2>fill in site name & email, checked "member" for default
role</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2> Choose Auth
Type:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>Standard
basic auth (for form login)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>Cache
Timeout: 1800</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2> After that
... /dev/acl_users in the ZMI yielded a list of 10 users ... and "Next 10
results" </FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2> Had users in
the ZMI, but the authentication didn't work yet.</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>5) How to make the Auth
Work? What is Missing?</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN><SPAN
class=531130923-26092003><FONT size=2>
<DIV><SPAN class=531130923-26092003><FONT size=2>This part wasn't
documented (in readme or anywhere) w/ specifics</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003></SPAN></FONT></SPAN><SPAN
class=531130923-26092003><FONT size=2>None of the SQL in <U><FONT color=#800080
size=3><STRONG>/</STRONG></FONT></U><A
href="http://lemon:8238/dev/manage_workspace"><STRONG><FONT
size=3>dev</FONT></STRONG></A><STRONG><FONT size=3>/</FONT></STRONG><A
href="http://lemon:8238/dev/acl_users/manage_workspace"><STRONG><FONT
size=3>acl_users</FONT></STRONG></A><STRONG><FONT size=3>/</FONT></STRONG><A
class=strong-link
href="http://lemon:8238/dev/acl_users/mysqlAuthSource/manage_workspace"><STRONG><FONT
size=3>mysqlAuthSource</FONT></STRONG></A></FONT><FONT size=3><STRONG>
</STRONG></FONT></SPAN><SPAN class=531130923-26092003><FONT size=2>(left panel
in ZMI) address authorizing a user. </FONT></SPAN></DIV></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>[P: is the root of my plone
directory.]</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>In
P:\Data\Products\exUserFolder\mysqlAuthSource\mysqlAuthSource.py</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003> <FONT size=2>There's a
comment about what has to be done:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2> #<BR> # You can
define this to go off and do the authentication instead of<BR> # using the
basic one inside the User
Object<BR> #<BR> remoteAuthMethod=None<BR></FONT></SPAN><SPAN
class=531130923-26092003> </SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>6) Define
remoteAuthMethod:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>Where?
P:\Data\Products\exUserFolder\mysqlAuthSource\mysqlAuthSource.py</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>Why? Because I chose
"MySql" while setting up, that is the folder to modify the
mysqlAuthSource.py. (it's in several directories)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>In this file, I had to add 3
chunks of code:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>6a) define the dtml
method</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2> #<BR> # You can
define this to go off and do the authentication instead of<BR> # using the
basic one inside the User Object<BR> #<BR> #
remoteAuthMethod=None<BR> def remoteAuthMethod (self, username,
password):<BR>
""" Do auth! """<BR>
result=self.sqlAuthUser(username=username,
password=password)<BR> return
result<BR></DIV></FONT></SPAN>
<DIV><SPAN class=531130923-26092003><FONT size=2>6b) Adding the SQL
object</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2># Already there
...</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2> def
delSQLQueries(self):<BR> sqllist=self.objectIds('Z SQL
Method')<BR> self.manage_delObjects(ids=sqllist)</FONT></SPAN></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2># Must add this inside the def
delSQLQueries(self):</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT
size=2> sqlAuthUser=SQL(<BR>
'sqlAuthUser',<BR> 'Auth
One
User',<BR> self.connection,<BR> 'table=%s
username:string
password:string'%(self.table),<BR> _sqlAuthUser)</FONT></SPAN></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><SPAN class=531130923-26092003><FONT
size=2> self._setObject('sqlAuthUser',
sqlAuthUser)<BR></FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>6c) The SQL</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>(at the very bottom of the
file)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>_sqlAuthUser="""<BR>SELECT *
FROM <dtml-var table><BR>where <dtml-var
usernameColumn>=<dtml-sqlvar username type=string><BR>and
<dtml-var passwordColumn>=<dtml-sqlvar password
type=string><BR>"""<BR></FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>7) Save file, restart zope,
test login ...</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>8) Fix python errors ...
restart zope :-)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>9) Successful
login!</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>10) Current
Problems:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>Upon logging in correctly
(case-sensitive user & pass),</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003></SPAN><SPAN class=531130923-26092003><FONT
size=2>This site encountered an error trying to fulfill your request. The errors
were: </DIV>
<DIV>
<DIV>
<DIV class=group><SPAN class=legend><STRONG><FONT size=1>Error
Details</FONT></STRONG></SPAN>
<DIV class=row>
<DIV class=label><STRONG>Error Type </STRONG></DIV>
<DIV class=field>sql.error</DIV></DIV>
<DIV class=row>
<DIV class=label><STRONG>Error Value </STRONG></DIV>
<DIV class=field>('42000', -104, "[Easysoft][Interbase]Dynamic SQL Error, SQL
error code = -104, Token unknown - line 2, char 28, 'key'")</DIV>
<DIV class=field> </DIV>
<DIV class=field><SPAN class=531130923-26092003>But, Upon logging in 2nd time,
all is well -- the user properties get set, and the Home Directory is
created.</SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003></SPAN> </DIV>
<DIV class=field><SPAN class=531130923-26092003>11) 'key' is present
here:</SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003><FONT
color=#800080><STRONG><SPAN class=531130923-26092003><STRONG><FONT
color=#000000>Z SQL Method </FONT></STRONG></SPAN><U>/</U></STRONG></FONT><A
href="http://lemon:8238/dev/manage_workspace"><STRONG>dev</STRONG></A><STRONG>/</STRONG><A
href="http://lemon:8238/dev/acl_users/manage_workspace"><STRONG>acl_users</STRONG></A><STRONG>/</STRONG><A
href="http://lemon:8238/dev/acl_users/mysqlPropSource/manage_workspace"><STRONG>mysqlPropSource</STRONG></A><STRONG>/</STRONG><A
class=strong-link
href="http://lemon:8238/dev/acl_users/mysqlPropSource/sqlInsertProperty/manage_workspace"><STRONG>sqlInsertProperty</STRONG></A><STRONG> </STRONG></SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003><STRONG>Arguments: key value
username temp:int</STRONG></SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003></SPAN> </DIV>
<DIV class=field><SPAN class=531130923-26092003>SQL:</SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003>INSERT INTO UserProperties
(prop_key, username, value, istemporary)<BR>VALUES(<dtml-sqlvar key
type=string>,<BR> <dtml-sqlvar
username type=string>,<BR> <dtml-sqlvar value
type=string>,<BR> <dtml-sqlvar temp
type=int>)<BR></SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003>So, something with my schema
isn't ready for this yet.</SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003>I'll post again with the
details, but I wanted to get this out there</SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003>since it seemed I wasn't the
only one hurdling over this problem of getting
exUserFolder</SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003>going!</SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003></SPAN> </DIV>
<DIV class=field><SPAN class=531130923-26092003>cheers,</SPAN></DIV>
<DIV class=field><SPAN class=531130923-26092003>jason</DIV></SPAN>
<DIV class=field><SPAN
class=531130923-26092003><STRONG> </STRONG></SPAN></DIV></DIV></DIV></DIV></DIV></FONT></SPAN>
<DIV><SPAN class=531130923-26092003></SPAN><SPAN
class=531130923-26092003></SPAN><SPAN class=531130923-26092003></SPAN><SPAN
class=531130923-26092003></SPAN><SPAN class=531130923-26092003></SPAN><SPAN
class=531130923-26092003></SPAN><SPAN class=531130923-26092003><FONT
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN> </DIV>
<P><FONT face=Verdana color=#000080 size=1>Jason LeMonier</FONT> <BR><FONT
face=Verdana color=#000080 size=1>Software Engineer</FONT> <BR><FONT
face=Verdana color=#000080 size=1>Retail Technologies International</FONT>
<BR><FONT face=Verdana color=#000080 size=1>Office
916.605.7262</FONT> <BR><FONT face=Verdana color=#000080 size=1>Mobile
415.595.0969</FONT> <BR><FONT face=Verdana color=#000080
size=1>Fax 916-914-2132</FONT> <BR><FONT
face=Verdana color=#000080 size=1>jlemonier@RetailPro.com</FONT> </P><BR>
<DIV><FONT size=2>
<DIV><SPAN class=531130923-26092003><FONT size=2>I wish programmers would
skip 85% of all theory and just paste snippets of
code!</FONT></SPAN></DIV><BR><BR><BR></FONT></DIV>
<P></P></BODY></HTML>