[Zope] Re: login page problem

2005-03-30 Thread prabuddha ray
thnx dieter n chris,
i cudnt make my point clear.
1st a recap : i've a zpt login page wherein i have got the district
name n coressponding users drop down list built.
now after selecting d district n username d passwd is to b filled.
then d form is to b submitted. 
It has to be done thid way only so i cant hav cookie crumblers n
simpleuserfolder componenets.

now my problem how n where do i check d pwd n redirect to the next zpt
or the previous one if its wrong.
i've a zsql method giving me the pwd for the user param passed.
i wanted to kno if i can call this method on d onsubmit event?
kindly gimme solns u've in mind.




On Wed, 30 Mar 2005 20:01:24 +0200, Dieter Maurer <[EMAIL PROTECTED]> wrote:
> prabuddha ray wrote at 2005-3-29 01:57 -0800:
> >I'm creatin a customised login page template using districtname, user
> >name and password.
> >i got halt in d logic for password checking. 
> >after submitting d login form how do i call d same page if the passwd
> >is wrong along with d req params passed? do i need an ext python
> >script for this redirection.
> 
> No, you can do it where you checked the password.
> 
> >also tell how to set session data in ZPTs from the form fields?
> 
>   
> 
> -- 
> Dieter
> 

-- 
Share the vision of difference with ME
___
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: next part of tal:atrributes problem

2005-03-31 Thread prabuddha ray
for lennart n anrdeas,
 sir, i had built this page in asp earlier n now need to create a zpt ver.
d javascript function used for submit is below:

function sub_click(){
document.nlogin.login.value='y' // 'login' is flag for valid login n
not bein used in zpt till now.
document.nlogin.action='c_nlogged' // 'c_nlooged' the python script
meant to handle the pwd validation n redirection to next page or bact
to the current page.
document.nlogin.method='post'
document.nlogin.submit()
}



below is python script c_nlogged:

request = container.REQUEST
RESP =  request.RESPONSE

passwd = request.password1
user = request.username,

if container.chkpwd(uname=user,pwd=passwd): //getting sysntax error here.
RESP.redirect(/store_nic/consumables/c_menu)
else:
RESP.redirect(/store_nic/consumables/index_html)

below is zsql method chkpwd :

select distinct(password) from c_userdet where 
username=
and
password=

i wanted to avoid d middle python script n handle the pwd validation
in the same zpt .
is it possible.
i have carry req vars eg. username pwd ,districtname in session for future use.

plz giv soln .





On Tue, 29 Mar 2005 19:07:00 +0200, Andreas Pakulat <[EMAIL PROTECTED]> wrote:
> On 29.Mär 2005 - 05:39:42, prabuddha  ray wrote:
> > Danke Jürgen,
> >one tip i'm lookin for is how to cal pyhton scripts on any form
> event, 
> > ie. like we call javascripts on the onclick or onsubmit or onchange
> events?
> >   thanks again.
> 
> You can't. Python and JavaScript are completely different things.
> JavaScript runs on the client side, whereas Python runs on the server.
> However, you probably can use your JavaScript to call a python Script,
> but I wouldn't suspect that it works the same as with JavaScript
> alone. Python Scripts are executed when you send them a Request or by
> calling them from within another python script (or TAL or DTML
> statement)
> 
> Andreas
> 
> -- 
> You have an ambitious nature and may make a name for yourself.
> ___
> 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 )
> 

-- 
Share the vision of difference with ME
___
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: next part of tal:atrributes problem

2005-03-31 Thread prabuddha ray
for lennart n anrdeas,
 sir, i had built this page in asp earlier n now need to create a zpt ver.
d javascript function used for submit is below:

function sub_click(){
document.nlogin.login.value='y' // 'login' is flag for valid login n
not bein used in zpt till now.
document.nlogin.action='c_nlogged' // 'c_nlooged' the python script
meant to handle the pwd validation n redirection to next page or bact
to the current page.
document.nlogin.method='post'
document.nlogin.submit()
}



below is python script c_nlogged:

request = container.REQUEST
RESP =  request.RESPONSE

passwd = request.password1
user = request.username,

if container.chkpwd(uname=user,pwd=passwd): //getting sysntax error here.
RESP.redirect(/store_nic/consumables/c_menu)
else:
RESP.redirect(/store_nic/consumables/index_html)

below is zsql method chkpwd :

select distinct(password) from c_userdet where 
username=
and
password=

i wanted to avoid d middle python script n handle the pwd validation
in the same zpt .
is it possible.
i have carry req vars eg. username pwd ,districtname in session for future use.

plz giv soln .





On Tue, 29 Mar 2005 19:07:00 +0200, Andreas Pakulat <[EMAIL PROTECTED]> wrote:
> On 29.Mär 2005 - 05:39:42, prabuddha  ray wrote:
> > Danke Jürgen,
> >one tip i'm lookin for is how to cal pyhton scripts on any form
> event, 
> > ie. like we call javascripts on the onclick or onsubmit or onchange
> events?
> >   thanks again.
> 
> You can't. Python and JavaScript are completely different things.
> JavaScript runs on the client side, whereas Python runs on the server.
> However, you probably can use your JavaScript to call a python Script,
> but I wouldn't suspect that it works the same as with JavaScript
> alone. Python Scripts are executed when you send them a Request or by
> calling them from within another python script (or TAL or DTML
> statement)
> 
> Andreas
> 
> -- 
> You have an ambitious nature and may make a name for yourself.
> ___
> 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 )
> 

-- 
Share the vision of difference with ME
___
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: thanks for tal:atrributes problem

2005-03-31 Thread prabuddha ray
wats wrong with the given puthon script

request = container.REQUEST
RESP =  request.RESPONSE

passwd = context.request.password1
user = context.request.username,

if(container.chkpwd(uname=user,pwd=passwd)):
RESP.redirect(/store_nic/consumables/test) // syntax errror.
else:
RESP.redirect(/store_nic/consumables/index_html)




On Tue, 29 Mar 2005 19:07:00 +0200, Andreas Pakulat <[EMAIL PROTECTED]> wrote:
> On 29.Mär 2005 - 05:39:42, prabuddha  ray wrote:
> > Danke Jürgen,
> >one tip i'm lookin for is how to cal pyhton scripts on any form
> event, 
> > ie. like we call javascripts on the onclick or onsubmit or onchange
> events?
> >   thanks again.
> 
> You can't. Python and JavaScript are completely different things.
> JavaScript runs on the client side, whereas Python runs on the server.
> However, you probably can use your JavaScript to call a python Script,
> but I wouldn't suspect that it works the same as with JavaScript
> alone. Python Scripts are executed when you send them a Request or by
> calling them from within another python script (or TAL or DTML
> statement)
> 
> Andreas
> 
> -- 
> You have an ambitious nature and may make a name for yourself.
> ___
> 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 )
> 

-- 
Share the vision of difference with ME
___
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] script python error

2005-03-31 Thread prabuddha ray
 wats wrong with the given puthon script
 
 request = container.REQUEST
 RESP =  request.RESPONSE
 
 passwd = context.request.password1
 user = context.request.username,
 
 if(container.chkpwd(uname=user,pwd=passwd)):
RESP.redirect(/store_nic/consumables/test) // syntax errror.
 else:
RESP.redirect(/store_nic/consumables/index_html)
 
 
 
 
 On Tue, 29 Mar 2005 19:07:00 +0200, Andreas Pakulat <[EMAIL PROTECTED]> wrote:
> > On 29.Mär 2005 - 05:39:42, prabuddha  ray wrote:
> > > Danke Jürgen,
> > >one tip i'm lookin for is how to cal pyhton scripts on any form
> > event, 
> > > ie. like we call javascripts on the onclick or onsubmit or onchange
> > events?
> > >   thanks again.
> > 
> > You can't. Python and JavaScript are completely different things.
> > JavaScript runs on the client side, whereas Python runs on the server.
> > However, you probably can use your JavaScript to call a python Script,
> > but I wouldn't suspect that it works the same as with JavaScript
> > alone. Python Scripts are executed when you send them a Request or by
> > calling them from within another python script (or TAL or DTML
> > statement)
> > 
> > Andreas
> > 
> > -- 
> > You have an ambitious nature and may make a name for yourself.
> > ___
> > 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 )
> > 
> 
> -- 
> Share the vision of difference with ME
> 

-- 
Share the vision of difference with ME
___
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: login page problem

2005-04-02 Thread prabuddha ray
Its been very kind of u all to be critical  about a newbie like me.
I'll definitely lookout for those ettiquetes.

My python script error got solved as i missed the silly ' ' in the
response.redirect statemnet.
I set the user and pwd request vars in sesson var.

Tried cookie crumbler and MysqlUserFolder and UserFolder also but they
all need to changed much and my requirements are diffrent.

I'm building a trial govt. site for stores management which was built
previously in ASP.
The login page takes the districtname , username and passwd .
according to the type of user different menus are displayed.

For this i need to have the  districtname , username and passwd 
carried on throughout the session.

my current requirement is to pass the session vars through the python
script which is the action of the login form.

I've gone through the zopebook but dint find much help there.

can u plz tell me where do i get to know about pythopn scripting done
in zope n ZPT examples.

i'm really sorry for my erronous language. please dont overlook theese
humble requests.

On Fri, 1 Apr 2005 23:07:38 +0200, Dieter Maurer <[EMAIL PROTECTED]> wrote:
> prabuddha ray wrote at 2005-3-30 23:50 -0800:
> > ...
> >now my problem how n where do i check d pwd n redirect to the next zpt
> >or the previous one if its wrong.
> 
> Apparently, you need some background reading...
> 
> Especially, you need to understand that HTTP is a stateless
> protocol and *EACH* request must somehow perform its own
> authentication. That's why usually login information is
> (somehow) coded in a cookie.
> 
> You really should follow the advice to look at an existing
> UserFolder (they are responsible for authentication).
> You may need to adapt/extend an existing UserFolder.
> 
> 
> -- 
> Dieter
> 

-- 
Share the vision of difference with ME
___
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: login page problem

2005-04-04 Thread prabuddha ray
Hi list,
never before i got such a holistic advice.
thanks so much Cliff.

About the 1st mail,

On Sat, 02 Apr 2005 17:03:56 +0100, Cliff Ford <[EMAIL PROTECTED]> wrote:
> Customisation of the login sequence is quite difficult for Newbies
> because there are lots of different ways to approach the problem - you
> have already tried some. I suspect that trying to match what was done in
> PHP may be part of your problem. It would be helpful to know if your
> lists of users are coming from one source, like a database table, or
> multiple sources, like multiple tables or different databases, and
> whether users are unique in each district

I dint want to built customized login page in 1st place. Actually this
is a Govt. stores management site used in my state only bulit all in
ASP. I 've to convert this into a Zope and Plone version.
So i wanted to get it converted with minimun changes.
But now as you say i think I should go the way Zope does it . only
that i'm finding it hard to customize it in Zope.

1> the district name and their users come from 2 seperate Mysql
tables. the users are unique in each district.

> From there you decide your
> zope folder structure. It could be like this:
>
> site_home
> |__acl_users
> |__district1
> |__district2
>
> or like this:
>
> site_home
> |__district1
> ||__acl_users
> |__district2
> ||__acl_users
>
> In the second case you would not have to worry about asking the user for
> the district name. In the first case you would get a district name or a
> user defined role for that district from a supplementary data source,
> like a database.

So i think 2nd structure is abetter fit.
Now the qusetion is how do build this district user folder structure
using the database?
Hope not manually, because there are 22 districts and about 15 users
in each of them pluys head quarters.

> A combination of exUserFolder and MySQL would do.

i don know about them, something like mysqluserfolder or
simpleuserfolder components ?

> You can get information on the logged in user (Username and Roles) from
> the User object, so you don't need to expicitly use sessions at this
> stage. You should certainly not store passwords - that would be a 
> serious breach of confidentiality.
> Maybe you should say what you do with the District parameter after the
> user has logged in.

I dont need the password but do need the username and district for
following pages to decide the access rights and the stores available
inthe districts , also for some report labels.

> Giving advice or examples on ZPT and Python for an
> approach that is probably wrong is just too time-consuming.
>
> Cliff

i dint get to know much about coding ZPT's and Script(Python) for them,
 from the ZPT refs and Zopebook. So wanted some simple working examples.

About 2nd mail,

On Sun, 03 Apr 2005 09:39:01 +0100, Cliff Ford <[EMAIL PROTECTED]> wrote:
> I have been trying to think of ways of providing specific pointers, So, 
> assuming you have a custom login page and a custom python script that 
> processes that page:
> 
> In the Python script you could set a cookie for the District:
> 
> context.REQUEST.RESPONSE.setCookie('District', district)
> 
> where district is the name of the District field in the form. The 
> District parameter is then always available to your page templates and 
> scripts in the REQUEST object.
> 
> At the end of your login script you would typically redirect to some 
> specific page like this:
> 
> return context.REQUEST.RESPONSE.redirect('aURL')
> 
> in exUserFolder you don't have to do anything else - the login works by 
> magic, which is very confusing.


Are these above said things not possible in exUserFolder. how do i
customize it for my problem?

> 
> Now for the problems:
> 
> If the login is wrong the system will call /standard_error_message, so 
> you have to customise that to send the user back to the login form with 
> a Login failed message.
> 
> If the user bookmarks a protected page and tries to jump to it without 
> being logged in, the system will call the login sequence starting in 
> acl_users, so you have to customise that to call your own login page.
> 
> After the user has logged in, whenever you need to get the Username you 
> would typically use a python script like this:
> 
> from AccessControl import getSecurityManager
> return getSecurityManager().getUser().getUserName()
> 
> HTH
> 
> Cliff

So this is what can be done if I use exUserFolder ?
Hope a reply soon.
-- 
Share the vision of difference with ME
___
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: login page problem

2005-04-05 Thread prabuddha ray
Hi list,
 I've got some clarifications given below.

On Mon, 04 Apr 2005 16:08:50 +0100, Cliff Ford <[EMAIL PROTECTED]> wrote:
> I am abstracting bits of your email below in case anyone else wants to 
> join in.
> 
> If you are going to use Plone I can't offer advice - I have looked at 
> Plone on three separate occasions, and recently read The Definitive 
> Guide to Plone, and have stil decided not to use it. I only say this to 
> make it clear that many applications are built without CMS and Plone.
> 

I had no idea about this. i knew that zope acts as a app server and
plone is the front end tool.
In fact I'm building the store's site as a plone site in zope. As a
matter of fact i've not done much specific in plone . just built 2
tabpanes.
I configured the exUserFolder using the mysql database and as expected
it built up a seperate login system. so i believe it'll work on itself
without plone.
One problem that concerns next query is that it took only one table
for user details whereas i had one more table for district.

> 
> Two separate tables with User information is awkward! The user folders I 
> know of expect user information to come from one source. So you either 
> have to create two folders, each with its own acl_users (provided by one 
> of the User Folder Products), or you have to hack the User Folder 
> product to put in a Union select statement in place of a simple Select.
> d quarters.

let me explain the login page flow. a dropdown list of districts is
available on load. on selecting a  district the page reloads and the
available users are listed in 2nd dropdown list.
after selecting the user the password is to be given. So that way i
need both the 'district' and the 'userdetail' table. actually the
district table has district code ,name and other stores related nfo.
userdetail table is linked using this district code.

> 
> You have not said whether the people in the different districts do 
> completely different things with different forms, or identical things 
> but specifying the district. If the former then it is no big deal to 
> create the folders manually, although it can be done programmtically. 
> You could set a Local Role equal to the district name and get that role 
> for users from the database. That way, users can only enter their own 
> district folder. If the latter, then you could retrieve the Username and 
> District from the User object for use in the forms (include the District 
> as a role).
> 

users are of different level like store-in-charge, sys mgmt group,
vendors and normal users.
they are in all the districts. so depending on the user level diffrent
set of menu page are to be generated ie. users of same level in
diferent districts do same thing.
In earlier ASP version I handled this in the login page handler ASP
page and wanted to use the same logic here.
district shouldn't be the user role , 'userlevel' will act as user role here.
but the folders would be districtwise, I suppose.

honestly I'm little bogged out by the exuserFolder feature, its using
Dtml all the way and I'm sticking to ZPTs and script pythons.


> Try working on the rest of your application to build up ZPT and Python 
> experience. As I said, managing users is tricky. Also, be aware that 
> Zope experts advise developers to produce file system based Products. 
> There are lots of simple Products that you can use and browse the code 
> to see how they work.
> 
> Cliff
>

I completely understand this. but the problem remains the same . how
do i customise these products acccording to my needs.

hope this helps you in helping me. waiting for your reply.

-- 
Share the vision of difference with ME
___
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: login page problem

2005-04-05 Thread prabuddha ray
HI Cliff,
  I was hoping another reply eagerly. hope you dint give up on me.

I've got some clarifications given below.

On Mon, 04 Apr 2005 16:08:50 +0100, Cliff Ford <[EMAIL PROTECTED]> wrote:
> I am abstracting bits of your email below in case anyone else wants to
> join in.
>
> If you are going to use Plone I can't offer advice - I have looked at
> Plone on three separate occasions, and recently read The Definitive
> Guide to Plone, and have stil decided not to use it. I only say this to
> make it clear that many applications are built without CMS and Plone.
>

I had no idea about this. i knew that zope acts as a app server and
plone is the front end tool.
In fact I'm building the store's site as a plone site in zope. As a
matter of fact i've not done much specific in plone . just built 2
tabpanes.
I configured the exUserFolder using the mysql database and as expected
it built up a seperate login system. so i believe it'll work on itself
without plone.
One problem that concerns next query is that it took only one table
for user details whereas i had one more table for district.

>
> Two separate tables with User information is awkward! The user folders I
> know of expect user information to come from one source. So you either
> have to create two folders, each with its own acl_users (provided by one
> of the User Folder Products), or you have to hack the User Folder
> product to put in a Union select statement in place of a simple Select.
> d quarters.

let me explain the login page flow. a dropdown list of districts is
available on load. on selecting a  district the page reloads and the
available users are listed in 2nd dropdown list.
after selecting the user the password is to be given. So that way i
need both the 'district' and the 'userdetail' table. actually the
district table has district code ,name and other stores related nfo.
userdetail table is linked using this district code.

>
> You have not said whether the people in the different districts do
> completely different things with different forms, or identical things
> but specifying the district. If the former then it is no big deal to
> create the folders manually, although it can be done programmtically.
> You could set a Local Role equal to the district name and get that role
> for users from the database. That way, users can only enter their own
> district folder. If the latter, then you could retrieve the Username and
> District from the User object for use in the forms (include the District
> as a role).
>

users are of different level like store-in-charge, sys mgmt group,
vendors and normal users.
they are in all the districts. so depending on the user level diffrent
set of menu page are to be generated ie. users of same level in
diferent districts do same thing.
In earlier ASP version I handled this in the login page handler ASP
page and wanted to use the same logic here.
district shouldn't be the user role , 'userlevel' will act as user role here.
but the folders would be districtwise, I suppose.

honestly I'm little bogged out by the exuserFolder feature, its using
Dtml all the way and I'm sticking to ZPTs and script pythons.


> Try working on the rest of your application to build up ZPT and Python
> experience. As I said, managing users is tricky. Also, be aware that
> Zope experts advise developers to produce file system based Products.
> There are lots of simple Products that you can use and browse the code
> to see how they work.
>
> Cliff
>

I completely understand this. but the problem remains the same . how
do i customise these products acccording to my needs.

hope this helps you in helping me. waiting for your reply.
-- 
Share the vision of difference with ME
___
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] login system discussion

2005-04-06 Thread prabuddha ray
I'm often failing to describe problems correctly,
   kindly bear for that.

lets revise,
  In my login page I've two tables used district and userdetail.
district table ( district_code, distname,  location ...)
userdetail (username ,password, empcode ,district_code ,ulevel ...)

user to district is n:1 mapping. 
So I need to have both these tables info in the XUF.

Anyway, i'm trying cookies as advised.
tell me how do i set a request var in my python script.
i tried : 
 request.set('invalid','1') 
 return context.REQUEST.RESPONSE.redirect('index_html') // back to login page

I'm using 'invalid' hidden field to display the 'login failure' msg.

// define 

Invalid Password .Re Type//msg 

nothing is happening


I'm working hard to get it done in Zope's way plz help
-- 
Share the vision of difference with ME
___
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] login system discussion

2005-04-06 Thread prabuddha ray
I'm often failing to describe problems correctly,
   kindly bear for that.

lets revise,
  In my login page I've two tables used district and userdetail.
district table ( district_code, distname,  location ...)
userdetail (username ,password, empcode ,district_code ,ulevel ...)

user to district is n:1 mapping. 
So I need to have both these tables info in the XUF.

Anyway, i'm trying cookies as advised.
tell me how do i set a request var in my python script.
i tried : 
 request.set('invalid','1') 
 return context.REQUEST.RESPONSE.redirect('index_html') // back to login page

I'm using 'invalid' hidden field to display the 'login failure' msg.

// define 

Invalid Password .Re Type//msg 

nothing is happening


I'm working hard to get it done in Zope's way plz help

-- 
Share the vision of difference with ME
___
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] login system discussion

2005-04-06 Thread prabuddha ray
ok, i get it.
So what is the way to set a request form var in the python script.


On Wed, 6 Apr 2005 12:55:33 -0300, Jose Henrique dos Reis
<[EMAIL PROTECTED]> wrote:
> Your request.set puts 'invalid' in request/other, not in request/form.
> 
> Zenrique

-- 
Share the vision of difference with ME
___
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: RES: [Zope] login system discussion

2005-04-06 Thread prabuddha ray
Ok i get it,

  please tell me the way to set a request form var in a python script

On Wed, 6 Apr 2005 12:55:33 -0300, Jose Henrique dos Reis
<[EMAIL PROTECTED]> wrote:
> Your request.set puts 'invalid' in request/other, not in request/form.
> 
> Zenrique
> 

-- 
Share the vision of difference with ME
___
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] request forward technique

2005-04-07 Thread prabuddha ray
>From my login page I'm calling a python script for redirecting it to
seperate pages.
there if login fails i the login page is to be redirected along with
setting a hidden form field 'invalid' by '1'.
For this I've to set the request/form.invalid value so that it is
available to thelogin page.

is it possible to set the request values from a page and return them
back to the same page?

-- 
Share the vision of difference with ME
___
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] how to add pages to a new tab in plone

2005-04-07 Thread prabuddha ray
hope i get this through !!!

In my plone site I've added a portal_tab through portal_actions.
i've made a subfolder in my plone site root folder for it.

I gave the path in the action value field of the tabs as :
string:$portal_url/consumables

now the problem is that when i click on my tab the index_html zpt
opens seperately as a new page unlike the home tab's index page which
opens inside the plone site .

i want the pages in my tab to added as the plone site's content, not seperately.
how do i do it.

-- 
Share the vision of difference with ME
___
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] how to store ZSQL query results in a python var

2005-04-07 Thread prabuddha ray
from a newbie,
i've this ZSQLmethod returning me a string  only. how do i
store it a var in my python script.
eg., userlevel = container.getUserLevel(uname=user)

when i print it using html_quote as : 
   print "(%s)" % html_quote(userlevel)
return printed
output is :
 ()

please help.
-- 
Share the vision of difference with ME
___
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] how to set value of hidden form field by a cookie

2005-04-08 Thread prabuddha ray
I've to set the value of a hidden form field by a cookie value.

e.g; invalidval request/cookies/login|nothing;
 i tried this :

and also this 


but it is rendering the text in quotes directly.
what is the correct way.

-- 
Share the vision of difference with ME
___
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: RES: [Zope] login system discussion

2005-04-08 Thread prabuddha ray
Thanks the request var is set but the next line for redirection 
ie. return context.index_html renders a new page with text :

  

is there some object in context which refers to the self page.
plz help.


On Thu, 7 Apr 2005 11:22:25 -0300, Jose Henrique dos Reis
<[EMAIL PROTECTED]> wrote:
> I think that request.form['variable'] = value, could solve your problem.
> 
> I think that RESPONSE.redirect creates another REQUEST object, so all the
> changes you made in your script are lost.  You can use "return
> context.index_html", instead, to preserve the REQUEST.
> 

-- 
Share the vision of difference with ME
___
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: RES: [Zope] login system discussion

2005-04-08 Thread prabuddha ray
Thanks it was silly of me . I assure I'll take care of the advise


On Sat, 9 Apr 2005 11:28:58 +1200, Phillip Hutchings <[EMAIL PROTECTED]> wrote:
> On Apr 9, 2005 12:34 AM, prabuddha ray <[EMAIL PROTECTED]> wrote:
> > Thanks the request var is set but the next line for redirection
> > ie. return context.index_html renders a new page with text :
> > 
> >   
> > 
> > is there some object in context which refers to the self page.
> > plz help.
> 
> Try context.index_html() - You need the brackets to tell Python to run
> the Script rather than returning the object.
> 
> You do realise that the answers to most of your questions are in the
> Zope book? Try reading it and experimenting before emailing this list
> -  we're not your personal help desk.
> -- 
> Phillip Hutchings
> http://www.sitharus.com/
> [EMAIL PROTECTED] / [EMAIL PROTECTED]
> 

-- 
Share the vision of difference with ME
___
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] newbie:cookie expiry problem

2005-04-12 Thread prabuddha ray
This may be very silly plz help
I gave this cookie expiry statement in a python script:


RESPONSE.expireCookie('login')

return context.REQUEST.RESPONSE.redirect('index_html')

but when i checked the cookie values in request page, it wasn't removed. 
the last redirect still worked.

when i put an if like this :
if (RESPONSE.expireCookie('login'))

return context.REQUEST.RESPONSE.redirect('index_html')

redirect dont work.

where am i wrong.
-- 
Share the vision of difference with ME
___
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] newbie:cookie expiry problem

2005-04-12 Thread prabuddha ray
This may be very silly plz help
I gave this cookie expiry statement in a python script:

RESPONSE.expireCookie('login')

return context.REQUEST.RESPONSE.redirect('index_html')

but when i checked the cookie values in request page, it wasn't removed. 
the last redirect still worked.

when i put an if like this :
if (RESPONSE.expireCookie('login'))

return context.REQUEST.RESPONSE.redirect('index_html')

redirect didn't work. where am i wrong?
all the files are in same folder

-- 
Share the vision of difference with ME
___
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] newbie : select tag value setting problem

2005-04-13 Thread prabuddha ray
I've this 'district' select tag .I'm getting the values usinga ZSQL method.
I want to set the value of the option by the district code and the
display the district name.

I tried this :


 



the drop down list is getting the district names but value is being
set only once.
i checked the request values and its giving the 1st list value everytime.

plz tell me how should i use the tal:attribute tag here so as to get
both the 'value' and the 'name' values as a list.
-- 
Share the vision of difference with ME
___
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: newbie : select tag value setting problem

2005-04-13 Thread prabuddha ray
Thanks for the suggestion,

I added the 'value district/district_code' now only. 'selected' is
working fine . if i remove the 'value' thing its working fine.

i also tried this ; 
option tal:attributes="selected 
python:test(distname==district.district_name, 'selected','');
  value district/district_code"  tal:content="district/district_name">


as for the 'distname' test value() the def is:


plz suggest.


On 4/13/05, Andreas Jung <[EMAIL PROTECTED]> wrote:
> 
> 
> --On Mittwoch, 13. April 2005 2:14 Uhr -0700 prabuddha ray 
> <[EMAIL PROTECTED]> wrote:
> 
> > I've this 'district' select tag .I'm getting the values usinga ZSQL
> > method. I want to set the value of the option by the district code and
> the
> > display the district name.
> >
> > I tried this :
> > 
> > 
> >  
> > 
> > 
> >
> > the drop down list is getting the district names but value is being
> > set only once.
> > i checked the request values and its giving the 1st list value everytime.
> 
> - either your test() always evaluates to false
> 
> - try tal:attributes="SELECTED (in upper case)
> 
> >
> > plz tell me how should i use the tal:attribute tag here so as to get
> > both the 'value' and the 'name' values as a list.
> > --
> 
> What does this mean?
> 
> -aj
> 

-- 
Share the vision of difference with ME
___
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: newbie : select tag value setting problem

2005-04-13 Thread prabuddha ray
sorry sir ,
  don bother about this problem solved.
 i made a silly mistake in passing the parameter in the ZSQL method.
 plz bear with me. 


On 4/13/05, prabuddha ray <[EMAIL PROTECTED]> wrote:
> Thanks for the suggestion,
> 
> I added the 'value district/district_code' now only. 'selected' is
> working fine . if i remove the 'value' thing its working fine.
> 
> i also tried this ; 
> option tal:attributes="selected 
> python:test(distname==district.district_name, 'selected','');
>   value district/district_code"  tal:content="district/district_name">
> 
> 
> as for the 'distname' test value() the def is:
> 
> 
> plz suggest.
> 
> 
> On 4/13/05, Andreas Jung <[EMAIL PROTECTED]> wrote:
> > 
> > 
> > --On Mittwoch, 13. April 2005 2:14 Uhr -0700 prabuddha ray 
> > <[EMAIL PROTECTED]> wrote:
> > 
> > > I've this 'district' select tag .I'm getting the values usinga ZSQL
> > > method. I want to set the value of the option by the district code and
> > the
> > > display the district name.
> > >
> > > I tried this :
> > > 
> > > 
> > >  
> > > 
> > > 
> > >
> > > the drop down list is getting the district names but value is being
> > > set only once.
> > > i checked the request values and its giving the 1st list value
> everytime.
> > 
> > - either your test() always evaluates to false
> > 
> > - try tal:attributes="SELECTED (in upper case)
> > 
> > >
> > > plz tell me how should i use the tal:attribute tag here so as to get
> > > both the 'value' and the 'name' values as a list.
> > > --
> > 
> > What does this mean?
> > 
> > -aj
> > 
> 
> -- 
> Share the vision of difference with ME
> 

-- 
Share the vision of difference with ME
___
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] how to save page content to a word file.

2005-04-20 Thread prabuddha ray
this again is a simple problem which got tricky for me.
  I've full page template taking parameters to generate a printable report.
Another button on this page is for saving the report to a doc file.
How can i do this in a ZPT?

-- 
Share the vision of difference with ME
___
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] small tal tip needed.

2005-05-17 Thread prabuddha ray
-- 
Share the vision of difference with ME
___
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] how to accumulate data using ZPT

2005-05-20 Thread prabuddha ray
I've this report wherein i've to print the column total iin last row.
column values are from database.
so far I'm a total loss. do i need to have cookies to store this total?

plz gimme ideas.

-- 
Share the vision of difference with ME
___
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: how to accumulate data using ZPT

2005-05-20 Thread prabuddha ray
sorry for delay, 
 but the options you gave are ruled out.
actually not all the rows in the column have the values.
further the total i'm looking for will result in a very complex query 
that i dont want to do onsidering the no. of rows are high.
  
  I just need something like a var in my ZPT which can just sum up the
values if they  are present.
value's prsence i'm checking using tal:condition but how to add the
value repeatedly in the sum var.

kindly help.



On 5/20/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> Am Freitag, den 20.05.2005, 10:36 +0100 schrieb Hugo Ramos:
> > On 5/20/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> > > Am Freitag, den 20.05.2005, 09:52 +0100 schrieb Hugo Ramos:
> > > > Yellow,
> > > >
> > > > What DBMS are you using??? MySQL???
> > > > If so just have a sql method do this:
> > > > ==
> > > > SELECT COUNT( '*' )  AS total
> > > > FROM yourtable
> > > > ==
> > > 
> > > Are you sure about the ' '? looks strange.
> > 
> > It works both ways... With or without the ' ' !
> > 
> well. another reason to avoid mysql I guess ;)
> 
> 
> 
> 


-- 
Share the vision of difference with ME
___
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: how to accumulate data using ZPT

2005-05-20 Thread prabuddha ray
thanks that was creative and justified. BUT it didnt work.
the total is still 0.

 here is what i did.


 
  
 Total


please tip me where I'm going wrong



On 5/20/05, Deepak <[EMAIL PROTECTED]> wrote:
> 
> Hi Prabuddha,
>
> check this ...
> 
> 
> 
> 
> 
> 
> 
> thanks,
> 
> Deepak
> 
> prabuddha ray wrote:
> 
> >sorry for delay, 
> > but the options you gave are ruled out.
> >actually not all the rows in the column have the values.
> >further the total i'm looking for will result in a very complex query 
> >that i dont want to do onsidering the no. of rows are high.
> >  
> >  I just need something like a var in my ZPT which can just sum up the
> >values if they  are present.
> >value's prsence i'm checking using tal:condition but how to add the
> >value repeatedly in the sum var.
> >
> >kindly help.
-- 
Share the vision of difference with ME
___
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: how to accumulate data using ZPT

2005-05-20 Thread prabuddha ray
sorry for the last mail. it was a simple tag order mistake .

final version is :
  
 
 Total


plz be in touch it'll good for this newbie.
 thanks again

On 5/20/05, prabuddha ray <[EMAIL PROTECTED]> wrote:
> thanks that was creative and justified. BUT it didnt work.
> the total is still 0.
> 
>  here is what i did.
> 
>   tal:condition="not:penaltylen" tal:content="unit_cost" >
>  
>   
>  Total
> 
> 
> please tip me where I'm going wrong
> 
> 
> 
> On 5/20/05, Deepak <[EMAIL PROTECTED]> wrote:
> > 
> > Hi Prabuddha,
> >
> > check this ...
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > thanks,
> > 
> > Deepak
> > 
> > prabuddha ray wrote:
> > 
> > >sorry for delay, 
> > > but the options you gave are ruled out.
> > >actually not all the rows in the column have the values.
> > >further the total i'm looking for will result in a very complex query 
> > >that i dont want to do onsidering the no. of rows are high.
> > >  
> > >  I just need something like a var in my ZPT which can just sum up the
> > >values if they  are present.
> > >value's prsence i'm checking using tal:condition but how to add the
> > >value repeatedly in the sum var.
> > >
> > >kindly help.
> -- 
> Share the vision of difference with ME
> 


-- 
Share the vision of difference with ME
___
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: how to accumulate data using ZPT

2005-05-24 Thread prabuddha ray
 ok this is again freaky on my part.

my problem still remains intact .as i've told earlier,
in my ZPT I needed to find a way to sum up column values 
if they are present and print the total at the last row.

I tried this as a Deepak pal tipped :



 Total 

 but what happens is obvious , for reports where even one row has the
unitcost missing followiing error comes up:

"tuple indx out of range"

when i changed tghe span tgs alike this :





no error was there but the total remained 0.

No ZSQLmethod can be used to get the sum coz its pretty complex.

 so plz rethink the code I'm also trying hard.
 hope for a reply soon
 
> On 5/20/05, Deepak <[EMAIL PROTECTED]> wrote:
> > 
> > Hi Prabuddha,
> >
> > check this ...
> > 
> > 
> > 
> >     
> > 
> > 
> > 
> > thanks,
> > 
> > Deepak
> > 
> > prabuddha ray wrote:
> > 
> > >sorry for delay, 
> > > but the options you gave are ruled out.
> > >actually not all the rows in the column have the values.
> > >further the total i'm looking for will result in a very complex query 
> > >that i dont want to do onsidering the no. of rows are high.
> > >  
> > >  I just need something like a var in my ZPT which can just sum up the
> > >values if they  are present.
> > >value's prsence i'm checking using tal:condition but how to add the
> > >value repeatedly in the sum var.
> > >
> > >kindly help.
> > >
> > >
> > >
> > >On 5/20/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> > >  
> > >
> > >>Am Freitag, den 20.05.2005, 10:36 +0100 schrieb Hugo Ramos:
> > >>
> > >>
> > >>>On 5/20/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> > >>>  
> > >>>
> > >>>>Am Freitag, den 20.05.2005, 09:52 +0100 schrieb Hugo Ramos:
> > >>>>
> > >>>>
> > >>>>>Yellow,
> > >>>>>
> > >>>>>What DBMS are you using??? MySQL???
> > >>>>>If so just have a sql method do this:
> > >>>>>==
> > >>>>>SELECT COUNT( '*' )  AS total
> > >>>>>FROM yourtable
> > >>>>>==
> > >>>>>  
> > >>>>>
> > >>>>Are you sure about the ' '? looks strange.
> > >>>>
> > >>>>
> > >>>It works both ways... With or without the ' ' !
> > >>>
> > >>>  
> > >>>
> > >>well. another reason to avoid mysql I guess ;)
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >
> > >
> > >  
> > >
> > 
> > 
> > 
> 


-- 
Share the vision of difference with ME
___
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: how to accumulate data using ZPT

2005-05-24 Thread prabuddha ray
sorry,
i missed the xplanaition.
i think this'll explain...


so not:penaltylen ensures that unit_cost is present for this row.

anyway i think this worked finally :
 
  
  
 



thanks deepak

On 5/24/05, Deepak <[EMAIL PROTECTED]> wrote:
> 
> What r those "penaltylen" and "penalty"? and also can u tell us y u r 
> checking  "not:penaltylen"?
> 
> regards,
> Deepak
> 
> prabuddha ray wrote:
> 
> > ok this is again freaky on my part.
> >
> >my problem still remains intact .as i've told earlier,
> >in my ZPT I needed to find a way to sum up column values 
> >if they are present and print the total at the last row.
> >
> >I tried this as a Deepak pal tipped :
> >
> > tal:content="python:penalty[0].unit_cost"/>
> >
> > Total 
> >
> > but what happens is obvious , for reports where even one row has the
> >unitcost missing followiing error comes up:
> >
> >"tuple indx out of range"
> >
> >when i changed tghe span tgs alike this :
> >
> > tal:content="python:penalty[0].unit_cost">
> >
> >
> >
> >no error was there but the total remained 0.
> >
> >No ZSQLmethod can be used to get the sum coz its pretty complex.
> >
> > so plz rethink the code I'm also trying hard.
> > hope for a reply soon
> > 
> >  
> >
> >>On 5/20/05, Deepak <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >>>Hi Prabuddha,
> >>>   
> >>>check this ...
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>thanks,
> >>>
> >>>Deepak
___
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 )