Re: [Zope-dev] LoginManager ownership bug!
Cheers! I actually tried to implement support for local roles in almost exactly the same way as you did, but for some reason I didn't get it to work. Perhaps I should look into the matter again... I just threw in the user_names(), and getUserNames() into the LoginManager, added some dtml to handle SQL and... it didn't work, so I dropped it... ;-) I'll try to come up with some nice way to handle local roles in a proper way in the LoginManager, and hope that I get my patches accepted :-) Do you have any clue about the ownership bug in the LoginManager? I find it quite strange that an unowned object becomes owned whenever Zope is restarted (or when a method is added...). I suspect that the problem is within the ZPatterns modules, since it handles the persistance of the LoginManager... This is how the LoginManager is inited and ownership is set: ob=LoginManager() ob._owner=UnownableOwner self._setObject('acl_users', ob) I tried to make _owner a global attribute of the LoginManager, but that didn't solve the problem. I have also written Ty Sarna, but I have not received any response yet. One more thing... I'm new to PythonMethods, and I would like to know how to get access to the self attirbute (or the DTML namespace if you like) from PythonMethods. I would like to use PythonMethods more, beacuse dtml quickly becomes unreadable and ugly, and Python is always beautiful :-) Have a nice day, .jonas. On Thu, Oct 05, 2000 at 08:11:45AM -0700, Michael Bernstein wrote: Jonas Juselius wrote: Another thing which I have tried to do, is to add support for local roles to the LoginManager. At first it looked rather simple, but then I realized that it wasn't really _that_ simple, and dropped it because I don't have time... It would however be nice to have local roles support in the LoginManager, as it would make it more complete. I am currently using Zope-2.2.1 (and Zope-2.2.2), ZPatterns-0-4-2a1 and LoginManager-0_8_7a1. I used Membership 0.7.6 on top of what you've got, and added support for local roles as detailed in this posting: http://lists.zope.org/pipermail/zope-dev/2000-September/007030.html This ought to give you the clues you need to add the neccessary getUserNames method to a SQL User Source, and make the LoginManager user_names modification as well. If you have any ideas on how to generalize the user_names method, I'd like to hear them. Let me know how it goes, Michael Bernstein. -- And what is good, Phaedrus, And what is not--- Need we ask anyone to tell us these things? [ PGP public key: http://www.iki.fi/jonas/pubkey.asc ] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Removing uninstalled Prods from ZODB?
Hola, I would like to know how to remove removed Products from the ZODB. This might sound silly, but I tried out POPMail and the PTK-0.8, then I uninstalled them and removed all the files. After I restarted Zope everything looked fine, no trace of the Products in the Control Panel Products list. However, I still have 'Advanced' tabs from the PTK in some management screens, and the POPMail has left some base classes for ZClasses. As a result of the POPMail garbage, I'm not able to add any new ZClasses to the system because: Error Type: Could not load oid Error Value: None In the debug output I find that something related to POPMail is screwing up my system... Can anybody tell me how to get rid of all this half uninstalled Products (other than exporting all my objects and re-importing them into a clean ZODB)? Perhaps an uninstall API for Products would be a good idea... something like def unititalize(context): context.unregisterClass() in __init__.py, that gets called when a Product is removed from the Product Management screens... cheers, .jonas. -- And what is good, Phaedrus, And what is not--- Need we ask anyone to tell us these things? [ PGP public key: http://www.iki.fi/jonas/pubkey.asc ] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] LoginManager ownership bug!
Hola, There seems to be a problem with the ownership model in Zope (or ZPatterns). The problem is the following: I have implemented a nice login system based on the LoginManager and SQL methods. I would like to make this acl_users the top level user folder, but... then hell brakes lose... The problem has to do with the ownership of the acl_users. When the LoginManager (acl_users) is created it sets the _owner attribute to UnownableOwner. This is fine, for if the acl_users folder is owned it results in various errors: Excessive recursion or ValueError: unpack list of wrong size (when logging in), IndexError: list index out of range (when trying to view ownership info of acl_users). This has to do with the top-level folder being unowned, it seems. There is no problem with the LoginManager being owned in a folder which is owned itself. The problem is that the acl_users folder becomes _owned_ (by whom I don't know) every time Zope is restarted, or when any method is edited or added in the acl_users folder. It seems that the _owned attribute is not persistent, or that something, somewhere changes it. I have a dirty fix for the moment, consisting of an external method which sets the ownership of acl_users to UnownableOwner. This is however a far from satisfying solution... Another thing which I have tried to do, is to add support for local roles to the LoginManager. At first it looked rather simple, but then I realized that it wasn't really _that_ simple, and dropped it because I don't have time... It would however be nice to have local roles support in the LoginManager, as it would make it more complete. I am currently using Zope-2.2.1 (and Zope-2.2.2), ZPatterns-0-4-2a1 and LoginManager-0_8_7a1. Best regards, .jonas. -- *** Jonas Juselius e-mail...: [EMAIL PROTECTED] voice: +358 9 191 40188 P.O. Box 55/ Department of Chemistry GSM..: 040 506 6599 FIN-00014 University of Helsinki fax..: +358 9 191 40169 FINLAND http://www.iki.fi/jonas Home address: Helsinginkatu 16 B 42 tel..: +358 9 753 3369 00500 Helsinki FINLAND *** [ GPG public key: http://www.iki.fi/jonas/pubkey.asc ] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )