[Zope-dev] logout and IE6 problems

2002-06-03 Thread Aseem Mohanty

Hi All,

Pardon the cross post, since I dont know where exactly my problems lie...

I am running Zope 2.5.0 (binary release, python 2.1, win32-x86), python 
2.1.2, win32 on a Win2k machine with a MySQL server. I just wrote my 
first UserFolder based on the mysqlUserFolder product, but with some 
customized stuff to suit my needs. I basically did not use 
mysqlUserFolder's session and cookie management and instead, am using 
ZSession for session management.

Finally after several days work I have everything running, barring two 
problems, one doesnt matter much, the other is a gift of the evil empire 
which I havent figured out as yet.

The first problem: For logout purposes I used the function that handles 
the logout in ZMI and call it from a form; the function is as follows:

def user_logout (Self, REQUEST,RESPONSE):
""" Terminates user session """
user = Self.check_valid_mysql_user (REQUEST)
Self.__terminate_session(REQUEST)
realm=RESPONSE.realm
RESPONSE.expireCookie('__ac',path='/')
RESPONSE.expireCookie('_ZSession',path='/')
RESPONSE.setStatus(401)
RESPONSE.setHeader('WWW-Authenticate', 'basic realm="%s"' %
realm, 1)
RESPONSE.setBody("""
http://:8080/test_folder/logged_out";>
Logout
You have been logged out.
""")
return

It basically does the job beutifully and I have no problems. What I 
would like to do however is to be able log back in when prompted for a 
login and password as a result of this call. I tested the ZMI interface 
and it does the same too : once you log-out you have to cancel the 
prompt box and then try and access a protected resource to get logged 
back in. I tested the control flow and as a matter of fact when I enter 
the right username/password combo it goes through 'validate' and 
authenticates it all right but just doesn't accept it and sends another 
401. Any ideas as to hwo to get around that would be great!!

The second problem: All of the above works nicely with all versions of 
Netscape. On IE versions 5.01 and above however, it behaves 
exceptionally badly. In that I can login and a nice little session 
variable is created, and the cookies are set up, and when I log out, the 
sessions are cleared and cookies thrown out and I get prompted to log in 
which if I cancel, I get booted to the logged out page. All nice and clean.

However if I press the back button or type in the URL of a protected 
resource it sends the authentication information back and I am not 
prompted to log back in. On looking at the session and cookie info, I 
found that a new one had been created with the same auth information.

"It just ignored the HTTP 401 !!!"

Now I dont know if that is a bug in IE ( I am inclined to believe it 
is!! ), but I have tested my package pretty exhaustively and it works 
without fail in all NS and upto IE 5.0. If anybody has encountered the 
problem before and has figured out how to deal with it 'without' closing 
all IE windows, I would be immensely grateful if s/he could pass on the 
information.

Thanks for you collective patience.
Aseem


==
 Aseem Mohanty  
== 
 
 "I saw `cout' being shifted "Hello world" times to the left and  
  stopped right there!!"-- Steve Gonedes  
== 




___
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] Medusa - Apache - Squid

2002-06-03 Thread buelent aldemir

I often read that for "security reasons" one should use Apache or Squid
in front of Zope.

So simple question: why? Isn`t the Medusa Webserver secure that all?

And why does zope.org uses Apache? I would like to understand the reasons
behind this decision. I thought it was for loadbalancing only - but now 
there is ZEO - so why using Apache or Squid?

Buelent


___
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 )



Re: [Zope-dev] fsrecovery in Zope 2.4 ?

2002-06-03 Thread Julián Muñoz

Merci, Florent.



On Mon, 3 Jun 2002, Florent Guillaume wrote:

> Julián Muñoz  <[EMAIL PROTECTED]> wrote:
> > In Zope 2.5 CHANGES.txt is said
> >
> > "Provided a much more robust tool for recovering data from
> > damaged FileStorage files"
> >
> > I would like to know what tool it is.
> > Is it lib/python/ZODB/fsrecovery.py ??
>
> Yes, fsrecover.py
>
> > As I can't upgrade to Zope 2.5 now, I would like to know if it is possible
> > to install and use this tool on Zope 2.4, because the gain in case of a
> > catastrophe seem very interesting.
>
> I don't know. If it imports ok is should be fine I guess.
>
> Florent
>
>

-- 

  __o
_ \<_
   (_)/(_)

Saludos de Julián
EA4ACL
-.-

Foro Wireless Madrid
http://opennetworks.rg3.net



___
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 )



Re: [Zope-dev] Refresh makes all imported modules = None

2002-06-03 Thread Florent Guillaume

Shane Hathaway  <[EMAIL PROTECTED]> wrote:
> William Trenker wrote:
> > Lennart Regebro wrote:
> > 
> >> Suddenly when I refresh products it seems that all imported modules in 
> >> the refreshed product are set to None, because after a refresh, 
> >> anything I try to do always ends up with an error message like "None 
> >> has no attribute foobar" or "None is not callable",
> > 
> > 
> > I get this problem too (specifically, "None is not callable").  I've had 
> > to solve it by brute force -- shutting down Zope and restarting.  (Zope 
> > 2.5.1 (binary release, python 2.1, win32-x86), python 2.1.3, win32)  
> > After the restart, the product works fine.
> 
> This happens when you create references to the product outside the 
> product.  Most Zope products don't need to.  Those that do (like 
> CallProfiler and other monkey patch products) should not be considered 
> refreshable.

It happens to me also. I have a product who uses as a base class
something defined in another product. When I refresh the second product,
I have to refresh the first one afterwards.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:[EMAIL PROTECTED]


___
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 )



Re: [Zope-dev] fsrecovery in Zope 2.4 ?

2002-06-03 Thread Florent Guillaume

Julián Muñoz  <[EMAIL PROTECTED]> wrote:
> In Zope 2.5 CHANGES.txt is said
> 
> "Provided a much more robust tool for recovering data from
> damaged FileStorage files"
> 
> I would like to know what tool it is.
> Is it lib/python/ZODB/fsrecovery.py ??

Yes, fsrecover.py

> As I can't upgrade to Zope 2.5 now, I would like to know if it is possible
> to install and use this tool on Zope 2.4, because the gain in case of a
> catastrophe seem very interesting.

I don't know. If it imports ok is should be fine I guess.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:[EMAIL PROTECTED]


___
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 )



Re: [Zope-dev] Refresh makes all imported modules = None

2002-06-03 Thread Shane Hathaway

William Trenker wrote:
> At 09:36 AM 6/3/02 -0400, Shane Hathaway wrote:
> 
>> Are you working with products that use the old style [of product 
>> initialization]?  Are they still around? ;-)
> 
> 
> I'm developing a Zope Database Adapter (DA) for the SQLite 
> (http://www.hwaci.com/sw/sqlite) embedded database.  Although a DA isn't 
> a Product in the usual sense, the front-end is registered like a product 
> and has a Management interface.
> 
> I've noticed that existing DA's that I'm studying for reference, 
> including DCOracle2, don't use the "new" method of Product 
> initialization / registration.  Are DA's considered "monkey patch" 
> products?  Is it possible to use the Refresh feature during development 
> of a DA?

Ah, good point.  I don't know whether it's possible.  You probably 
shouldn't maintain an open connection to the database durng refresh.

Shane



___
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 )



Re: [Zope-dev] Refresh makes all imported modules = None

2002-06-03 Thread William Trenker

At 09:36 AM 6/3/02 -0400, Shane Hathaway wrote:
>Are you working with products that use the old style [of product 
>initialization]?  Are they still around? ;-)

I'm developing a Zope Database Adapter (DA) for the SQLite 
(http://www.hwaci.com/sw/sqlite) embedded database.  Although a DA isn't a 
Product in the usual sense, the front-end is registered like a product and 
has a Management interface.

I've noticed that existing DA's that I'm studying for reference, including 
DCOracle2, don't use the "new" method of Product initialization / 
registration.  Are DA's considered "monkey patch" products?  Is it possible 
to use the Refresh feature during development of a DA?

Thanks,
Bill
http://pysqlite.sourceforge.net



--
"The commandments of the LORD are right, bringing joy to the heart. The 
commands of the LORD are clear, giving insight to life . . . For this is 
the love of God, that we keep His commandments. And His commandments are 
not burdensome." (Psalm 19:8, 1John 
5:3)torahteacher.com



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.363 / Virus Database: 201 - Release Date: 5/21/02



[Zope-dev] [Zope] Security and external methods

2002-06-03 Thread Thierry Florac


  Hi...

I have a question with a security related problem.
I've written a script to produce PDF output from any HTML output, as
described in http://www.zope.org/Members/mjablonski/howtoPDF

My problem is that with this simple script, I can get access to
protected pages without giving any authentication... Is it normal, and
how could I avoid this ??

Thanks for any help or advise...

  Thierry


P.S. : I didn't subscribe to this list, but send this message to it
because I thought it was the best one for this. So please reply to me as
well as to the list...




___
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 )



Re: [Zope-dev] Dynamically add an external method at startup

2002-06-03 Thread Emile van Sebille

Emile van Sebille
> Thanks Philipp.  That answers one of the questions.  Can you tell me
how
> to acquire a reference to a folder given that I've got my hands on
> context and can import Zope, etc?
>
I found a post in the archives from Martijn Pieters that put me on the
right track so I've got something that works for me:

from Products.ExternalMethod.ExternalMethod import ExternalMethod

def addExternalMethod(self, id, title, module, function, REQUEST=None):
"""Add an external method to a folder"""
id=str(id)
title=str(title)
module=str(module)
function=str(function)
i=ExternalMethod(id,title,module,function)
self._setObject(id,i)

def initialize(context):
"""Initialize"""
addExternalMethod(context._ProductContext__app, "id", "title",
"module", "func")

--

Emile van Sebille
[EMAIL PROTECTED]

-



___
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 )



Re: [Zope-dev] Dynamically add an external method at startup

2002-06-03 Thread Emile van Sebille

Philipp von Weitershausen
> Emile van Sebille
> > def addExternalMethod(self, id, title, module, function,
REQUEST=None):
> > """Add an external method to a folder"""
> > id=str(id)
> > title=str(title)
> > module=str(module)
> > function=str(function)
> > i=ExternalMethod(id,title,module,function)
> > #self._setObject(id,i)
>
> > I don't get errors at start up, and of course my "product" isn't
> > registered, but can anyone tell me what self wants to be in
> > addExternalMethod and how I could get there from
initialize(context)?
>
> self wants to be the folder where you want to add the ExternalMethod.
> ObjectManagers, thus also Folders, have a method _setObject that allow
> you to add objects to them.
>

Thanks Philipp.  That answers one of the questions.  Can you tell me how
to acquire a reference to a folder given that I've got my hands on
context and can import Zope, etc?

Again, thanks for your help.

--

Emile van Sebille
[EMAIL PROTECTED]

-



___
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 )



Re: [Zope-dev] Dynamically add an external method at startup

2002-06-03 Thread Philipp von Weitershausen

Hi,

> def addExternalMethod(self, id, title, module, function, REQUEST=None):
> """Add an external method to a folder"""
> id=str(id)
> title=str(title)
> module=str(module)
> function=str(function)
> i=ExternalMethod(id,title,module,function)
> #self._setObject(id,i)

> I don't get errors at start up, and of course my "product" isn't
> registered, but can anyone tell me what self wants to be in
> addExternalMethod and how I could get there from initialize(context)?

self wants to be the folder where you want to add the ExternalMethod. 
ObjectManagers, thus also Folders, have a method _setObject that allow 
you to add objects to them.

Phil



___
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 )



Re: [Zope-dev] Refresh makes all imported modules = None

2002-06-03 Thread Shane Hathaway

William Trenker wrote:
> Lennart Regebro wrote:
> 
>> Suddenly when I refresh products it seems that all imported modules in 
>> the refreshed product are set to None, because after a refresh, 
>> anything I try to do always ends up with an error message like "None 
>> has no attribute foobar" or "None is not callable",
> 
> 
> I get this problem too (specifically, "None is not callable").  I've had 
> to solve it by brute force -- shutting down Zope and restarting.  (Zope 
> 2.5.1 (binary release, python 2.1, win32-x86), python 2.1.3, win32)  
> After the restart, the product works fine.

This happens when you create references to the product outside the 
product.  Most Zope products don't need to.  Those that do (like 
CallProfiler and other monkey patch products) should not be considered 
refreshable.

> I have searched the documentation and zope.org but am having trouble 
> finding the requirements for using Refresh (other than I know that the 
> product directory has to have a refresh.txt file in it).
> 
> Is it required that the product use the "new" method of product 
> initialization, i.e.:
> def initialize(context):
> context.registerClass(

Are you working with products that use the old style?  Are they still 
around? ;-)

Shane



___
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 )



Re: [Zope-dev] Zope 3 Installation

2002-06-03 Thread Steve Alexander

Eddie Moench wrote:
> Can someone tell me, how to get the Zope 3 (from the CVS) up and
> running?
> 
> After correcting the verify-import (there was a case-problem), I get the
> error message "cannot import name Interface" by the command "from
> Interface import Interface" - which is called by many scripts. Does
> anyone had the same problem and knows a solution?

Please describe exactly the steps you took, starting with the command 
you used to check out Zope 3 from CVS.


If you want in-person advice, there are people on the #zope irc channel 
who have successfully installed Zope 3 from CVS.

--
Steve Alexander



___
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 )



Re: [Zope-dev] Zope 3 Installation

2002-06-03 Thread R. David Murray

On Mon, 3 Jun 2002, Eddie Moench wrote:
> After correcting the verify-import (there was a case-problem), I get the
> error message "cannot import name Interface" by the command "from
> Interface import Interface" - which is called by many scripts. Does
> anyone had the same problem and knows a solution?

Do you have the 'lib/python' subdirectory of your Z3 checkout
set in your shell PYTHONPATH variable?  Interface is there, so
it sounds like you don't, and you won't get very far starting
zope3 unless you do .

--RDM



___
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] Zope 3 Installation

2002-06-03 Thread Eddie Moench

Can someone tell me, how to get the Zope 3 (from the CVS) up and
running?

After correcting the verify-import (there was a case-problem), I get the
error message "cannot import name Interface" by the command "from
Interface import Interface" - which is called by many scripts. Does
anyone had the same problem and knows a solution?

Thanks,

Eddie.


 
 
Eddie Mönch
Pre-Sales Consulting &
Software Development
[EMAIL PROTECTED]

ontoprise GmbH
phone: +49 721 - 665 79 - 13, fax: +49 721 - 665 79 - 11
Haid-und-Neu-Str. 7, D-76131 Karlsruhe, Germany
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 




___
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 )