[Zope] help with running a dtml method

2009-03-26 Thread Dvir Bar-lev
Hi 

 

I have a site with the following  folder structure in zope:

 

Dvir

WebSite

  contentPages

 

I have and index_html in the WebSite folder, in it I call a dtml method
that's in the contentPages folder named overview_html,

in the same folder (content Pages) I have another dtml_method named
time_combo.

 

In the overview_html I try to call the time combo method - I tried:

 



 

But it keeps saying it has an error :

Error Type: NameError
Error Value: name 'time_combo' is not defined

 

I tried putting the full path like this:

 

http://10.101.1.106:8080/Dvir/manage_workspace>
.WebSite 
.contentPages

.time_combo()">

 

But it still won't work.

 

Any idea what I did wrong? And what do I need to do to be able to call
it?

 

___
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] calling javascript method from dtml method

2009-03-15 Thread Dvir Bar-lev
Hi

 

Is there any way to call a javascript method from a dtml method
somewhere in the body of it? 

The method cam be in a different js file which is preferable or in the
dtml method if there is no other way, from what I found on the web it
looks like I can't but I want to make sure that I didn't miss anything

___
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] CookieCrumbler question

2009-03-12 Thread Dvir Bar-lev
I'm a little confused here.

 

What happened is this, I launch IE, go to the address http://zope
address/dvir/login

 

I do log in and than I log out after I managed to log in, now I f I
press the back button after I logged out and goes back to the page and
refresh it I still get the same behavior as if I was logged in. 

Is this supposed to work like this? 

 

If not than how can I fix it?

 

From: Thibaud Morel l'Horset [mailto:tee...@gmail.com] 
Sent: Thursday, March 12, 2009 4:49 PM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] CookieCrumbler question

 

There is no problem here per se. When you're logged in to the ZMI, your
browser is authenticated using BASIC_AUTH. What cookiecrumbler does is
allow you to log in via cookies instead. But if you're logged in via a
BASIC_AUTH user (which your manager user is), then CC can't log that
user out since that session is not cookie-based. The visitors to your
site won't have this problem since they won't be logged in to ZMI.

Your best bet is simply to create a test user and use a different
browser for your testing. For example user Firefox to be logged in to
ZMI and use IE or Safari to be logged in as a test user to test the CC
behavior. That's what I do...

- Thibaud

On Thu, Mar 12, 2009 at 10:31 AM, Dvir Bar-lev 
wrote:

My cookiecrumbler is indeed in a subfolder, is that the cause than?

 

My zmi looks like this:

 

Root folder

  Dvir folder - CookieCrumbler, log in forms, user folder

 

If that is the cause what do I need to do to make sure when I log out
the username returns to anonymus user than?

I searched the web but couldn't find any way to do it

 

From: Thibaud Morel l'Horset [mailto:tee...@gmail.com] 
Sent: Thursday, March 12, 2009 4:29 PM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] CookieCrumbler question

 

Is your cookiecrumbler installed at the root of your site? or in a
subfolder? If you're logged in to the ZMI in the root of your zope site
and execute a CookieCrumbler logout in a subdirectory, you will still be
logged in because you're using your manager user (if memory serves me
well though CC actually warns you of this if you try to logout while
logged in to ZMI...)

- Thibaud

On Thu, Mar 12, 2009 at 6:55 AM, Dvir Bar-lev 
wrote:

Hi

 

I used the CookieCrumbler plugin the make a log in.

I added the CookeCrumbler(standalone> from the ZMI , and now I have a
log in form that acts oka but I want logout the user, so what I did was
call the logout function of cookiecrumbler like this:

 



 

And that does bring me to the logged_out dtml but if I push the back
button and return to the logged_in and press the refresh button I still
get the result as if the  user is till logged in.

 

Do I have to do anything else besides calling the logout function to
make sure that the user is now back ti anonymus status?


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

 

___
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] CookieCrumbler question

2009-03-12 Thread Dvir Bar-lev
My cookiecrumbler is indeed in a subfolder, is that the cause than?

 

My zmi looks like this:

 

Root folder

  Dvir folder - CookieCrumbler, log in forms, user folder

 

If that is the cause what do I need to do to make sure when I log out
the username returns to anonymus user than?

I searched the web but couldn't find any way to do it

 

From: Thibaud Morel l'Horset [mailto:tee...@gmail.com] 
Sent: Thursday, March 12, 2009 4:29 PM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] CookieCrumbler question

 

Is your cookiecrumbler installed at the root of your site? or in a
subfolder? If you're logged in to the ZMI in the root of your zope site
and execute a CookieCrumbler logout in a subdirectory, you will still be
logged in because you're using your manager user (if memory serves me
well though CC actually warns you of this if you try to logout while
logged in to ZMI...)

- Thibaud

On Thu, Mar 12, 2009 at 6:55 AM, Dvir Bar-lev 
wrote:

Hi

 

I used the CookieCrumbler plugin the make a log in.

I added the CookeCrumbler(standalone> from the ZMI , and now I have a
log in form that acts oka but I want logout the user, so what I did was
call the logout function of cookiecrumbler like this:

 



 

And that does bring me to the logged_out dtml but if I push the back
button and return to the logged_in and press the refresh button I still
get the result as if the  user is till logged in.

 

Do I have to do anything else besides calling the logout function to
make sure that the user is now back ti anonymus status?


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


[Zope] CookieCrumbler question

2009-03-12 Thread Dvir Bar-lev
Hi

 

I used the CookieCrumbler plugin the make a log in.

I added the CookeCrumbler(standalone> from the ZMI , and now I have a
log in form that acts oka but I want logout the user, so what I did was
call the logout function of cookiecrumbler like this:

 



 

And that does bring me to the logged_out dtml but if I push the back
button and return to the logged_in and press the refresh button I still
get the result as if the  user is till logged in.

 

Do I have to do anything else besides calling the logout function to
make sure that the user is now back ti anonymus status?

___
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] redirect timeout doesn't work

2009-03-12 Thread Dvir Bar-lev
It's ok I solved this by using a javascript at the end to achieve this

-Original Message-
From: Lennart Regebro [mailto:rege...@gmail.com] 
Sent: Thursday, March 12, 2009 10:22 AM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] redirect timeout doesn't work

On Wed, Mar 11, 2009 at 15:18, Dvir Bar-lev  wrote:
> Hi just wanted to add something that I forgot to meantion.
> The problem I described only happenes on  IE, on firefox it does the redirect 
> even after I refresh the page manually

So yet another IE bug then.


You want a lot of timeouts and redirections and stuff in your
application. Are you sure old-school HTML is the right way to do this?
Sounds like an AJAX app could be more suitable.

-- 
Lennart Regebro: Pythonista, Barista, Notsotrista.
http://regebro.wordpress.com/
+33 661 58 14 64
___
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] redirect timeout doesn't work

2009-03-11 Thread Dvir Bar-lev
Hi just wanted to add something that I forgot to meantion.
The problem I described only happenes on  IE, on firefox it does the redirect 
even after I refresh the page manually

-Original Message-
From: zope-boun...@zope.org [mailto:zope-boun...@zope.org] On Behalf Of Dvir 
Bar-lev
Sent: Wednesday, March 11, 2009 3:47 PM
To: zope@zope.org
Subject: Re: [Zope] redirect timeout doesn't work

Yep, you were right, the syntax I used was bad, but now I encountered a 
diffrent problem.
If i set the header as you said and manually refresh the page than it wont 
redirect again.
Anyone encountered this before? Can't find anything on the web about this 
problem

-Original Message-
From: Thierry Florac [mailto:thierry.flo...@onf.fr] 
Sent: Wednesday, March 11, 2009 3:24 PM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] redirect timeout doesn't work

Le mercredi 11 mars 2009 à 14:59 +0200, Dvir Bar-lev a écrit :
> I want to redirect a user from my page to another page after a certain
> time, I put this code in the dtml  page at the top I want to redirect
> from:
> 
>  
> 
>  Address’)">

Maybe I'm wrong but I think it should be something like :

  setHeader('Refresh', '5;URL=http://...')


  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : thierry.flo...@onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

___
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] redirect timeout doesn't work

2009-03-11 Thread Dvir Bar-lev
Yep, you were right, the syntax I used was bad, but now I encountered a 
diffrent problem.
If i set the header as you said and manually refresh the page than it wont 
redirect again.
Anyone encountered this before? Can't find anything on the web about this 
problem

-Original Message-
From: Thierry Florac [mailto:thierry.flo...@onf.fr] 
Sent: Wednesday, March 11, 2009 3:24 PM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] redirect timeout doesn't work

Le mercredi 11 mars 2009 à 14:59 +0200, Dvir Bar-lev a écrit :
> I want to redirect a user from my page to another page after a certain
> time, I put this code in the dtml  page at the top I want to redirect
> from:
> 
>  
> 
>  Address’)">

Maybe I'm wrong but I think it should be something like :

  setHeader('Refresh', '5;URL=http://...')


  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : thierry.flo...@onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

___
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] redirect timeout doesn't work

2009-03-11 Thread Dvir Bar-lev
Hi

 

I want to redirect a user from my page to another page after a certain
time, I put this code in the dtml  page at the top I want to redirect
from:

 



 

But although it does refresh after the timeout it stays in the same page
instead of going to the address listed in URLAddress.

Anyone knows what I did wrong? Or I even did it the right way?

___
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] session data object question

2009-03-11 Thread Dvir Bar-lev
Yep I refresh after, I'll try to work with cookies than, tx

-Original Message-
From: Andrew Milton [mailto:a...@theinternet.com.au] 
Sent: Wednesday, March 11, 2009 11:13 AM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] session data object question

+---[ Dvir Bar-lev ]--
| Hi
| 
| I have a button like that but the the problem is that it also has this
| value if I refresh the page, what I mean Is this, I put in the
logged_in
| page:

That is highly unlikely, unless you are refreshing AFTER you submit the
form, in which case you are essentially re-submitting the form.

I would suggest setting a cookie with a timestamp.

-- 
Andrew Milton
a...@theinternet.com.au
___
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] session data object question

2009-03-11 Thread Dvir Bar-lev
I also tried to change the value of theButton key like so:

 
  

   
   

But if refresh the button it still thinks it has the value Login instead
of the value LoggedIn :(

-Original Message-
From: zope-boun...@zope.org [mailto:zope-boun...@zope.org] On Behalf Of
Dvir Bar-lev
Sent: Wednesday, March 11, 2009 10:33 AM
To: zope@zope.org
Subject: Re: [Zope] session data object question

Hi

I have a button like that but the the problem is that it also has this
value if I refresh the page, what I mean Is this, I put in the logged_in
page:


Do something


And it has the key even if I refresh the page.

I also tried to put  to see if it keeps this value
after we refresh the page and it does.
What I need is a way to know if we loaded the page as a result of
pressing the button or as a result of refreshing the page, as I need to
do different things in each case.

-Original Message-
From: Andrew Milton [mailto:a...@theinternet.com.au] 
Sent: Wednesday, March 11, 2009 10:15 AM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] session data object question

+---[ Dvir Bar-lev ]--
| Hi
| 
|  
| 
| I was wondering if there is a way to connect the creation of a session
object
| to a button push.
| 
| I?ll explain in more detail:
| 
|  
| 
| I have a log in from called login_form, and I have a dtml method
called
| looged_in that is called when we push the submit button in the log in
form.
| 
| What I did is the following, in the log_in_form I get a session data
object
| only if it exsists and I check how much time passed and act
accordingly, in the
| looged_in method I create the data session oblject ans set the start
time.
| 
| Unfortuantly that is not good for me because if a user refreshes the
page it
| resets the time in the session object, I was wondering if there is a
way for me
| to know if I can reset the session data time only when the user clicks
the
| submit button and not as a result of a refresh call.

Name the submit button and check for the name of the button in the
request.



"theButton" will appear in REQUEST (and REQUEST.form) if the button was
pressed.


-- 
Andrew Milton
a...@theinternet.com.au
___
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] session data object question

2009-03-11 Thread Dvir Bar-lev
Hi

I have a button like that but the the problem is that it also has this
value if I refresh the page, what I mean Is this, I put in the logged_in
page:


Do something


And it has the key even if I refresh the page.

I also tried to put  to see if it keeps this value
after we refresh the page and it does.
What I need is a way to know if we loaded the page as a result of
pressing the button or as a result of refreshing the page, as I need to
do different things in each case.

-Original Message-
From: Andrew Milton [mailto:a...@theinternet.com.au] 
Sent: Wednesday, March 11, 2009 10:15 AM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] session data object question

+---[ Dvir Bar-lev ]--
| Hi
| 
|  
| 
| I was wondering if there is a way to connect the creation of a session
object
| to a button push.
| 
| I?ll explain in more detail:
| 
|  
| 
| I have a log in from called login_form, and I have a dtml method
called
| looged_in that is called when we push the submit button in the log in
form.
| 
| What I did is the following, in the log_in_form I get a session data
object
| only if it exsists and I check how much time passed and act
accordingly, in the
| looged_in method I create the data session oblject ans set the start
time.
| 
| Unfortuantly that is not good for me because if a user refreshes the
page it
| resets the time in the session object, I was wondering if there is a
way for me
| to know if I can reset the session data time only when the user clicks
the
| submit button and not as a result of a refresh call.

Name the submit button and check for the name of the button in the
request.



"theButton" will appear in REQUEST (and REQUEST.form) if the button was
pressed.


-- 
Andrew Milton
a...@theinternet.com.au
___
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] session data object question

2009-03-11 Thread Dvir Bar-lev
Hi 

 

I was wondering if there is a way to connect the creation of a session
object to a button push.

I'll explain in more detail:

 

I have a log in from called login_form, and I have a dtml method called
looged_in that is called when we push the submit button in the log in
form.

What I did is the following, in the log_in_form I get a session data
object only if it exsists and I check how much time passed and act
accordingly, in the looged_in method I create the data session oblject
ans set the start time.

Unfortuantly that is not good for me because if a user refreshes the
page it resets the time in the session object, I was wondering if there
is a way for me to know if I can reset the session data time only when
the user clicks the submit button and not as a result of a refresh call.

 

I tried looking on the web and in the zope book but I couldn't find
anything.

___
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] refreshing problem

2009-03-10 Thread Dvir Bar-lev
Yep that solved it

Tx a lot :)

-Original Message-
From: Andreas Jung [mailto:li...@zopyx.com] 
Sent: Tuesday, March 10, 2009 10:11 AM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] refreshing problem

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10.03.2009 9:06 Uhr, Dvir Bar-lev wrote:
> Hi
> 
>  
> 
> I want to force a certain page to automatically  reload itself every 
> time that the user goes to it from another page, meaning I don’t want 
> the browser to cache that page, I tried to look around and what I 
> found was that if I included these 2 lines in the dtml method that 
> shows the page it’s supposed to reload the page every time it is 
> accessed, so what I did was I created a dtml method named RefreshPage that 
> looks like this:
> 
>  
> 
> 
> 
> 
> 
>  
> 
> I than called this method from the dtml page like this:
> 
>  
> 
> 
> 
>  
> 
> But the browser is still loading the page from cache memory, I also 
> tried putting the 2 lines directly inside the page but it still won’t work.
> 
> I tried both firefox and explorer.
> 
> I tried looking in the web but all I could find was what I just tried.
> 
>

You should set the related HTTP headers using 
REQUEST.RESPONSE.setHeader(header, value) instead of depending on the 
http-equiv magic which is obviously ignored by most browsers.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkm2IHcACgkQCJIWIbr9KYyZQgCgkBeEPnn2hEudfbqBRALOGSnp
gfIAnizUSUhGVp+ZuIrawTCCQkv1MNtB
=NH9U
-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] refreshing problem

2009-03-10 Thread Dvir Bar-lev
Hi 

 

I want to force a certain page to automatically  reload itself every
time that the user goes to it from another page, meaning I don't want
the browser to cache that page, I tried to look around and what I found
was that if I included these 2 lines in the dtml method that shows the
page it's supposed to reload the page every time it is accessed, so what
I did was I created a dtml method named RefreshPage that looks like
this:

 





 

I than called this method from the dtml page like this:

 



 

But the browser is still loading the page from cache memory, I also
tried putting the 2 lines directly inside the page but it still won't
work.

I tried both firefox and explorer.

I tried looking in the web but all I could find was what I just tried.

 

Anyone knows how to solve it? 

___
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] timeout on a page

2009-03-09 Thread Dvir Bar-lev
Hi all.

 

First of all let me say that I found the solution to my user roles
problems by using the  coockiecrumbler plugin,  so that's behind me now
J

 

I need help with something else, I will explain what I want to
accomplish:

 

I have a page ( well call it Page a), the user gets to  page a and from
there goes to another page, now he returns to the page a,

What I want to happen is this, I he returned to page a before 3 minutes
passed from the last time I want to to redirect him to another page,

If more than 3 minutes passed than he will see page a again.

 

The 2nd thing I need is this:

The user entered my site, lets say he browsed the site and now is just
staying in some page there and went off, and he forgot to log off my
site,

What I want is that lets say the after 3 minutes of inactivity from his
part while hes on my site I want to automatically log him off, meaning I
will redirect him to the home page and reset his status.

 

Any ideas how I can do this 2 things?

 

___
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] how to check a user role with data entred by user?

2009-03-08 Thread Dvir Bar-lev
K, here goes, explanation 3 :)

This is what I would like to happen:

A user goes to the site, he see the log in screen that has 2 entry
fields - user name and password.
The user enteres the data and presses the submit button.
Now I want to take what the user entered and see if I have the same user
and password defined in acl_users folder, if so I want to give him the
role that that user in the acl_users folder have.
And than based on that role direct him to the appropriate page

What I don't want is that the zope will pop up his log in window, in
essence I want to do my own authentication, validation and role
assigning.

Ihope this clears up what I want, I thought about using the PAS plugin
but I have no idea how to use it and I was told I can do what I want
without using any plugins at all.

-Original Message-
From: Lennart Regebro [mailto:rege...@gmail.com] 
Sent: Sunday, March 08, 2009 10:42 AM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] how to check a user role with data entred by user?

On Sun, Mar 8, 2009 at 08:07, Dvir Bar-lev  wrote:
> K, ill try to explain in more detail. :)
> What I want to do is this:
>
> I create 2 roles in zope - manager and client for example.
> I than create 2 users - zoe and don.
> Zoe has password A and role manager and don has password B and role
client.
> Now I go to the log in page of my site, it has 2 fields - username and
password.
> What I want to do is this:
> If the user puts in the fileds zoe and A I want to be able to identify
the user zoe with the role manager

You already have. You gave Zoe the role "Manager", you say. OK. Done.
You don't need to do anything more.


I suspect you still need to explain, not what you are trying to do,
but what you are trying to achieve. Explain the usecase.

-- 
Lennart Regebro: Pythonista, Barista, Notsotrista.
http://regebro.wordpress.com/
+33 661 58 14 64
___
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] how to check a user role with data entred by user?

2009-03-07 Thread Dvir Bar-lev
K, ill try to explain in more detail. :)
What I want to do is this:

I create 2 roles in zope - manager and client for example.
I than create 2 users - zoe and don.
Zoe has password A and role manager and don has password B and role client.
Now I go to the log in page of my site, it has 2 fields - username and password.
What I want to do is this:
If the user puts in the fileds zoe and A I want to be able to identify the user 
zoe with the role manager
And if he puts don and B I want to identify him with the role client, anything 
else he puts in I want to consider him as an anonymus user.

I hope this clears things up :)

-Original Message-
From: Lennart Regebro [mailto:rege...@gmail.com] 
Sent: Thursday, March 05, 2009 11:33 PM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] how to check a user role with data entred by user?

On Thu, Mar 5, 2009 at 09:21, Dvir Bar-lev  wrote:
> What I did was this, I created a folder in the ZMI and there I created a
> user folder(acl_users), in the user folder I defined  2 new roles.
>
> Now, I have a log in form where the user fills out user name and password, I
> want to check if the data he entered matches 1  of the roles I defined in
> the ZMI . I can't find any info or example how to do it, not on the web nor
> in the documentation.

This is a classic case of you not telling is what you want to do.
Why do you want to check if the data he enters matches on of the roles?

You do that with

 if entered_data in (role1, role2):

which I suspect isn't what you are asking at all. :) Tell us what you
are trying to achieve.

-- 
Lennart Regebro: Pythonista, Barista, Notsotrista.
http://regebro.wordpress.com/
+33 661 58 14 64
___
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] how to check a user role with data entred by user?

2009-03-05 Thread Dvir Bar-lev
First tx for the reply Andrew.
How do I check that the password that was entered is the correct one for
that role than?
As it is presented in the reply the password of the role and the one
that the user entered aren't any consideration at all

-Original Message-
From: Andrew Milton [mailto:a...@theinternet.com.au] 
Sent: Thursday, March 05, 2009 10:29 AM
To: Dvir Bar-lev
Cc: zope@zope.org
Subject: Re: [Zope] how to check a user role with data entred by user?

+---[ Dvir Bar-lev ]--
| Hi all.
| 
|  
| 
| I have a question and I hope someone can help me out.
| 
| I?m new to zope and the all web thing, I?m using zope2.
| 
|  
| 
| What I did was this, I created a folder in the ZMI and there I created
a user
| folder(acl_users), in the user folder I defined  2 new roles.
| 
| Now, I have a log in form where the user fills out user name and
password, I
| want to check if the data he entered matches 1  of the roles I defined
in the
| ZMI . I can?t find any info or example how to do it, not on the web
nor in the
| documentation.
| 
|  
| 
| I would appreciate any help on the matter.

in a python script;

user = context.acl_users.getUser(theUserNameTheUserEnteredInTheForm)

if user.has_role(['Role1', 'Role2']):
  # User has role log them in I suppose
else:
  # Bad user! Bad!



-- 
Andrew Milton
a...@theinternet.com.au
___
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 check a user role with data entred by user?

2009-03-05 Thread Dvir Bar-lev
Hi all.

 

I have a question and I hope someone can help me out.

I'm new to zope and the all web thing, I'm using zope2.

 

What I did was this, I created a folder in the ZMI and there I created a
user folder(acl_users), in the user folder I defined  2 new roles.

Now, I have a log in form where the user fills out user name and
password, I want to check if the data he entered matches 1  of the roles
I defined in the ZMI . I can't find any info or example how to do it,
not on the web nor in the documentation.

 

I would appreciate any help on the matter.

Tx in advance

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