RE: [Zope] Getting an authenticated user out of context
From: Dieter Maurer I do not have much hope for your wish....
Thanks Dieter! :) I was beginning to wonder which of the two typical newbie problems I was facing, i.e. 'trying to do an easy thing the wrong way' vs 'trying to do the wrong thing an easy way'. Probably the latter. So, maybe my best bet is to replace my top level acl_users with an ExUserFolder version... That also avoids confusion as to which user someone is currently logged in as.
"Crosbie Fitch" <crosbie@cyberspaceengineers.org> wrote in message news:000801c2d6a5$f35e32e0>
So, maybe my best bet is to replace my top level acl_users with an ExUserFolder version...
Noo! Too late I read in the ExUserFolder docs that this is a bad idea. Plenty of wierd behaviour and recursive acl_users/acl_users/acl_users/acl_users/acl_users.... stuff :-( Plenty of times I had to use the emergency user, and even then it was touch and go. Felt it best to start from scratch on a fresh Zope install. I'll just have to put up with not being able to display content based on current user at the root level (given one can't safely access lower level acl_users info from a higher level).
----- Original Message ----- From: "Crosbie Fitch" <crosbie@cyberspaceengineers.org>
I'll just have to put up with not being able to display content based on current user at the root level (given one can't safely access lower level acl_users info from a higher level).
I have to say that I do not really understand the problem. If the user is known then he/she/it is authenticated at toplevel ROOT (in the ROOT.acl_users folder) - a pre-requisite for showing content based on the current user. If so, then he/she/it is also authenticated at sublevel B (in the ROOT.B folder). You do not need to create the user in the ROOT.B.acl_users folder. Thus the user is known at the root level, and is also known _and_ authenticated at any lower level. Or have I totally misunderstood what you are trying to do? /dario
"Dario Lopez-Kästen" wrote in message news:00ab01c2d984$904533c0
I have to say that I do not really understand the problem.
If the user is known then he/she/it is authenticated at toplevel ROOT (in the ROOT.acl_users folder) - a pre-requisite for showing content based on the current user.
If so, then he/she/it is also authenticated at sublevel B (in the ROOT.B folder). You do not need to create the user in the ROOT.B.acl_users folder.
Thus the user is known at the root level, and is also known _and_ authenticated at any lower level.
Or have I totally misunderstood what you are trying to do?
Thanks Dario. :-) 1) I want to use ExUserFolder (my users are in an SQL database). 2) I'd like to be able to display user dependent info in root level pages 3) Received wisdom (and a bad experience) indicates that ExUserFolder should not be at root level 4) If ExUserFolder's acl_users can't be put at the root, then how does /index_html interrogate /subfolder/acl_users as to the current user? At the moment I've conceded defeat and have resigned myself to not being able to display user dependent info in root level pages. And I don't like the idea of an instant redirect. Though I suspect that it may be possible to use VHM to achieve the same effect more transparently.
On Friday 21 February 2003 10:22 am, Crosbie Fitch wrote:
3) Received wisdom (and a bad experience) indicates that ExUserFolder should not be at root level
There are bugs in exUserFolder that affect its use in the root folder. This patch fixes them for me: http://sourceforge.net/tracker/index.php?func=detail&aid=690599&group_id=363... The received wisdom (in the XUF FAQ) is based around the idea that a bug or interface change could break XUF and lock you out of the root folder until the bug is fixed. I think that is bogus: if you put XUF and all your data in a sub-folder, then the same bug would lock you out of that sub folder. What good does it do you to be able to access the root folder (but not the subfolder) when there is no data there? -- Toby Dickenson http://www.geminidataloggers.com/people/tdickenson
"Toby Dickenson" wrote in message news:200302211044.53428.tdickenson@geminidataloggers.com...
There are bugs in exUserFolder that affect its use in the root folder. This patch fixes them for me:
http://sourceforge.net/tracker/index.php?func=detail&aid=690599&group_id=363 18&atid=416448 Thanks Toby. Presumably this is something I can apply to a Zope install with cvs diff ? Let me know if I have to use some other Python specific diff utility.
On Friday 21 February 2003 11:08 am, Crosbie Fitch wrote:
Presumably this is something I can apply to a Zope install with cvs diff ? Let me know if I have to use some other Python specific diff utility.
You can apply it using a standard 'patch' tool. CVS uses that tool internally. cd exUserFolder patch -p1 exuserfolder-10-10-root.diff (-p1 because you are stripping 1 level of directories from the filenames in my patch file) If you cant get that to work, then I guess it is small emough to apply by hand. -- Toby Dickenson http://www.geminidataloggers.com/people/tdickenson
"Toby Dickenson" <tdickenson@geminidataloggers.com> wrote in message news:200302211139.41391.tdickenson@geminidataloggers.com...
You can apply it using a standard 'patch' tool. CVS uses that tool
internally.
cd exUserFolder patch -p1 exuserfolder-10-10-root.diff
You learn a new command every day! Successfully applied (patch -p1 exuserfolder.py exuserfolder-10-10-root.diff). I now have two sites, and two ways forward. 1) one site with root level XUF (patched), and 2) one site with sublevel XUF (with VHM as an option to make it appear root level). Decisions, decisions... Ta.
Does anyone knows where can I import that file (zpt-examples.zexp) from? Thanks, Leonardo
From: "Crosbie Fitch" <crosbie@cyberspaceengineers.org>
I now have two sites, and two ways forward. 1) one site with root level XUF (patched), and 2) one site with sublevel XUF (with VHM as an option to make it appear root level).
Decisions, decisions...
Ta.
I'd go with decision 2. It will make it easier to use Apache/Pound/Squid in front of Zope. There's also the possiblity of using the same zope to host more than 1 app/site, as well as (nb: these are theories, I haven't tried them myself) opeings to storing data of your site outside the site itself, making objects available to your site w/o them being accesible TTW, etc... /dario
1) I want to use ExUserFolder (my users are in an SQL database). 2) I'd like to be able to display user dependent info in root level pages 3) Received wisdom (and a bad experience) indicates that ExUserFolder should not be at root level 4) If ExUserFolder's acl_users can't be put at the root, then how does /index_html interrogate /subfolder/acl_users as to the current user?
At the moment I've conceded defeat and have resigned myself to not being able to display user dependent info in root level pages. And I don't like the idea of an instant redirect. Though I suspect that it may be possible
to
use VHM to achieve the same effect more transparently.
ok, i see. The solution is to change the root of *what zope serves to the world* to be something else than the root of Zope itself, using VHM or a SiteRoot (I believe VHM is the recommended wya of doing things nowadays). For instance: / /acl_users (root level, only 2-3 people here, manager, owner, etc) /my_site /my_site/acl_users (exUserFolder or other with all your users) You have placed all of your content inside the "my_site" folder. Use a VHM or SiteRoot to make sure that when your users go to http://your-server/ the contents is served from /my_site. Search Zope.org and the archives to find more info on how to do this. The argument that Toby raises about being locked out is valid, however it might be less painfull to be locked out from a specific folder (you do have backups, yes?) than from Zope itself. Hth, /dario - -------------------------------------------------------------------- Dario Lopez-Kästen, IT Systems & Services Chalmers University of Tech.
"Dario Lopez-Kästen" <dario@ita.chalmers.se> wrote in message news:013b01c2d99e$419b1d60$4bdf1081@WALTER...
You have placed all of your content inside the "my_site" folder. Use a VHM or SiteRoot to make sure that when your users go to http://your-server/ the contents is served from /my_site. Search Zope.org and the archives to find more info on how to do this.
Ok, thanks for perfectly understanding my issue and confirming my suspicion that VHM is a valid solution. I'll check it out.
The argument that Toby raises about being locked out is valid, however it might be less painfull to be locked out from a specific folder (you do have backups, yes?) than from Zope itself.
Hmm. Must remember to do a search on 'backing up zope'.... ;-)
participants (4)
-
Crosbie Fitch -
Dario Lopez-Kästen -
Leonardo Fernandes -
Toby Dickenson