<!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>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>Install 
exUserFolder</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <FONT size=2>How 
long?&nbsp; 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>&nbsp;&nbsp;&nbsp; <FONT size=2>Windows 2000 
Server, Plone 1.0.5</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003></SPAN><SPAN class=531130923-26092003><FONT 
size=2>Specific&nbsp;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>&nbsp;&nbsp;&nbsp; <FONT size=2>which 
connects to an Interbase&nbsp;(Borland)&nbsp;database.&nbsp; (It shouldn't 
matter what db you use.&nbsp; 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>&nbsp;</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>&nbsp;0-10-10 
was latest non-dev release.&nbsp; Extract files to Product directory.&nbsp; 
Restart Zope.</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>3) In ZMI, Inside&nbsp;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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>4) In ZMI,&nbsp;in Plone 
site&nbsp;/dev, Added "ex User Folder"</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003>&nbsp;&nbsp;&nbsp; <FONT size=2>Choose 
Sources:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Auth Source: MySql, Property 
Source: MySql, Membership Source: Basic, Group: Null</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>&nbsp;&nbsp;&nbsp;MySQL Auth: 
(follow your own database schema of course)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>&nbsp;&nbsp;&nbsp; Database 
conn: "bosdev_odbc"</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003>&nbsp;&nbsp;&nbsp; <FONT size=2>Table: 
"login_user"</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003>&nbsp;&nbsp;&nbsp; <FONT size=2>Username 
column: "login_name"</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003>&nbsp;&nbsp;&nbsp; <FONT size=2>Password: 
"webpassword"</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003>&nbsp;&nbsp;&nbsp; <FONT size=2>Roles: 
"description"&nbsp; (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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>&nbsp;&nbsp;&nbsp;Edit Basic 
Membership:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<FONT size=2>fill in site name &amp; email, checked "member" for default 
role</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>&nbsp;&nbsp; Choose Auth 
Type:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003>&nbsp;&nbsp;&nbsp; <FONT size=2>Standard 
basic auth (for form login)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003>&nbsp;&nbsp;&nbsp; <FONT size=2>Cache 
Timeout: 1800</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp; 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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>5) How to make the Auth 
Work?&nbsp; 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&nbsp;part&nbsp;wasn't 
documented (in readme or anywhere) w/ specifics</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003></SPAN>&nbsp;</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.&nbsp; </FONT></SPAN></DIV></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</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>&nbsp;&nbsp;&nbsp; <FONT size=2>There's a 
comment about what has to be done:</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>&nbsp;#<BR>&nbsp;# You can 
define this to go off and do the authentication instead of<BR>&nbsp;# using the 
basic one inside the User 
Object<BR>&nbsp;#<BR>&nbsp;remoteAuthMethod=None<BR></FONT></SPAN><SPAN 
class=531130923-26092003>&nbsp; </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?&nbsp;Because I chose 
"MySql" while setting up, that is the folder&nbsp;to modify the 
mysqlAuthSource.py.&nbsp; (it's in several directories)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>&nbsp;#<BR>&nbsp;# You can 
define this to go off and do the authentication instead of<BR>&nbsp;# using the 
basic one inside the User Object<BR>&nbsp;#<BR>&nbsp;# 
remoteAuthMethod=None<BR>&nbsp;def remoteAuthMethod (self, username, 
password):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
""" Do auth! """<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
result=self.sqlAuthUser(username=username, 
password=password)<BR>&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2># Already there 
...</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>&nbsp;def 
delSQLQueries(self):<BR>&nbsp;&nbsp;sqllist=self.objectIds('Z SQL 
Method')<BR>&nbsp;&nbsp;self.manage_delObjects(ids=sqllist)</FONT></SPAN></DIV>
<DIV><FONT size=2></FONT>&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sqlAuthUser=SQL(<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;'sqlAuthUser',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Auth 
One 
User',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.connection,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'table=%s 
username:string 
password:string'%(self.table),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_sqlAuthUser)</FONT></SPAN></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>_sqlAuthUser="""<BR>SELECT * 
FROM &lt;dtml-var table&gt;<BR>where &lt;dtml-var 
usernameColumn&gt;=&lt;dtml-sqlvar username type=string&gt;<BR>and&nbsp;&nbsp; 
&lt;dtml-var passwordColumn&gt;=&lt;dtml-sqlvar password 
type=string&gt;<BR>"""<BR></FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2>8) Fix python errors ... 
restart zope&nbsp; :-)</FONT></SPAN></DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</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 &amp; 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>&nbsp;</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>&nbsp;</DIV>
<DIV class=field><SPAN class=531130923-26092003>11) 'key' is&nbsp;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>&nbsp;</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>&nbsp;</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(&lt;dtml-sqlvar key 
type=string&gt;,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-sqlvar 
username type=string&gt;,<BR>&nbsp;&nbsp;&nbsp; &lt;dtml-sqlvar value 
type=string&gt;,<BR>&nbsp;&nbsp;&nbsp; &lt;dtml-sqlvar temp 
type=int&gt;)<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&nbsp;hurdling over&nbsp;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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531130923-26092003><FONT size=2></FONT></SPAN>&nbsp;</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&nbsp;&nbsp; 
916.605.7262</FONT> <BR><FONT face=Verdana color=#000080 size=1>Mobile&nbsp; 
415.595.0969</FONT> <BR><FONT face=Verdana color=#000080 
size=1>Fax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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&nbsp;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>