[Zope] several questions about shared libraries and security

2005-11-01 Thread Denis V. Gudtsov

Hello!

The former I wrote python library. This lib is used to interact with database
and defines some hi-level methods. I'm planing to use this lib in
scripts, running on the same machine and zope. Now library is located
on /usr/local/lib/. Is it possible to use it in zope?

And the later i wanted to now how i can create a flexible access
rules? There are two procedures needed: authentication and
authorization. The first is not difficult to realize with user
folder. But what is the ability to control access rights of users for
access to some types of information? I'm thinking it will about 10
users at all. Do I need to use pgUserFolder for this?

Thank you,All! ;-)

___
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] passing the parameters to zsql method

2005-10-27 Thread Denis V. Gudtsov

Hello!

I'm trying to pass the form parameters from page template to zsql method.

A piece of code follows:

form action=clients_add_sql
input type=text name=name
input type=text name=account
input type=submit
/form

clients_add_sql:
insert into table(name,account) values (dtml-sqlvar name type=string, 
dtml-sqlvar account type=string);

the problem is when i click the 'submit' button, the form
clients_add_sql Input Data Enter query parameters: appears.

Does someone know how i can pass the form parameters to zsql method
directly?
-- 


___
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[2]: [Zope] Factory-based Type Information

2005-06-21 Thread Denis Mishunoff
Hello, J.

You wrote 21 èþíÿ 2005 ã., 20:27:50:

 Denis Mishunoff wrote:

 I have a problem with my product.
 I use Zope 2.7.5 and Plone 2.0.5.
 
 I need to create the copy of Document content-type on my product's
 install the same way as it is done in portal_types via
 Factory-based Type Information option of dropdown.
 I just need to have the copy of it and to alter some fields.

 Here's some code I stole from Chapter 8 of my book, were a 
 Folder-derived type is created in an install script::

from Products.CMFCore.Expression import Expression

# Customize types
types_tool=getToolByName(portal,'portal_types')

# New 'NewsFolder' type based on folder
types_tool.manage_addTypeInformation(id='NewsFolder',
 add_meta_type=Factory-based Type Information,
 typeinfo_name=CMFPlone: Plone Folder)
nf = getattr(types_tool, 'NewsFolder')
nf.manage_changeProperties(filter_content_types=1,
 allowed_content_types=('News Item',))
actions=nf._cloneActions()
for a in actions:
if a.id == 'view':
a.action =
 Expression('string:${object_url}/newsfolder_view')
nf._actions=(actions)

 After a clone of the type is made based on Plone Folder, some changes
 are made: contents are filtered, and only News Items are allowed; also
 an action is changed to point to a custom template.

 This is a better option than using the copy/paste API like you might do
 in the ZMI.

 --jcc


Thank you very much, Cameron. Definitelly will use it next time. This
time I decided to create the separate content type, because seems like
I will need to change some methods of it. But I will definitelly use
your solution next time ;)

-- 
  Best regards,
 Denis Mishunoff  mailto:[EMAIL PROTECTED]
  http://plonetarium.objectis.net

___
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] Factory-based Type Information

2005-06-18 Thread Denis Mishunoff
Hello, list.

I have a problem with my product.
I use Zope 2.7.5 and Plone 2.0.5.

I need to create the copy of Document content-type on my product's
install the same way as it is done in portal_types via
Factory-based Type Information option of dropdown.
I just need to have the copy of it and to alter some fields.

Please advise. Thank you.

-- 
  Best regards,
 Denis Mishunoff  mailto:[EMAIL PROTECTED]
  http://plonetarium.objectis.net

___
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[2]: [Zope] assertion error

2005-05-14 Thread Denis Mishunoff
Hello, Dieter.

You wrote 13  2005 ., 22:21:49:

 Looks as if your catalog were very old and still has entries
 with request relative resolution.

 Replace assert(obj) with

 if not obj:
# here the assert would fail
# determine its path for later analysis
path = brain.getPath()
# ensure, you can see path somehow
 else:
# here the assert would pass
...

 With this information, you can try to analyse the problem
 in an interactive Python interpreter.

Thanks, Dieter.
I tried your advice and made the following code:

 if not obj:
# here the assert would fail
# determine its path for later analysis
path = brain.getPath()
tagencies.append(path)
 else:
# here the assert would pass
...

To have either object or brain's path in output (tagencies list).
The most interesting is that accessing via name I've got objects and
paths, but accessing via IP I've got ONLY object - no paths...

Then I checked the paths I got for presence of objects on them.
Objects are there, so I decided to use

tagencies.append(portal.restrictedTraverse(path))

in code (portal variable was defined), but got the sign in screen :(
Maybe it's because I have not so usual structure of Instance? I have
ZOPE-ROOT
- Folder1
  - Plone site

I'm totally confused and don't know what to do with all this. Please
advise.



-- 
  Best regards,
 Denis Mishunoff  mailto:[EMAIL PROTECTED]
  http://plonetarium.objectis.net

___
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] assertion error

2005-05-13 Thread Denis Mishunoff
Hello, Zope community.

I use Zope 2.7.3, Python 2.3.4 and Plone 2.0.5
I have a strange behavior of template. It displays OK when accessing
via IP address, but when I try to access it via name I get assertion
error. Template uses the script that contains assertion:

...

if brain.Title != '':
obj = brain.getObject()
# here it is
assert(obj)
type = obj.getAdvert_type()
hereTitle = brain.Title

...

As you can guess, variable brain contains brain from catalog.
So, when I access the template, using this script via name it raises
Assertion Error. Seems like it can't get object from catalog. But it
works with IP...

Please advise what is my problem.

Thank you.


-- 
  Best regards,
 Denis Mishunoff  mailto:[EMAIL PROTECTED]
  http://plonetarium.objectis.net

___
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] Apache ProxyPass directive and REMOTE_ ENV

2001-01-14 Thread Denis

Hi,

I'm confronted to the same problem as the one as discussed
at that address :
http://www.egroups.com/message/zope/43874?threaded=1

I'm trying to get back the REMOTE_ADDR variable because it's
changed to the Server's address by a ProxyPass directive.

I'm trying to use SetEnv or SetEnvIf directives to do that.
But I can't manage to expand %{REMOTE_ADDR} to an IP address.
I mean, if I use :
  SetEnv client_ip_1 %h
  SetEnv client_ip_2 %{Remote_Addr}
  SetEnv client_ip_3 %{ENV:Remote_Addr}
I get :
  client_ip_1 = %h
and not :
  client_ip_1 = 212.68.75.6
and the same for all my tries.

Is there a way to expand those values ? A magic key to turn ?

Have you found a better solution than the one exposed by HTH
in the message above ?

Thank you.
-- 
Denis FRERE
P3B: Club Free-Pytho-Linuxien Caroloregien http://www.p3b.org

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




Re: [Zope] ANN: Perl For Zope

2000-05-25 Thread Denis Frère

Paul Everitt wrote:
 
 That's [the egg] quite a strained metaphor.  I'll be pretty unequivocal.  Anyone
 that thinks we are lessening our commitment to Python (a) hasn't read
 the FAQ before reacting and (b) doesn't know us very well.
 
 On the other hand, we'll likely do even more things like this over the
 year: open up to COM, CORBA, etc. as method facilities.

Context
===
Now, it's late, I've read the whole thread and I'm very calm, I swear.
You asked our thoughts, here are mine, with humility. A cheap market
study, you must confess ...
I'm a french speaking Belgian, excuse my strange English.

Prolog
==
I didn't say you were lessening your commitment to Python and (a) I had
read the FAQ (b) your answer shows I'm not quite wrong about you. 

But I must admit I was not explicit enough ... (I'll come back with this
a few lines further :-)

Act 1
=
Why do we love Python ? Because of the Zen. "Explicit is better than
Implicit, ..." I'm sure you know Tim Peeters Classics. We love Python
because of its purity. Why were the two colorfull metaphors speaking
about white and another color ? (Red socks and yolk). White is Python.

Act2

Zope is not quite white. And most of us wanted it whitened, with age and
maturity. Do you need to be burnt to accept the stove is hot ? Then,
look at the symptom in this list : you're overwhelmed with posts you
can't answer to. Why are there so much posts ? Because there are so much
Zopistas ? I would love to think so. But I fear it's because the ZDP is
still so young (they yell for help not far from here), and you, you're
very cute Python programmers, but couldn't help but mess python purity
to get things running as you wanted. With Python, it rolls; with Zope it
sometimes roll, but then it's so good, mmmh ? There are lots of strange
features, black magic. At least for most of your users, some may have
better eyes.

Act3

And now, you think you're ready to bite in the Perl apple. I would have
think you could grow a little stronger before attracting foreign
intricacy, increasing product support needs. Python helps you, I hope
you're strong enough with such a weapon to grow up and to firm up at the
same time.
I hope you see now I'm not fighting against Perl, COM or CORBA. I fear
nor hate either. It's about you and us, your community. You do anything
to broaden your base and you say we won't be splashed ? Will we gain or
loose if you succeed in attracting Perl developers (I don't predict a
big rush, they are so shy :-) Will Zope be stronger or messier.

It's a political choice. 

If you don't fear some losses in your ranks, provided you get new strong
soldiers further, all right, that's a good choice, you're rational.
After all, product support is your job, you'll have more work
opportunities so.

If you love Python because Python is also CP4E, if you'd love Zope to be
WP4E (Web Publication for Everybody), you're running too fast. From here
where I sit, it looks like the RedHat Syndrom. I hope I'm wrong. I hope
it's just because I'm getting old and I fear that juvenile impatience. 

Epilog
==
Explicit is better than Implicit.

I give you the mike, tell us what your priorities are, what you do want
to achieve. So, you'll be "unequivocal", we'll know you better. "The
synergy between the decision to go open source and the increase in
revenue is direct. It's astounding," Everitt said(*). What next ?
Lucrative open source or real Zen ?
 
(*) Linux Journal 
http://www.linux-mag.com/cgi-bin/printer.pl?issue=2000-01article=venture

-- 
Denis Frère
P3B: Club Free-Pytho-Linuxien Carolorégien http://www.p3b.org
Aragne : Internet - Réseaux - Formations  http://www.aragne.com

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