[Zope-CMF] Read-only FileStorage and CMF

Tres Seaver tseaver@zope.com
04 Mar 2003 09:48:25 -0500


On Tue, 2003-03-04 at 09:44, Bert Vanderbauwhede wrote:
> On Tue, 4 Mar 2003, Jens Vagelpohl wrote:
> 
> > the CMF will try to save the time a user logs in to keep track of the
> > last time you log in. you cannot do that with a read-only ZODB unless
> > you find and eliminate the code that tries to save the login time.
> 
> Any idea where I can find this code? The traceback I get for this error
> is:
> 
> Traceback (innermost last):
>   File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 102, in publish
>   File /usr/local/zope/lib/python/Zope/__init__.py, line 173, in commit
>   File /usr/local/zope/lib/python/ZODB/Transaction.py, line 234, in commit
>   File /usr/local/zope/lib/python/ZODB/Connection.py, line 348, in commit
>     (Info: (('Products.CMFLDAP.LDAPMemberDataTool', 'LDAPMemberData'), '\x00\x00\x00\x00\x00\x02\xf5\xc8', ''))
>   File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 641, in store
>     (Object: /usr/local/zope/var/Data.fs)
> ReadOnlyError
> 
> I modified LDAPMemberData (in LDAPMemberDataTool.py) and MemberData (in
> MemberDataTool.py), by wrapping the methods in try-except clauses, but I
> still got the error.

You should be able to customize the 'logged_in' template
(CMFDefault/skins/generic/logged_in.dtml or ../zpt_generic/logged_in.pt)
to remove the calls t 'member.setProperty'.

An alternative would be to tweak 'setProperty' so that it wrote back to
your LDAP server.  I'm not brave enough to try that, however :).

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com