Re: [Zope] Two mysql / timestamp related fixes

2007-03-12 Thread Gaute Amundsen
On Friday 09 March 2007 16:22, Tino Wildenhain wrote:
> Gaute Amundsen schrieb:
> > On Friday 09 March 2007 09:40, Tino Wildenhain wrote:
> >> Gaute Amundsen schrieb:
> >>> On Thursday 08 March 2007 17:27, Tino Wildenhain wrote:
>  Gaute Amundsen schrieb:
> > Hi.
> >>>
> >>> 
> >>>
> > 1 )
> > First I got a ValueError 'query' when using a very simple zsql
> > method. (consisting of only "")
> 
>  Thats a very bad idea. Better make zsql methods
>  for every query
> >>>
> >>> I know the orthodoxy :-/
> >>> I'd rather have a proper DB library, (or model layer, if you will)
> >>> and build my SQL in python.
> >>
> >> So you want to use SQLAlchemy? Feel free to write a product
> >> as wrapper :-)
> >
> > Hm.. have never quite gotten around  to writing my first product.
> > Looks like a very nice candidate, but no promises :)
> >
> >>> To build anything complex or generalized in dtml is a PAIN.
> >>
> >> Is it? Can you come up with examples?
> >
> > tabell:string
> > felter:list
> > INSERT INTO  SET
> > 
> >   
> > ,
> >  =
> > 
> >   
> > 
> >   
> > 
> >   
> > 
> >   
> > 
> > 
> > SELECT LAST_INSERT_ID()
> >
> > and that is not _really_ complex is it?
>
> Well, it looks a bit silly - I mean you make
> a hand-written ORM? This would be the time to
> either write a real ORM as product or try
> some of the available: ZPatterns, Archetypes, ...
>
Hm.. not intentionally :-/
Have heard about them of course, but not yet had a project that could defend 
trying them out properly.
I whish there where some way in the zope commulity to get a feeling for what 
people are actually using, and what has some momentum... but that is another 
thread, I guess.

btw. I found this rather good.
http://blogs.nuxeo.com/sections/blogs/florent_guillaume/2005_08_11_object_relational
But no clear conclusion there either.

> Usual database interacting zope solutions
> have only a handful insert places where you
> need bulk inserts. And even then you can just
> call one ZSQL method (per table) in a loop
> to insert your values from a list.
>
> More, sql_quote does not really work
> for tablenames or column names - it
> may work by accident for MySQL though,
> but not for standards compliant databases.
>
> > There's the whole sqlgroup thing.
>
> Well to be honest I never used it ;)
>
> > dtml is after all depreciated, so I can see no reason to learn it as
> > torougly as ZSQLMethods obviously requires when I can use python instead.
>
> You always can but what do you gain? How does your python script
> code look like for the above problem?
>
Not found a way to work around the sql_delimiter problem yet, so it's not 
really done.. but I think you will agree that its is more readable anyway.

def insert(tabell,felter):
sql  = "INSERT INTO %s SET " % ( sql_quote(tabell) )
cols = []
for key, val in felter.items():
if same_type(val, ' '):
val = "'%s'" % val
cols.append("%s = %s" % (key, val))

sql += ", ".join(cols)
sql += '; SELECT LAST_INSERT_ID();'
return wrapper( sql=sql )


> >>> And a sea of too specific templates is even worse.
> >>
> >> Well from some level of complexity you could also use
> >> database functions. But if its so complex, why using
> >> MySQL?
> >
> > Don't see quite what you mean here, but it would be just the same
> > problems with PGsql.
>
> Not direct related but if you have complex queries,
> e.g. join over many tables, partial indexes, subqueries, ...
> it may be a bit hard to get reliable performance with MySQL.
> I think it was related to different views at the word "complex
> queries"
>
>  instead of
>  rebuilding your own (obviously not working)
>  templating for SQL.
> >>>
> >>> I's not a template, it's a wrapper to get around the whole mess.
> >>> A hack in fact ;)
> >>>
> >>> If a template this simple "" is "obviously not working"
> >>> then it is ZSQLMethods that have a problem, not me.
> >>
> >> No, the content of your variable sql is wrong :-)
> >>  would indeed work if it contains valid sql
> >> code.
> >
> > It did not.
> > That was the whole point of this mail.
> >
> > The method was "" and the sql was "select * from foo"
> > care to spot the invalid code in that?
>
> wait... your variable really is named "sql"? Maybe that is
> the problem. I did not verify this but it could be. DTML
> is sometimes weird ;)
>
So what you are saying is that you have a mysql table with a column of type 
timestamp, and experienced no problems?

> >>> (it's working fine now.)
> >>>
>  Quoting is done automatically
>  when you use 
> >>>
> >>> I can use sql_quote when I need to, thankyou.
> >>
> >> this does not need to work identical - but current
> >> adaptors indeed do their handmade quoting.
> >>
> >>> The only thing that I worry about is transaction support.
> >>> "insert foo; select last_inserted" works when built inside the template
> >>> with dtml, but not with the exact same state

[Zope] problem with manage_importObject

2007-03-12 Thread Fabio Marcone
Hi to all!

I have a problem using manage_importObject?file=... with zope2.9.
In particular: object is successfully imported but if I shutdown and
then reboot the server, I don't see anymore imported object. If I import
the same object using web form "Import/Export" I have not this strange
behavior.

anyone can help me?

very thanks,
Fabio
-- 

Dott. Fabio Marcone

2T srl
Telefono+39 - 0871- 540154
Fax +39 - 0871- 571594
Email   fabio.marcone(AT)duet.it
Indirizzo   Viale B. Croce 573
66013 Chieti Scalo (CH)
GNU/Linux registered user   #400424
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] problem with manage_importObject

2007-03-12 Thread Andreas Jung



--On 12. März 2007 11:00:33 +0100 Fabio Marcone <[EMAIL PROTECTED]> 
wrote:



Hi to all!

I have a problem using manage_importObject?file=... with zope2.9.
In particular: object is successfully imported but if I shutdown and
then reboot the server, I don't see anymore imported object.


I don't believe that.

If I import

the same object using web form "Import/Export" I have not this strange
behavior.


There should not be any difference between a GET and POST request.
And it fact I can not reproduce it...sounds like a fairy tale.

-aj



pgphB9rL8JAHj.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] problem with manage_importObject

2007-03-12 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


I have a problem using manage_importObject?file=... with zope2.9.
In particular: object is successfully imported but if I shutdown and
then reboot the server, I don't see anymore imported object. If I  
import

the same object using web form "Import/Export" I have not this strange
behavior.


Are you calling manage_importObject from Python code? Are you sure  
the transaction is committed? If you're calling this in some external  
script (such as a script run via "zopectl run") without starting a  
"normal" web request you may have to explicitly commit the transaction.


jens



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFF9TnyRAx5nvEhZLIRAr1IAKCS2P+qPqMM4KN7ZX1kbBrYb7SWKwCgroTN
syUjFzgeRi6qzRKnEPP0XTI=
=tgrL
-END PGP SIGNATURE-
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] problem with manage_importObject

2007-03-12 Thread Fabio Marcone
Jens Vagelpohl wrote:
>>> I have a problem using manage_importObject?file=... with zope2.9.
>>> In particular: object is successfully imported but if I shutdown and
>>> then reboot the server, I don't see anymore imported object. If I import
>>> the same object using web form "Import/Export" I have not this strange
>>> behavior.
> 
> Are you calling manage_importObject from Python code? Are you sure the
> transaction is committed? If you're calling this in some external script
> (such as a script run via "zopectl run") without starting a "normal" web
> request you may have to explicitly commit the transaction.
> 
> jens
> 
> 
> 
perhaps this is the problem...
in fact /var/lib/zope2.9/instance/myinstance/var is empty after
importObject operation using python script.

but the commit has been introduced in zope 2.9?
I use the same code in zope2.7 without problem.
in a python script I use:
zopeClient('http://localhost:9673/manage_importObject?file=app.zexp',myuser,mypassword)

where zopeClient is:
def zopeClient(url,username,passwd):
f = Function(url)
f.username = username
f.password = passwd
apply(f,(),{})

How I can do "commit"?

Thanks,
Fabio


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

-- 

Dott. Fabio Marcone

2T srl
Telefono+39 - 0871- 540154
Fax +39 - 0871- 571594
Email   fabio.marcone(AT)duet.it
Indirizzo   Viale B. Croce 573
66013 Chieti Scalo (CH)
GNU/Linux registered user   #400424
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] problem with manage_importObject

2007-03-12 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


perhaps this is the problem...
in fact /var/lib/zope2.9/instance/myinstance/var is empty after
importObject operation using python script.

but the commit has been introduced in zope 2.9?


The need to commit a transaction has been part of the ZODB since day 1.



I use the same code in zope2.7 without problem.
in a python script I use:
zopeClient('http://localhost:9673/manage_importObject? 
file=app.zexp',myuser,mypassword)


where zopeClient is:
def zopeClient(url,username,passwd):
f = Function(url)
f.username = username
f.password = passwd
apply(f,(),{})


Maybe the behavior of the old Zope client stuff has changed. I  
honestly don't know anyone who uses it. Nowadays I would always write  
scripts that are invoked using "zopectl run", which means you need to  
have a ZEO-enabled setup, if you don't have it already.




How I can do "commit"?


import transaction
transaction.commit()

This doesn't work with the Zope client approach, which is basically  
glorified URL-whacking...


jens



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFF9T2WRAx5nvEhZLIRAgOaAJ9SL//QC6OYXXhv80OPT7gCU62/rQCfRzqL
6KIwxhWyr5nObUf2T5o+38g=
=VysF
-END PGP SIGNATURE-
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Data.fs & MySQL DB Blown Up!

2007-03-12 Thread tonylabarbara
Hi;
Forgive the long (but necessary) background. I bought a new 500 GB hard drive 
for my server located on the other side of the world. I accidentally entered an 
erroneous command to copy everything from the old HD to the new one and ended 
up corrupting the OS. However, the *first* thing that happened was that command 
zapped my Data.fs. It was located on the new HD with a symlink for the entire 
var dir going from the old HD to the new one. 
 
Fast foreward to this week. I've built a new server and transplanted my 500 GB 
HD. I told the server farm to check it thoroughly because I suspected the 
hardware may have gotten corrupted. They swear they did check it thoroughly. I 
have 2 Zope instances. On one, I moved the var to the new HD with the symlink. 
I also moved my MySQL database to the new HD. I left them alone while I was 
working on the other Zope instance. Lo and behold, without my doing anything, 
suddenly the Data.fs on the Zope instance on the new HD got rewritten to 0 
bytes and the MySQL database got completely nuked!
 
My server farm tells me it has nothing whatsoever to do with the hard drive or 
the OS, that both are in perfect condition. I say that's nonsense! What do you 
think?
Tony

AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] problem with manage_importObject

2007-03-12 Thread Eric Bréhault

Hello,

What about just doing the import yourself:
container._importObjectFromFile(f)

(rather than using the ZMI's manage_importObject method through a zope
client connection) ?

Eric BREHAULT

On 3/12/07, Fabio Marcone <[EMAIL PROTECTED]> wrote:


Jens Vagelpohl wrote:
>>> I have a problem using manage_importObject?file=... with zope2.9.
>>> In particular: object is successfully imported but if I shutdown and
>>> then reboot the server, I don't see anymore imported object. If I
import
>>> the same object using web form "Import/Export" I have not this strange
>>> behavior.
>
> Are you calling manage_importObject from Python code? Are you sure the
> transaction is committed? If you're calling this in some external script
> (such as a script run via "zopectl run") without starting a "normal" web
> request you may have to explicitly commit the transaction.
>
> jens
>
>
>
perhaps this is the problem...
in fact /var/lib/zope2.9/instance/myinstance/var is empty after
importObject operation using python script.

but the commit has been introduced in zope 2.9?
I use the same code in zope2.7 without problem.
in a python script I use:
zopeClient('
http://localhost:9673/manage_importObject?file=app.zexp',myuser,mypassword
)

where zopeClient is:
def zopeClient(url,username,passwd):
f = Function(url)
f.username = username
f.password = passwd
apply(f,(),{})

How I can do "commit"?

Thanks,
Fabio


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

--

Dott. Fabio Marcone

2T srl
Telefono+39 - 0871- 540154
Fax +39 - 0871- 571594
Email   fabio.marcone(AT)duet.it
Indirizzo   Viale B. Croce 573
66013 Chieti Scalo (CH)
GNU/Linux registered user   #400424
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Data.fs & MySQL DB Blown Up!

2007-03-12 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 12 Mar 2007, at 12:54, [EMAIL PROTECTED] wrote:
My server farm tells me it has nothing whatsoever to do with the  
hard drive or the OS, that both are in perfect condition. I say  
that's nonsense! What do you think?


Sorry, without knowing exactly what you did and what they did there  
is no way anyone can make any sensible comment. Apart from the fact  
that this is not a Zope issue but a systems administration issue and  
off-topic.


jens



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFF9UI9RAx5nvEhZLIRAv/6AJ94RYVOKEY48+gDp3m/YhbKmw+tZACfUO0x
G/AVa5a8kZtQonWd46r1KJ0=
=BvVh
-END PGP SIGNATURE-
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Lost user credentials

2007-03-12 Thread Garito

Hi Andreas!
What kind of information do you need?
On my last messages to the list I send the tracebacks and some other
information (need to resend them?)

Could you point me what details do you need?

Thank you so much for you interest!

2007/3/12, Andreas Jung <[EMAIL PROTECTED]>:




--On 12. März 2007 04:04:31 +0100 Garito <[EMAIL PROTECTED]> wrote:

> Hi all!
> Some days ago I send to the list a question about a problem losting user
> credentials
>
> In my code I don't use nothing about security and nothing is changed on
> zmi's security tab
>
> But when I launch a method (Borrar if you remember) the user who
launches
> the action is anonymous not the logged one

Somewhat hard to believe without a detailed description

-aj





--
Mis Cosas: http://blogs.sistes.net/Garito
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Installation problems

2007-03-12 Thread Calder Coalson
Hi, I'm attempting to install Zope on Mac OS X and having problems.   
I'm sure the documentation is sufficient for most people, but I  
really don't understand how to run Zope.  I performed the install  
instructions, (correctly, I think).  I've got a Zope folder in my  
home directory, and a Zope-3.3.1 folder in /usr/local, but from what  
folder do you actually run ./start to start the server?  It says your  
installation directory.  i assumed that meant /usr/local/Zoper-3.3.1,  
but that didn't work.  Then I tried ~/Zope: didn't work.  And as a  
last desperate attempt, I tried ~/Zope/Zope: no results.  In all  
cases I got:

tcsh: ./start: Command not found.

Help for the one stupid guy on this list will be much appreciated.  ;-)

Thanks,
Calder Coalson
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] call exthernal method

2007-03-12 Thread javi lopez

hello:

how to call exthernal method from script python in zope
Thanks..
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] call exthernal method

2007-03-12 Thread Andreas Jung



--On 12. März 2007 16:34:34 +0100 javi lopez <[EMAIL PROTECTED]> wrote:


hello:

how to call exthernal method from script python in zope
Thanks..



By calling it like *any* other object in Zope:

result = context.(parameters)

-aj

pgp4nSWQuze43.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] call exthernal method

2007-03-12 Thread Claudio Battaglino

javi lopez ha scritto:

hello:

how to call exthernal method from script python in zope
Thanks..





context.myExternalMethod()


cld.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Installation problems

2007-03-12 Thread Andreas Jung



--On 12. März 2007 10:31:17 -0500 Calder Coalson <[EMAIL PROTECTED]> 
wrote:



Hi, I'm attempting to install Zope on Mac OS X and having problems.  I'm
sure the documentation is sufficient for most people, but I really don't
understand how to run Zope.  I performed the install instructions,
(correctly, I think).  I've got a Zope folder in my home directory, and a
Zope-3.3.1 folder in /usr/local, but from what folder do you actually run
./start to start the server?


For Zope 3 you might use the zope3-users mailinglist. But anyway...usually


make
bin/zopectl fg


should do the job

-aj

pgpVnZawXa3Nm.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Redirecting

2007-03-12 Thread tonylabarbara
Hi;
I have a Web site I'm building a shopping cart for that is built with a basic 
site template and an iframe where all the page-by-page info goes. I need to 
redirect the iframe to the address below, but when I use the current 
incantation, it replaces not just the iframe but the whole page! Can someone 
suggest a better idea? This is a python script:
 
request = container.REQUEST
response = request.RESPONSE
response.redirect(request.BASE0 + '/EMarket/Our_Store/Main_frame.pt?category=' 
+ category)
TIA,
Tony

AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Redirecting

2007-03-12 Thread Andreas Jung



--On 12. März 2007 11:55:52 -0400 [EMAIL PROTECTED] wrote:


Hi;
I have a Web site I'm building a shopping cart for that is built with a
basic site template and an iframe where all the page-by-page info goes. I
need to redirect the iframe to the address below, but when I use the
current incantation, it replaces not just the iframe but the whole page!
Can someone suggest a better idea? This is a python script:
request = container.REQUEST
response = request.RESPONSE
response.redirect(request.BASE0 +
'/EMarket/Our_Store/Main_frame.pt?category=' + category) TIA,


This will of course redirect the whole page including all contents.
You have to use Javascript.

-aj

pgpAjSMsqHUTB.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Redirecting

2007-03-12 Thread tonylabarbara
Ugh. JS redirects create problems with the search engines. What I really want 
to do is "fill the hole in the doughnut", to use a radio advertising term. That 
is, I have code before the page data referenced below, and I have code after 
it. I want to write the stuff referenced below into the "hole". What's a good 
way to do this?
TIA,
Tony 
 
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; zope@zope.org
Sent: Mon, 12 Mar 2007 12:04 PM
Subject: Re: [Zope] Redirecting


 
--On 12. März 2007 11:55:52 -0400 [EMAIL PROTECTED] wrote: 
 
> Hi; 
> I have a Web site I'm building a shopping cart for that is built with a 
> basic site template and an iframe where all the page-by-page info goes. I 
> need to redirect the iframe to the address below, but when I use the 
> current incantation, it replaces not just the iframe but the whole page! 
> Can someone suggest a better idea? This is a python script: 
> request = container.REQUEST 
> response = request.RESPONSE 
> response.redirect(request.BASE0 + 
> '/EMarket/Our_Store/Main_frame.pt?category=' + category) TIA, 
 
This will of course redirect the whole page including all contents. 
You have to use Javascript. 
 
-aj 

AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Redirecting

2007-03-12 Thread Jonathan


- Original Message - 
From: <[EMAIL PROTECTED]>

To: 
Sent: Monday, March 12, 2007 11:55 AM
Subject: [Zope] Redirecting



Hi;
I have a Web site I'm building a shopping cart for that is built with a 
basic site template and an iframe where all the page-by-page info goes. I 
need to redirect the iframe to the address below, but when I use the 
current incantation, it replaces not just the iframe but the whole page! 
Can someone suggest a better idea? This is a python script:


request = container.REQUEST
response = request.RESPONSE
response.redirect(request.BASE0 + 
'/EMarket/Our_Store/Main_frame.pt?category=' + category)


If the link to the redirect is on a page within the iframe, then it will 
just reload the contents of the iframe (unless there is some javascript 
within the target page which is 'breaking out' of the iframe).


If the link to the redirect is on the 'main page' and you want it to just 
reload the iframe, then you need some logic in the main page display routine 
which sets the 'src' field of the iframe html tag to the 'new' routine.


hth

Jonathan 


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Redirecting

2007-03-12 Thread Andreas Jung



--On 12. März 2007 12:13:53 -0400 [EMAIL PROTECTED] wrote:


Ugh. JS redirects create problems with the search engines. What I really
want to do is "fill the hole in the doughnut", to use a radio advertising
term.


What you want is not of interest in this particular case. You can perform
a redirection of an iframe driven by the main page only through JS - point.

-aj

pgpF7JSYtk5mo.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Redirecting (fwd)

2007-03-12 Thread Andreas Jung

Please keep the discussion on the list :-)

-aj

 Forwarded Message 
Date: 12. März 2007 12:39:05 -0400
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [Zope] Redirecting

This is OT at this point so I'm writing you off list. I can't find a JS
command "point" anywhere. Do you happen to have a resource? TIA,
Tony

-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; zope@zope.org
Sent: Mon, 12 Mar 2007 12:20 PM
Subject: Re: [Zope] Redirecting



--On 12. März 2007 12:13:53 -0400 [EMAIL PROTECTED] wrote:


Ugh. JS redirects create problems with the search engines. What I really
want to do is "fill the hole in the doughnut", to use a radio advertising
term.


What you want is not of interest in this particular case. You can perform
a redirection of an iframe driven by the main page only through JS - point.

-aj

AOL now offers free email to everyone.  Find out more about what's free
from AOL at AOL.com.

-- End Forwarded Message --



--
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376
Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK

E-Publishing, Python, Zope & Plone development, Consulting


pgpbQmtvpnbPX.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] problem with manage_importObject

2007-03-12 Thread Fabio Marcone
Eric Bréhault wrote:
> Hello,
> 
> What about just doing the import yourself:
> container._importObjectFromFile(f)
> 
> (rather than using the ZMI's manage_importObject method through a zope
> client connection) ?
> 
> Eric BREHAULT
> 
> On 3/12/07, Fabio Marcone <[EMAIL PROTECTED]> wrote:
>>
>> Jens Vagelpohl wrote:
>> >>> I have a problem using manage_importObject?file=... with zope2.9.
>> >>> In particular: object is successfully imported but if I shutdown and
>> >>> then reboot the server, I don't see anymore imported object. If I
>> import
>> >>> the same object using web form "Import/Export" I have not this
>> strange
>> >>> behavior.
>> >
>> > Are you calling manage_importObject from Python code? Are you sure the
>> > transaction is committed? If you're calling this in some external
>> script
>> > (such as a script run via "zopectl run") without starting a "normal"
>> web
>> > request you may have to explicitly commit the transaction.
>> >
>> > jens
>> >
>> >
>> >
>> perhaps this is the problem...
>> in fact /var/lib/zope2.9/instance/myinstance/var is empty after
>> importObject operation using python script.
>>
>> but the commit has been introduced in zope 2.9?
>> I use the same code in zope2.7 without problem.
>> in a python script I use:
>> zopeClient('
>> http://localhost:9673/manage_importObject?file=app.zexp',myuser,mypassword
>>
>> )
>>
>> where zopeClient is:
>> def zopeClient(url,username,passwd):
>> f = Function(url)
>> f.username = username
>> f.password = passwd
>> apply(f,(),{})
>>
>> How I can do "commit"?
>>
>> Thanks,
>> Fabio
>>
>>
>> ___
>> Zope maillist  -  Zope@zope.org
>> http://mail.zope.org/mailman/listinfo/zope
>> **   No cross posts or HTML encoding!  **
>> (Related lists -http://mail.zope.org/mailman/listinfo/zope-announce
>> http://mail.zope.org/mailman/listinfo/zope-dev )
>>
>> -- 
>>
>> Dott. Fabio Marcone
>>
>> 2T srl
>> Telefono+39 - 0871- 540154
>> Fax +39 - 0871- 571594
>> Email   fabio.marcone(AT)duet.it
>> Indirizzo   Viale B. Croce 573
>> 66013 Chieti Scalo (CH)
>> GNU/Linux registered user   #400424
>> ___
>> Zope maillist  -  Zope@zope.org
>> http://mail.zope.org/mailman/listinfo/zope
>> **   No cross posts or HTML encoding!  **
>> (Related lists -
>> http://mail.zope.org/mailman/listinfo/zope-announce
>> http://mail.zope.org/mailman/listinfo/zope-dev )
>>
> 
well, I have no container because my script python is not an external
method or a script python in zope.

I try with:
import Zope2

Zope2.configure(...)

app=Zope2.app()
app.manage_delObjects(ids="index_html")
app.manage_importObject("index_html.zexp")

but with no results


Now I'm trying with urllib2 and urlopen with authentication but when I
reboot the machine, zope application disappeared.


do you know a method to commit http transaction in zope?

any suggests?

Thanks,
Fabio

-- 

Dott. Fabio Marcone

2T srl
Telefono+39 - 0871- 540154
Fax +39 - 0871- 571594
Email   fabio.marcone(AT)duet.it
Indirizzo   Viale B. Croce 573
66013 Chieti Scalo (CH)
GNU/Linux registered user   #400424
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] problem with manage_importObject

2007-03-12 Thread Andreas Jung



--On 12. März 2007 18:51:57 +0100 Fabio Marcone <[EMAIL PROTECTED]> 
wrote:



well, I have no container because my script python is not an external
method or a script python in zope.

I try with:
import Zope2

Zope2.configure(...)

app=Zope2.app()
app.manage_delObjects(ids="index_html")
app.manage_importObject("index_html.zexp")

but with no results



Please read the posting of Jens carefully. You *must* commit.

-aj

pgpqxWiKySwht.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Lost user credentials

2007-03-12 Thread Garito

Could any charitable soul take pity on this poor sinner, please...?

2007/3/12, Garito <[EMAIL PROTECTED]>:


Hi Andreas!
What kind of information do you need?
On my last messages to the list I send the tracebacks and some other
information (need to resend them?)

Could you point me what details do you need?

Thank you so much for you interest!

2007/3/12, Andreas Jung <[EMAIL PROTECTED]>:
>
>
>
> --On 12. März 2007 04:04:31 +0100 Garito <[EMAIL PROTECTED]> wrote:
>
> > Hi all!
> > Some days ago I send to the list a question about a problem losting
> user
> > credentials
> >
> > In my code I don't use nothing about security and nothing is changed
> on
> > zmi's security tab
> >
> > But when I launch a method (Borrar if you remember) the user who
> launches
> > the action is anonymous not the logged one
>
> Somewhat hard to believe without a detailed description
>
> -aj
>



--
Mis Cosas: http://blogs.sistes.net/Garito





--
Mis Cosas: http://blogs.sistes.net/Garito
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Lost user credentials

2007-03-12 Thread Andreas Jung

If you create a new posting, you should include all related information.
I don't go hunting for information somewhere else.

-aj

--On 12. März 2007 18:56:28 +0100 Garito <[EMAIL PROTECTED]> wrote:


Could any charitable soul take pity on this poor sinner, please...?

2007/3/12, Garito <[EMAIL PROTECTED]>:


Hi Andreas!
What kind of information do you need?
On my last messages to the list I send the tracebacks and some other
information (need to resend them?)

Could you point me what details do you need?

Thank you so much for you interest!

2007/3/12, Andreas Jung <[EMAIL PROTECTED]>:
>
>
>
> --On 12. März 2007 04:04:31 +0100 Garito <[EMAIL PROTECTED]> wrote:
>
> > Hi all!
> > Some days ago I send to the list a question about a problem losting
> user
> > credentials
> >
> > In my code I don't use nothing about security and nothing is changed
> on
> > zmi's security tab
> >
> > But when I launch a method (Borrar if you remember) the user who
> launches
> > the action is anonymous not the logged one
>
> Somewhat hard to believe without a detailed description
>
> -aj
>



--
Mis Cosas: http://blogs.sistes.net/Garito





--
Mis Cosas: http://blogs.sistes.net/Garito




--
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376
Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK

E-Publishing, Python, Zope & Plone development, Consulting


pgpLiLw0MTo4j.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Lost user credentials

2007-03-12 Thread Dennis Allison

I did not catch the original post and so don't know any of the details,
but it sounds like a problem with the logging system, not a loss of
credentials.  We had long ago and resolved with the list's help.  This 
patch is still in use with Zope 2.9.X.

You need to patch ../lib/python/ZServer/medusa/http_server.py

--- ./v0.0/http_server.py   2004-12-25 22:39:31.0 -0800
+++ ./v0.1/http_server.py   2004-12-25 22:39:31.0 -0800
@@ -36,6 +36,9 @@
 from counter import counter
 from urllib import unquote

+# Paul's Patch (a shameful thing) to make names register properly
+from ZPublisher.HTTPRequest import parse_cookie
+
 # 
===
 #  Request Object
 # 
===
@@ -277,6 +280,7 @@

 auth=self.get_header('Authorization')
 name='Anonymous'
+   
 if auth is not None:
 if string.lower(auth[:6]) == 'basic ':
 try: decoded=base64.decodestring(auth[6:])
@@ -286,10 +290,35 @@
 name = 'Unknown (bad auth string)'
 else:
 name = t[0]
+else:
+# start of patch
+try:
+auth_cookie_name='__ac'
+cookie= None
+try:
+cookies = {}
+header_value = self.get_header("Cookie")
+if header_value:
+parse_cookie(header_value, cookies)
+cookie = cookies.get(auth_cookie_name, None)
+except:
+name = 'Anonymous'
+
+if cookie is not None:
+cookie = unquote(cookie)
+try:
+cookie = base64.decodestring(cookie)
+name, password = tuple( cookie.split(':',1))
+except: name= "Unknown (bad auth cookie)"
+except:
+name = "Failure!"
+# end of patch

+   # log the host domain too
 self.channel.server.logger.log (
 self.channel.addr[0],
-'- %s [%s] "%s" %d %d "%s" "%s"\n' % (
+'%s %s [%s] "%s" %d %d "%s" "%s"\n' % (
+   self.get_header('Host'),
 name,
 self.log_date_string (time.time()),
 self.request,

Hope this helps.



On Mon, 12 Mar 2007, Garito wrote:

> Could any charitable soul take pity on this poor sinner, please...?
> 
> 2007/3/12, Garito <[EMAIL PROTECTED]>:
> >
> > Hi Andreas!
> > What kind of information do you need?
> > On my last messages to the list I send the tracebacks and some other
> > information (need to resend them?)
> >
> > Could you point me what details do you need?
> >
> > Thank you so much for you interest!
> >
> > 2007/3/12, Andreas Jung <[EMAIL PROTECTED]>:
> > >
> > >
> > >
> > > --On 12. März 2007 04:04:31 +0100 Garito <[EMAIL PROTECTED]> wrote:
> > >
> > > > Hi all!
> > > > Some days ago I send to the list a question about a problem losting
> > > user
> > > > credentials
> > > >
> > > > In my code I don't use nothing about security and nothing is changed
> > > on
> > > > zmi's security tab
> > > >
> > > > But when I launch a method (Borrar if you remember) the user who
> > > launches
> > > > the action is anonymous not the logged one
> > >
> > > Somewhat hard to believe without a detailed description
> > >
> > > -aj
> > >
> >
> >
> >
> > --
> > Mis Cosas: http://blogs.sistes.net/Garito
> >
> 
> 
> 
> 

-- 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Lost user credentials

2007-03-12 Thread Garito

Sorry the gmail response send only to the original poster not to the list
(sorry Andreas)
The original post:

The question then (sorry):
I have a product called Yanged
This product has overrided:
__bobo_traverse__ who returns some objects and sometime a wrapper object
with the HTML code to the browser
__call__ who returns the HTML code to __bobo_traverse__ or if you call the
object itself
index_html who returns __call__
A TALES evaluator to evaluate some TALES expresion out of page templates

All works ok except when I try to delete some objects. When I try to launch
the delete method I raises an authorized error and ask for new login and
password

I try with my user who is manager and owner but logon doesn't work and
raises the same error

If I look the error log I could see this error:

Traceback (innermost last):
 Module ZPublisher.Publish
, line 106, in publish
 Module ZPublisher.BaseRequest, line 323, in traverse
 Module Products.Yanged.Yanged, line 61, in __bobo_traverse__
 Module Products.Yanged.Yanged, line 141, in __call__
 Module Products.Yanged.Yanged
, line 170, in Ejecutar
 Module Products.Yanged.Yanged, line 125, in __call__
 Module Products.Yanged.Yanged, line 170, in Ejecutar
 Module Shared.DC.Scripts.Bindings, line 311, in __call__
 Module Shared.DC.Scripts.Bindings
, line 348, in _bindAndExec
 Module Products.PythonScripts.PythonScript, line 325, in _exec
 Module None, line 2, in BorrarFuncionalidad
  - 

  - Line 2
 Module AccessControl.ImplPython, line 729, in guarded_getattr
 Module AccessControl.ImplPython, line 671, in aq_validate
 Module AccessControl.ImplPython, line 565, in validate
 Module AccessControl.ImplPython
, line 463, in validate
 Module AccessControl.ImplPython, line 810, in raiseVerbose
Unauthorized: Your user account does not have the required permission.
Access to 'manage_delObjects' of (Yanged at
/sistes.net/clientes/escobarsl.com/Pagina/Funcionalidades) denied.
Your user account, Anonymous User, exists at (unknown). Access
requires one of the following roles: ['Manager']. Your roles in this
context are ['Anonymous'].

If I try to delete the object the error is raised but if immediately I try
to create another object works ok

This are the code about BorrarFuncionalidad (the code who raises the error)
and CrearFuncionalidad (the code that works ok). Both are Python Scripts:

BorrarFuncinalidad
carpeta = getattr(context.Singular(), 'Funcionalidades')
carpeta.manage_delObjects(args['path'])
return args

CrearFuncionalidad
carpeta = getattr(context.Singular (), 'Funcionalidades')
Id = context.Dame(context.Id)

args['caso'] = carpeta.manage_addProduct['Yanged'].CrearYanged(Id)
return args

Both scripts are launched in the same way (the Ejecutar method you could see
at the traceback above)

I try to track the user from the __bobo_traverse__ to the __call__ and seems
the user credentials are lost when I call CrearFuncionalidad (in the whole
call)

Can you point me some clues to solve this problem?

Thanks!

2007/3/12, Dennis Allison <[EMAIL PROTECTED]>:



I did not catch the original post and so don't know any of the details,
but it sounds like a problem with the logging system, not a loss of
credentials.  We had long ago and resolved with the list's help.  This
patch is still in use with Zope 2.9.X.

You need to patch ../lib/python/ZServer/medusa/http_server.py

--- ./v0.0/http_server.py   2004-12-25 22:39:31.0 -0800
+++ ./v0.1/http_server.py   2004-12-25 22:39:31.0 -0800
@@ -36,6 +36,9 @@
from counter import counter
from urllib import unquote

+# Paul's Patch (a shameful thing) to make names register properly
+from ZPublisher.HTTPRequest import parse_cookie
+
#

===
#  Request Object
#

===
@@ -277,6 +280,7 @@

 auth=self.get_header('Authorization')
 name='Anonymous'
+
 if auth is not None:
 if string.lower(auth[:6]) == 'basic ':
 try: decoded=base64.decodestring(auth[6:])
@@ -286,10 +290,35 @@
 name = 'Unknown (bad auth string)'
 else:
 name = t[0]
+else:
+# start of patch
+try:
+auth_cookie_name='__ac'
+cookie= None
+try:
+cookies = {}
+header_value = self.get_header("Cookie")
+if header_value:
+parse_cookie(header_value, cookies)
+cookie = cookies.get(auth_cookie_name, None)
+except:
+name = 'Anonymous'
+
+if cookie is not None:
+cookie = unquote(cookie)
+try:
+cookie = base64.decodestring(cookie)
+name, password = tuple( cook

Re: [Zope] Lost user credentials

2007-03-12 Thread Dieter Maurer
Garito wrote at 2007-3-12 04:04 +0100:
> ...
>In my code I don't use nothing about security and nothing is changed on
>zmi's security tab
>
>But when I launch a method (Borrar if you remember) the user who launches
>the action is anonymous not the logged one

Your problem description is too terse to say something definite about
the real problem.

But, I can tell you that whether or not a user appears to be
anonymous or logged in only slightly depends on security settings.

The process is as follows:

  The url traversal determines the published object and
  the path to reach it. From the published object the roles are determined
  necessary to access it.
  Then a user folder is looked for that can authenticate a user
  from the current request with the required roles. This lookup
  proceeds in the reverse order than the url traversal.

  Thus, unless you have given your object unreasonable roles (usually
  you protect by a permission which is then mapped to a set of roles),
  the authenticated user primarily depends on the authentication
  information in the request.

In what kind the request contains authentication information
highly depends on the form of authentication you are using.
There are at least two widely used approaches: cookie based authentication
and HTTP (basic) authentication.

In the first case, the user will appear "anonymous" whenever
cookies are disabled.



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Lost user credentials

2007-03-12 Thread Garito

To Dennis: I use Zope 2.9.5 final. Is this version concern

2007/3/12, Dieter Maurer <[EMAIL PROTECTED]>:


Garito wrote at 2007-3-12 04:04 +0100:
> ...
>In my code I don't use nothing about security and nothing is changed on
>zmi's security tab
>
>But when I launch a method (Borrar if you remember) the user who launches
>the action is anonymous not the logged one

Your problem description is too terse to say something definite about
the real problem.

But, I can tell you that whether or not a user appears to be
anonymous or logged in only slightly depends on security settings.

The process is as follows:

  The url traversal determines the published object and
  the path to reach it. From the published object the roles are determined
  necessary to access it.
  Then a user folder is looked for that can authenticate a user
  from the current request with the required roles. This lookup
  proceeds in the reverse order than the url traversal.

  Thus, unless you have given your object unreasonable roles (usually
  you protect by a permission which is then mapped to a set of roles),
  the authenticated user primarily depends on the authentication
  information in the request.

In what kind the request contains authentication information
highly depends on the form of authentication you are using.
There are at least two widely used approaches: cookie based authentication
and HTTP (basic) authentication.

In the first case, the user will appear "anonymous" whenever
cookies are disabled.



--
Dieter





--
Mis Cosas: http://blogs.sistes.net/Garito
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Data.fs & MySQL DB Blown Up!

2007-03-12 Thread Dieter Maurer
[EMAIL PROTECTED] wrote at 2007-3-12 07:54 -0400:
>Forgive the long (but necessary) background. I bought a new 500 GB hard drive 
>for my server located on the other side of the world. I accidentally entered 
>an erroneous command to copy everything from the old HD to the new one and 
>ended up corrupting the OS. However, the *first* thing that happened was that 
>command zapped my Data.fs. It was located on the new HD with a symlink for the 
>entire var dir going from the old HD to the new one. 

This is very easy to do: copying a file to an (existing) destination
opens and truncates the destination. When the destination happens
to be equal to the source, the source is truncated as well -- and you have
lost your data.



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Lost user credentials

2007-03-12 Thread Garito

Fuck$%&ing gmail
Sorry all for this stupidity

To Dennis: I use Zope 2.9.5 final. Is this version concern with this bug?

To Dieter: I use HTTP authentication method (at least I suppose that). I
don't change anything about the default configuration nor use any cookie at
least

What I wonder is CrearFuncionalidad works ok but not BorrarFuncionalidad who
are launched both in the same way

Any idea?

2007/3/12, Garito <[EMAIL PROTECTED]>:


To Dennis: I use Zope 2.9.5 final. Is this version concern

2007/3/12, Dieter Maurer <[EMAIL PROTECTED]>:
>
> Garito wrote at 2007-3-12 04:04 +0100:
> > ...
> >In my code I don't use nothing about security and nothing is changed on
> >zmi's security tab
> >
> >But when I launch a method (Borrar if you remember) the user who
> launches
> >the action is anonymous not the logged one
>
> Your problem description is too terse to say something definite about
> the real problem.
>
> But, I can tell you that whether or not a user appears to be
> anonymous or logged in only slightly depends on security settings.
>
> The process is as follows:
>
>   The url traversal determines the published object and
>   the path to reach it. From the published object the roles are
> determined
>   necessary to access it.
>   Then a user folder is looked for that can authenticate a user
>   from the current request with the required roles. This lookup
>   proceeds in the reverse order than the url traversal.
>
>   Thus, unless you have given your object unreasonable roles (usually
>   you protect by a permission which is then mapped to a set of roles),
>   the authenticated user primarily depends on the authentication
>   information in the request.
>
> In what kind the request contains authentication information
> highly depends on the form of authentication you are using.
> There are at least two widely used approaches: cookie based
> authentication
> and HTTP (basic) authentication.
>
> In the first case, the user will appear "anonymous" whenever
> cookies are disabled.
>
>
>
> --
> Dieter
>



--
Mis Cosas: http://blogs.sistes.net/Garito





--
Mis Cosas: http://blogs.sistes.net/Garito
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] problem with manage_importObject

2007-03-12 Thread Fabio Marcone
thanks, I solved using Zope2 and transaction modules like Jens wrote me.

Fabio

Andreas Jung wrote:
> 
> 
> --On 12. März 2007 18:51:57 +0100 Fabio Marcone <[EMAIL PROTECTED]>
> wrote:
>>>
>> well, I have no container because my script python is not an external
>> method or a script python in zope.
>>
>> I try with:
>> import Zope2
>>
>> Zope2.configure(...)
>>
>> app=Zope2.app()
>> app.manage_delObjects(ids="index_html")
>> app.manage_importObject("index_html.zexp")
>>
>> but with no results
>>
> 
> Please read the posting of Jens carefully. You *must* commit.
> 
> -aj


-- 

Dott. Fabio Marcone

2T srl
Telefono+39 - 0871- 540154
Fax +39 - 0871- 571594
Email   fabio.marcone(AT)duet.it
Indirizzo   Viale B. Croce 573
66013 Chieti Scalo (CH)
GNU/Linux registered user   #400424
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Lost user credentials

2007-03-12 Thread Dennis Allison
On Mon, 12 Mar 2007, Garito wrote:

> To Dennis: I use Zope 2.9.5 final. Is this version concern
> 

Reviewing your reposted description of the problem, the patch I sent does
not appear applicable.

-- 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Lost user credentials

2007-03-12 Thread Garito

Thanks Dennis!

2007/3/12, Dennis Allison <[EMAIL PROTECTED]>:


On Mon, 12 Mar 2007, Garito wrote:

> To Dennis: I use Zope 2.9.5 final. Is this version concern
>

Reviewing your reposted description of the problem, the patch I sent does
not appear applicable.

--





--
Mis Cosas: http://blogs.sistes.net/Garito
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: Lost user credentials

2007-03-12 Thread Josef Meile
To Dieter: I use HTTP authentication method (at least I suppose that). I 
don't change anything about the default configuration nor use any cookie 
at least
What you get when you authenticate: a pop-up window (HTTP 
authentication) or an html form (Cookie based authentication)?


What I wonder is CrearFuncionalidad works ok but not BorrarFuncionalidad 
who are launched both in the same way

In the original thread:
http://mail.zope.org/pipermail/zope/2007-March/170794.html

you said:

>The question I can't understand is when BorrarFuncionalidad ask for a 
>login and password I put my user that is manager and owner but the 
>login don't work (it ask again and again)

>
>Both scripts has the same parent and the same security permissions

How are you defining the permissions: by checking the "Acquire 
permission settings?" checkbox or are you implicit defining a role for 
that permission? In the first case zope will scan the folder hierarchy 
till it finds a folder where the permission is defined. In the worst 
case it will reach the root folder where the permission must be either 
enabled or disabled. So, it can be that somewhere the "Delete Objects" 
permission was disabled for the "Manager" and "Authenticated" roles. If 
I were you, I would try to implicit define the "Delete objects" 
permission in the folder where you want to delete the objects and see if 
the problem persists.


In your last reply to the other thread:
http://mail.zope.org/pipermail/zope/2007-March/170806.html

you asked:
"""
I'm using prototype to launch some actions via AJAX
Could be this the problem?
How can I conservate the user who launch the actions between AJAX calls?
"""

I have never used AJAX, so, I don't know if the user credentials get 
lost during the call of your AJAX code. Perhaps other people can help here.


Regards
Josef


Out-topic:
>Fuck$%&ing gmail
>Sorry all for this stupidity
Then try to use another newsreader like Thunderbird (multi platform). If 
you are on windows you could also try "Outlook Express" as well.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Lost user credentials

2007-03-12 Thread Garito

2007/3/12, Josef Meile <[EMAIL PROTECTED]>:


> To Dieter: I use HTTP authentication method (at least I suppose that). I
> don't change anything about the default configuration nor use any cookie
> at least
What you get when you authenticate: a pop-up window (HTTP
authentication) or an html form (Cookie based authentication)?



Finally I use HTTP authentication method (pop-up window)


What I wonder is CrearFuncionalidad works ok but not BorrarFuncionalidad
> who are launched both in the same way
In the original thread:
http://mail.zope.org/pipermail/zope/2007-March/170794.html

you said:

>The question I can't understand is when BorrarFuncionalidad ask for a
>login and password I put my user that is manager and owner but the
>login don't work (it ask again and again)
>
>Both scripts has the same parent and the same security permissions

How are you defining the permissions: by checking the "Acquire
permission settings?" checkbox or are you implicit defining a role for
that permission? In the first case zope will scan the folder hierarchy
till it finds a folder where the permission is defined. In the worst
case it will reach the root folder where the permission must be either
enabled or disabled. So, it can be that somewhere the "Delete Objects"
permission was disabled for the "Manager" and "Authenticated" roles. If
I were you, I would try to implicit define the "Delete objects"
permission in the folder where you want to delete the objects and see if
the problem persists.



I use Acquire permissions (I don't touch anything)
If Manager couldn't delete object at this folder I couldn't delete any
object with ZMI but I can

In your last reply to the other thread:

http://mail.zope.org/pipermail/zope/2007-March/170806.html

you asked:
"""
I'm using prototype to launch some actions via AJAX
Could be this the problem?
How can I conservate the user who launch the actions between AJAX calls?
"""

I have never used AJAX, so, I don't know if the user credentials get
lost during the call of your AJAX code. Perhaps other people can help
here.

Regards
Josef


Out-topic:
>Fuck$%&ing gmail
>Sorry all for this stupidity
Then try to use another newsreader like Thunderbird (multi platform). If
you are on windows you could also try "Outlook Express" as well.



Sure. But the real question is don't use gmail at least
I try Google Apps for your domain but this was a big error
I'm in the process to install a linux server with all my needs but I'm
newbie with it
For now I disable the hotkeys on gmail to avoid to send unconcluded messages
(as before) . Sorry for the inconveniences (now I need to be subscribed to
this list with two accounts because my main one don't receive some messages
from this list

Thanks!!!

___

Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )





--
Mis Cosas: http://blogs.sistes.net/Garito
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] 'int' object has no attribute 'objectValues'

2007-03-12 Thread tonylabarbara
Hi;
I've written this PT:
 




...which calls this external method:
 
import random
def randomNumber(num):
   return random.random(num)
 
...and throws this error:
 
Error Type: AttributeError
Error Value: 'int' object has no attribute 'objectValues' 
Why?
TIA,
Tony

AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] 'int' object has no attribute 'objectValues'

2007-03-12 Thread Maciej Wisniowski
> 
> 
> 
Check what here/quotes is evaluating to. Seems that it is int.

-- 
Maciej Wisniowski
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )