Hi, In exUserFolder there are few exceptions raised like this: raise 'LoginRequired', self.docLogin(self, request) This will not working in Zope 2.12 (Python 2.6) Any idea, how to change it ? Regards, Baiju M
+-------[ Baiju M ]---------------------- | Hi, | In exUserFolder there are few exceptions raised like this: | | raise 'LoginRequired', self.docLogin(self, request) | | This will not working in Zope 2.12 (Python 2.6) | | Any idea, how to change it ? Replace the raise with; request.RESPONSE.setStatus(401) request.RESPONSE.setHeader('Content-Type','text/html') request.RESPONSE.write(self.docLogin(self,request)) -- Andrew Milton akm@theinternet.com.au
On Thu, Dec 17, 2009 at 10:18 PM, Andrew Milton <akm@theinternet.com.au> wrote:
+-------[ Baiju M ]---------------------- | Hi, | In exUserFolder there are few exceptions raised like this: | | raise 'LoginRequired', self.docLogin(self, request) | | This will not working in Zope 2.12 (Python 2.6) | | Any idea, how to change it ?
Replace the raise with;
request.RESPONSE.setStatus(401) request.RESPONSE.setHeader('Content-Type','text/html') request.RESPONSE.write(self.docLogin(self,request))
Thank you very much, this works ! Regards, Baiju M
On Thursday 17 December 2009, Andrew Milton wrote:
+-------[ Baiju M ]----------------------
| Hi, | In exUserFolder there are few exceptions raised like this: | | raise 'LoginRequired', self.docLogin(self, request) | | This will not working in Zope 2.12 (Python 2.6) | | Any idea, how to change it ?
Replace the raise with;
request.RESPONSE.setStatus(401) request.RESPONSE.setHeader('Content-Type','text/html') request.RESPONSE.write(self.docLogin(self,request))
I just tried that and it works in Firefox, Chrome and Opera but it is failing in IE and Konqueror. I tried a few versions of each of these browsers and the results are consistent. I don't see why it is failing though. I tried exactly what is up there along with also trying self.docLoginRedirect instead of docLogin. I used wireshark to watch the connection and I don't see anything wrong with it. GET /XXXXXX/manage HTTP/1.1 Host: XXXX.XXXXXX.com Connection: Keep-Alive User-Agent: Mozilla/5.0 (compatible; Konqueror/4.3; Linux) KHTML/4.3.4 (like Gecko) Pragma: no-cache Cache-control: no-cache Accept: text/html, image/jpeg;q=0.9, image/png;q=0.9, text/*;q=0.9, image/*;q=0.9, */*;q=0.8 Accept-Encoding: x-gzip, x-deflate, gzip, deflate Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5 Accept-Language: en-US, en Cookie: tree-s="XXXXXXXXXXXXXXx"; __utma=XXXXXX.XXXXXX.XXXXXXXXX.XXXXXXXX.XXXXX.XXX; _ZopeId="XXXXX" HTTP/1.1 401 Unauthorized Date: Sat, 02 Jan 2010 05:31:47 GMT Server: Zope/(2.12.1, python 2.6.4, linux2) ZServer/1.1 Content-Type: text/html Via: 1.1 XXX.XXXX.com Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Transfer-Encoding: chunked 386 <HTML> <HEAD> <TITLE>Logging In</TITLE> <META HTTP-EQUIV=Expires CONTENT="2009-12-31"> <META HTTP-EQUIV=Refresh CONTENT="0; URL=http://XXX.XXXXX.com/XXXXX/acl_users/redirectToLogin?destination=http://XXXX.XXXXX.com/XXXX/manage"> </HEAD> <BODY> <!-- This is here to stop IE's default 512 byte limit from kicking in and showing us "Friendly" error pages. The Unenlightened Zopistas Guide to exUserFolder. (C) 2001-2003 Andrew Milton <akm@theinternet.com.au> 0. INTRODUCTION. exUserFolder is an extensible authentication product for the Zope Application Server. It allows a user to choose from a number of methods of authenticating their users, and allows the setting and fetching of arbitrary properties on a User object. Authentication methods, and Property methods do not have to use the same backing store, so it is possible to use legacy user sources, and --> </BODY></HTML> 0 If I go to the page that the Refresh refers to in any of the browers that works fine. The raise form works fine on older versions of zope with no issues on any of these browers. Konqueror and IE will both have their icons spinning on that page like they are waiting for something. Any ideas or help would be appreciated. I have tried lots of things to get it working.
+-------[ William Heymann ]---------------------- | | On Thursday 17 December 2009, Andrew Milton wrote: | > +-------[ Baiju M ]---------------------- | > | > | Hi, | > | In exUserFolder there are few exceptions raised like this: | > | | > | raise 'LoginRequired', self.docLogin(self, request) | > | | > | This will not working in Zope 2.12 (Python 2.6) | > | | > | Any idea, how to change it ? | > | > Replace the raise with; | > | > request.RESPONSE.setStatus(401) | > request.RESPONSE.setHeader('Content-Type','text/html') | > request.RESPONSE.write(self.docLogin(self,request)) | > | | I just tried that and it works in Firefox, Chrome and Opera but it is failing | in IE and Konqueror. I tried a few versions of each of these browsers and | the results are consistent. I don't see why it is failing though. | | I tried exactly what is up there along with also trying self.docLoginRedirect | instead of docLogin. I used wireshark to watch the connection and I don't see | anything wrong with it. [SNIP] | | If I go to the page that the Refresh refers to in any of the browers that | works fine. The raise form works fine on older versions of zope with no issues | on any of these browers. Konqueror and IE will both have their icons spinning | on that page like they are waiting for something. | | Any ideas or help would be appreciated. I have tried lots of things to get | it working. Try adding more padding ... IE (not sure about Konq) has this annoying habit of giving you a "nice" page instead of the one we want... it used to be if the page was < 512 bytes it would give you its own page... I'll try to look into it over the weekend... -- Andrew Milton akm@theinternet.com.au
+-------[ Andrew Milton ]---------------------- | +-------[ William Heymann ]---------------------- | | | | On Thursday 17 December 2009, Andrew Milton wrote: | | > +-------[ Baiju M ]---------------------- | | > | | > | Hi, | | > | In exUserFolder there are few exceptions raised like this: | | > | | | > | raise 'LoginRequired', self.docLogin(self, request) | | > | | | > | This will not working in Zope 2.12 (Python 2.6) | | > | | | > | Any idea, how to change it ? | | > | | > Replace the raise with; | | > | | > request.RESPONSE.setStatus(401) | | > request.RESPONSE.setHeader('Content-Type','text/html') | | > request.RESPONSE.write(self.docLogin(self,request)) | | > | | | | I just tried that and it works in Firefox, Chrome and Opera but it is failing | | in IE and Konqueror. I tried a few versions of each of these browsers and | | the results are consistent. I don't see why it is failing though. | | | | I tried exactly what is up there along with also trying self.docLoginRedirect | | instead of docLogin. I used wireshark to watch the connection and I don't see | | anything wrong with it. | | [SNIP] | | | | | If I go to the page that the Refresh refers to in any of the browers that | | works fine. The raise form works fine on older versions of zope with no issues | | on any of these browers. Konqueror and IE will both have their icons spinning | | on that page like they are waiting for something. | | | | Any ideas or help would be appreciated. I have tried lots of things to get | | it working. | | Try adding more padding ... | | IE (not sure about Konq) has this annoying habit of giving you a "nice" | page instead of the one we want... it used to be if the page was < 512 | bytes it would give you its own page... | | I'll try to look into it over the weekend... I have 2.10 not 2.12, but for FF, Shiretoko (64 bit FF 3.5.5), IE7/IE8 (32 and 64 bit), Safari (4.0.4) all work fine with this method. Konquerer does seem to have an issue, but, I don't know enough about Konquerer to work out what to try. -- Andrew Milton akm@theinternet.com.au
On Sat, Jan 2, 2010 at 11:12 AM, William Heymann <kosh@aesaeion.com> wrote:
On Thursday 17 December 2009, Andrew Milton wrote:
+-------[ Baiju M ]----------------------
| Hi, | In exUserFolder there are few exceptions raised like this: | | raise 'LoginRequired', self.docLogin(self, request) | | This will not working in Zope 2.12 (Python 2.6) | | Any idea, how to change it ?
Replace the raise with;
request.RESPONSE.setStatus(401) request.RESPONSE.setHeader('Content-Type','text/html') request.RESPONSE.write(self.docLogin(self,request))
I just tried that and it works in Firefox, Chrome and Opera but it is failing in IE and Konqueror. I tried a few versions of each of these browsers and the results are consistent. I don't see why it is failing though.
I tried exactly what is up there along with also trying self.docLoginRedirect instead of docLogin. I used wireshark to watch the connection and I don't see anything wrong with it.
FYI, the solution suggested by Andrew worked for us in IE & FF. Regards, Baiju M
participants (3)
-
Andrew Milton -
Baiju M -
William Heymann