[Zope-CVS] CVS: Products/CookieCrumbler/dtml - addCC.dtml:1.1 logged_in.dtml:1.1 logged_out.dtml:1.1 login_form.dtml:1.1

Shane Hathaway shane@zope.com
Fri, 6 Jun 2003 11:15:38 -0400


Update of /cvs-repository/Products/CookieCrumbler/dtml
In directory cvs.zope.org:/tmp/cvs-serv24607/dtml

Added Files:
	addCC.dtml logged_in.dtml logged_out.dtml login_form.dtml 
Log Message:
- Reformatted CookieCrumbler.py to match the version in CMFCore.  This
  will make it easier to keep the two copies in sync.

- Changed the meta_type to not conflict with the version in CMFCore.

- Cleaned up CHANGES.txt


=== Added File Products/CookieCrumbler/dtml/addCC.dtml ===
<dtml-let form_title="'Add Cookie Crumbler'">
 <dtml-var manage_page_header>
 <dtml-var manage_form_title>
</dtml-let>

<p>
Cookie crumblers allow you to use cookie-based authentication with
most Zope user folders.  Place the cookie crumbler in the
same folder as your user folder.
</p>

<form action="manage_addCC" method="POST">
<table cellspacing="0" cellpadding="2" border="0">
  <tr>
    <td align="left" valign="top">
    <div class="form-label">
    Id
    </div>
    </td>
    <td align="left" valign="top">
    <input type="text" name="id" size="25" value="cookie_authentication" />
    </td>
  </tr>
  <tr>
    <td align="left" valign="top">
    <div class="form-label">
    Create login_form, logged_in, and logged_out DTML methods
    </div>
    </td>
    <td align="left" valign="top">
    <input type="checkbox" name="create_forms" value="1" checked="checked" />
    </td>
  </tr>
  <tr>
    <td align="left" valign="top">
    </td>
    <td align="left" valign="top">
    <div class="form-element">
    <input class="form-element" type="submit" name="submit" 
     value=" Add " /> 
    </div>
    </td>
  </tr>
</table>
</form>

<dtml-var manage_page_footer>


=== Added File Products/CookieCrumbler/dtml/logged_in.dtml ===
<dtml-var standard_html_header>

<dtml-let came_from="REQUEST.get('came_from', '')">
<dtml-if expr="_.SecurityGetUser().getUserName() == 'Anonymous User'">
 <!-- Redirect or generate an unauthorized response -->
 <dtml-call expr="REQUEST['RESPONSE'].unauthorized()">

 <h3>Login failure</h3>
 <p>Please <a href="login_form?came_from=&dtml.url_quote-came_from;"
   >try again.</a></p>

<dtml-else>
 <dtml-if came_from>
  <dtml-call expr="RESPONSE.redirect(came_from)">
 <dtml-else>

  <p>Welcome!</p>

 </dtml-if>
</dtml-if>
</dtml-let>

<dtml-var standard_html_footer>


=== Added File Products/CookieCrumbler/dtml/logged_out.dtml ===
<dtml-var standard_html_header>

<dtml-if expr="_.SecurityGetUser().getUserName() == 'Anonymous User'">
 <h3>Logged out</h3>
 <p>Come again soon!</p>
<dtml-else>
 You are logged in using HTTP authentication.  You may need to
 <a href="/manage_zmi_logout">log out of the Zope management interface</a>.
</dtml-if>

<dtml-var standard_html_footer>


=== Added File Products/CookieCrumbler/dtml/login_form.dtml ===
<dtml-var standard_html_header>

<h1 class="DesktopTitle">
 Log in
</h1>

<dtml-let came_from="REQUEST.get('came_from', '')"
          action_url="came_from or 'logged_in'">

<form action="&dtml-action_url;" method="POST">

<dtml-if expr="REQUEST.get('retry', 0)">
<font color="red">Please try again.</font>
</dtml-if>

<dtml-if came_from>
  <input type="hidden" name="came_from" value="&dtml-came_from;">
</dtml-if>

<table class="FormLayout">
<tr>
  <td align="left" valign="top">
  <strong>Name</strong>
  </td>
  <td align="left" valign="top">
  <input type="TEXT" name="__ac_name" size="20"
   value="<dtml-var "REQUEST.get('__ac_name', '')">">
  </td>
</tr>
<tr>
  <td align="left" valign="top">
  <strong>Password</strong>
  </td>
  <td align="left" valign="top">
  <input type="PASSWORD" name="__ac_password" size="20">
  </td>
</tr>

<tr valign="top" align="left">
<td></td>
<td><input type="checkbox" name="__ac_persistent" value="1" checked
      id="cb_remember" />
<label for="cb_remember">Remember my name.</label>
</td></tr>

<tr>
  <td align="left" valign="top">
  </td>
  <td align="left" valign="top">
  <input type="submit" name="submit" value=" Login ">
  </td>
</tr>

</table>
</form>
</dtml-let>

<p>
Having trouble logging in? Be sure to enable cookies in your web browser.
</p>

<p>Don't forget to logout or exit your browser when you're done.
</p>

<p>
Setting the 'Remember my name' option will set a cookie with your username,
so that when you next log in, your user name will already be filled in for you.
</p>

<dtml-var standard_html_footer>