[Zope] Raise Unauthorized?! - and logging in new users: two questions

Steve Spicklemire steve@spvi.com
Sun, 05 Aug 2001 18:26:27 -0500


Hi David

	The problem is (I think) that raise Unauthorized is unconditional. You'll need
something along the lines of:


<form action="reauth" method="POST">

<center>
<br>
<br>
<h2> Re-Authenticate as a different user...</h2><br><br>
<table width=80%>
<tr><td> You are currently authenticated as: <!--#var AUTHENTICATED_USER--></td></tr>
<tr><td>
Who would you like to authenticate as?
<input name=authName size=40></td></tr>
<tr><td><input type=submit value="Re Authenticate">
</td></tr></table>
</center>
</form>

where rauth is a DTML Method like:

<!--#if "_.has_key('AUTHENTICATED_USER') and AUTHENTICATED_USER.getUserName() == authName"-->

<!--#call "RESPONSE.redirect('http://your.place/where/you/want/them/to/go')"-->

<!--#else-->

<!--#raise Unauthorized-->
<!--#/raise-->

<!--#/if-->

(excuse the old syntax.. I resurrected this from some *old* code)

-steve

David Hassalevris wrote:
> 
> Hi Zopers,
> 
> I did some research on this ... but im up against deadlines :-)
> 
> (1):
> Apparently <dtml-raise Unauthorized> creates a "rendering loop".  That
> is, you raise Unauthorized,
> get the login screen, enter a VALID userid/password, click OK and you
> get yet ANOTHER login screen.
> 
> This isnt very helpful.
> 
> I want to be able to login new users without the need for the user to
> terminate the browser and
> restart.
> 
> I am really hoping that someone has solved this problem (without turning
> to 3rd party login managers).
> 
> (2):  Also, is there a way to login a user "programmically", that is, by
> avoiding the
> browser login screen and logging the user in via a python script or
> DTML????
> 
> Any insights please!
> Thanks,
> David
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> 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 )