[Cluster-devel] conga/luci/plone-custom failsafe_login_form.cp ...

rmccabe at sourceware.org rmccabe at sourceware.org
Mon Sep 18 21:09:55 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-09-18 21:09:53

Added files:
	luci/plone-custom: failsafe_login_form.cpt login_form.cpt 
	                   portlet_login.cpt 
Removed files:
	luci/plone-custom: failsafe_login_form join_form_validate 
	                   logged_out login_form portlet_login 

Log message:
	these need to be controller page templates

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/failsafe_login_form.cpt.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/login_form.cpt.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/portlet_login.cpt.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/failsafe_login_form.diff?cvsroot=cluster&r1=1.4&r2=NONE
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/join_form_validate.diff?cvsroot=cluster&r1=1.1&r2=NONE
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/logged_out.diff?cvsroot=cluster&r1=1.2&r2=NONE
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/login_form.diff?cvsroot=cluster&r1=1.4&r2=NONE
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/portlet_login.diff?cvsroot=cluster&r1=1.5&r2=NONE

/cvs/cluster/conga/luci/plone-custom/failsafe_login_form.cpt,v  -->  standard output
revision 1.1
--- conga/luci/plone-custom/failsafe_login_form.cpt
+++ -	2006-09-18 21:09:53.896648000 +0000
@@ -0,0 +1,166 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+      i18n:domain="plone">
+<head>
+  <title i18n:translate="heading_sign_in">Please log in</title>
+</head>
+
+<body>
+
+<div tal:define="checkPermission nocall:here/portal_membership/checkPermission;
+                 actions python:context.portal_actions.listFilteredActionsFor(context);
+                 Iterator python:modules['Products.CMFPlone'].IndexIterator;
+                 tabindex python:Iterator(pos=30000);
+                 auth nocall:here/acl_users/credentials_cookie_auth|nothing;
+                 came_from request/came_from|request/HTTP_REFERER|nothing;
+                 came_from python:test(here.portal_url.isURLInPortal(came_from), came_from, None);
+                 ztutils modules/ZTUtils;
+                 errors options/state/getErrors;">
+
+<tal:block tal:condition="python:here.siteIsSetup()">
+
+<h1 i18n:translate="heading_sign_in">Please log in</h1>
+
+<p i18n:translate="description_sign_in">
+To access this part of the site, you need to log in with your user name and password.
+</p>
+
+<div id="enable_cookies_message" i18n:translate="enable_cookies_message" class="portalMessage" style="display:none">
+  Cookies are not enabled. You must <span i18n:name="enable_cookies">
+  <a href="enabling_cookies" i18n:translate="label_enable_cookies">enable cookies</a></span> before you can log in.
+</div>
+
+<div tal:condition="python: not auth" i18n:translate="login_form_disabled">
+    While cookie authentication is disabled, cookie-based login is not available.
+</div>
+
+<div style="margin-top:1em;margin-bottom:1em"
+      tal:define="ac_name auth/name_cookie|python:login_name"
+      tal:condition="python:ac_name == 'admin'">
+        If you have forgotten your password, you can reset the password by logging in to the server as root and running the command<br>
+       <code style="margin-left: +1.5em">luci_admin password</code>
+</div>
+
+<form tal:attributes="action python:context.absolute_url()+'/'+template.id"
+      method="post"
+      id="login_form"
+      tal:condition="python:auth">
+
+    <fieldset tal:define="ac_name auth/name_cookie|string:__ac_name;
+                          ac_password auth/pw_cookie|string:__ac_password;
+                          ac_persist auth/persist_cookie|nothing">
+
+        <legend i18n:translate="legend_account_details">Account details</legend>
+
+        <input type="hidden"
+            name="came_from"
+            value=""
+	    tal:attributes="value came_from" />
+
+        <input type="hidden" name="form.submitted" value="1" />
+        <input type="hidden" name="js_enabled" id="js_enabled" value="0" />
+        <input type="hidden" name="cookies_enabled" id="cookies_enabled" value="" />
+        <input type="hidden" name="login_name" id="login_name" value="" />
+        <input type="hidden" name="pwd_empty" id="pwd_empty" value="0" />
+
+        <div class="field"
+             tal:define="error python:errors.get(ac_name, None);
+                         value python:request.get('login_name', request.get(ac_name, None));"
+             tal:attributes="class python:test(error, 'field error', 'field')">
+
+            <label i18n:translate="label_login_name"
+                   tal:attributes="for ac_name">Login Name</label>
+
+            <div i18n:translate="help_login_name_caps"
+                 class="formHelp">
+                Login names are case sensitive, make sure the caps lock key is not enabled.
+            </div>
+
+            <div tal:content="error">Validation error output</div>
+
+            <input type="text"
+                   size="15"
+                   tabindex=""
+                   tal:attributes="name ac_name;
+                                   id ac_name;
+                                   value value;
+                                   tabindex tabindex/next;"
+                   />
+
+        </div>
+
+        <div class="field"
+             tal:define="error python:errors.get(ac_password, None);"
+             tal:attributes="class python:test(error, 'field error', 'field')">
+
+            <label i18n:translate="label_password"
+                   tal:attributes="for ac_password">Password</label>
+
+            <div class="formHelp">
+                <div i18n:translate="help_capslock_password">
+                    Case sensitive, make sure caps lock is not enabled.
+                </div>
+            </div>
+
+            <div tal:content="error">Validation error output</div>
+
+            <input type="password"
+                   size="15"
+                   tabindex=""
+                   tal:attributes="name ac_password;
+                                   id ac_password;
+                                   tabindex tabindex/next;"
+                   />
+        </div>
+
+        <div class="field" tal:condition="ac_persist">
+
+            <input type="checkbox"
+                   class="noborder formRememberName"
+                   value="1"
+                   checked="checked"
+                   id="cb_remember"
+                   tabindex=""
+                   tal:attributes="name ac_persist;
+                                   tabindex tabindex/next;
+                                   checked python:request.get(ac_name, '') and 'checked' or None;"
+                   />
+
+            <label for="cb_remember" i18n:translate="label_remember_my_name">Remember my name.</label>
+
+            <div i18n:translate="help_remember_my_name"
+                 class="formHelp">
+                Check this to have your user name filled in automatically when you log in later.
+            </div>
+
+        </div>
+
+        <div class="formControls">
+
+            <input
+                   tabindex=""
+                   type="submit"
+                   name="submit"
+                   value="Log in"
+                   i18n:attributes="value label_log_in;"
+                   tal:attributes="tabindex tabindex/next;" />
+
+        </div>
+
+        <p i18n:translate="remember_to_log_out">
+            Please log out or exit your browser when you're done.
+        </p>
+
+    </fieldset>
+
+</form>
+</tal:block>
+
+<div style="margin-top:1em" tal:condition="python: not here.siteIsSetup()">
+  The Luci server has not been initialized. To initialize it, log in in to the server as root and run the command<br>
+   <code style="margin-left:+1.5em">luci_admin init</code>
+</div>
+
+</div>
+
+</body>
+</html>
/cvs/cluster/conga/luci/plone-custom/login_form.cpt,v  -->  standard output
revision 1.1
--- conga/luci/plone-custom/login_form.cpt
+++ -	2006-09-18 21:09:54.358310000 +0000
@@ -0,0 +1,169 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+      metal:use-macro="here/main_template/macros/master"
+      i18n:domain="plone">
+
+<head>
+    <script type="text/javascript" metal:fill-slot="javascript_head_slot">
+    </script>
+    <metal:block fill-slot="top_slot"
+                 tal:define="dummy python:request.set('disable_border',1)" />
+</head>
+
+<body>
+
+<div metal:fill-slot="main"
+     tal:define="auth nocall:here/acl_users/credentials_cookie_auth|nothing;
+                 came_from request/came_from|request/HTTP_REFERER|nothing;
+                 came_from python:test(utool.isURLInPortal(came_from), came_from, None);
+		 errors options/state/getErrors;
+		 ac_name auth/name_cookie|string:__ac_name;
+		 ac_password auth/pw_cookie|string:__ac_password;
+		 ac_persist auth/persist_cookie|nothing;
+		 login_name python:request.get('login_name', request.get(ac_name, ''));">
+
+<tal:block tal:condition="python: here.siteIsSetup()">
+
+<h1 i18n:translate="heading_sign_in">Please log in</h1>
+
+<p i18n:translate="description_sign_in">
+To access this part of the site, you need to log in with your user name and password.
+</p>
+
+    <div style="margin-top:1em;margin-bottom:1em"
+      tal:define="ac_name auth/name_cookie|python:login_name"
+      tal:condition="python:ac_name == 'admin'">
+        If you have forgotten your password, you can reset the password by logging in to the server as root and running the command<br>
+       <code style="margin-left: +1.5em">luci_admin password</code>
+    </div>
+
+
+<div id="enable_cookies_message" i18n:translate="enable_cookies_message" class="portalMessage" style="display:none">
+  Cookies are not enabled. You must <span i18n:name="enable_cookies">
+  <a href="enabling_cookies" i18n:translate="label_enable_cookies">enable cookies</a></span> before you can log in.
+</div>
+
+<div tal:condition="python: not auth" i18n:translate="login_form_disabled">
+    While cookie authentication is disabled, cookie-based login is not available.
+</div>
+
+<form tal:attributes="action python:context.absolute_url()+'/'+template.id"
+      method="post"
+      id="login_form"
+      tal:condition="python:auth">
+
+    <fieldset>
+
+        <legend i18n:translate="legend_account_details">Account details</legend>
+
+        <input type="hidden"
+            name="came_from"
+            value=""
+        tal:attributes="value came_from" />
+
+        <input type="hidden" name="form.submitted" value="1" />
+        <input type="hidden" name="js_enabled" id="js_enabled" value="0" />
+        <input type="hidden" name="cookies_enabled" id="cookies_enabled" value="" />
+        <input type="hidden" name="login_name" id="login_name" value="" />
+        <input type="hidden" name="pwd_empty" id="pwd_empty" value="0" />
+
+        <div class="field"
+             tal:define="error python:errors.get(ac_name, None);"
+             tal:attributes="class python:test(error, 'field error', 'field')">
+
+            <label i18n:translate="label_login_name"
+                   tal:attributes="for ac_name">Login Name</label>
+
+            <div i18n:translate="help_login_name_caps"
+                 class="formHelp">
+            Login names are case sensitive, make sure the caps lock key is not enabled.
+            </div>
+
+            <div tal:content="error">Validation error output</div>
+
+            <input type="text"
+                   size="15"
+                   tabindex=""
+                   tal:attributes="name ac_name;
+                                   id ac_name;
+                                   value login_name;
+                                   tabindex tabindex/next;"
+                   />
+
+    </div>
+
+    <div class="field"
+             tal:define="error python:errors.get(ac_password, None);"
+             tal:attributes="class python:test(error, 'field error', 'field')">
+
+            <label i18n:translate="label_password"
+                   tal:attributes="for ac_password">Password</label>
+
+            <div class="formHelp">
+                <div i18n:translate="help_capslock_password">
+                    Case sensitive, make sure caps lock is not enabled.
+                </div>
+            </div>
+
+            <div tal:content="error">Validation error output</div>
+
+            <input type="password"
+                   size="15"
+                   tabindex=""
+                   tal:attributes="name ac_password;
+                                   id ac_password;
+                                   tabindex tabindex/next;"
+                   />
+    </div>
+
+        <div class="field" tal:condition="ac_persist">
+
+            <input type="checkbox"
+                   class="noborder formRememberName"
+                   value="1"
+                   checked="checked"
+                   id="cb_remember"
+                   tabindex=""
+                   tal:attributes="name ac_persist;
+                                   tabindex tabindex/next;
+                                   checked python:request.get(ac_name, '') and 'checked' or None;"
+                   />
+
+            <label for="cb_remember" i18n:translate="label_remember_my_name">Remember my name.</label>
+
+            <div i18n:translate="help_remember_my_name"
+                 class="formHelp">
+                Check this to have your user name filled in automatically when you log in later.
+            </div>
+
+        </div>
+
+        <div class="formControls">
+
+            <input 
+                   tabindex=""
+                   type="submit"
+                   name="submit"
+                   value="Log in"
+                   i18n:attributes="value label_log_in;"
+                   tal:attributes="tabindex tabindex/next;
+                               onclick string:javascript:return setLoginVars('$ac_name','login_name','$ac_password','pwd_empty','js_enabled','cookies_enabled');"
+                   />
+
+        </div>
+
+        <p i18n:translate="remember_to_log_out">
+            Please log out or exit your browser when you're done.
+        </p>
+
+    </fieldset>
+</form>
+</tal:block>
+
+<div style="margin-top:1em" tal:condition="python: not here.siteIsSetup()">
+  The Luci server has not been initialized. To initialize it, log in in to the server as root and run the command<br>
+  <code style="margin-left:+1.5em">luci_admin init</code>
+</div>
+</div>
+
+</body>
+</html>
/cvs/cluster/conga/luci/plone-custom/portlet_login.cpt,v  -->  standard output
revision 1.1
--- conga/luci/plone-custom/portlet_login.cpt
+++ -	2006-09-18 21:09:54.441125000 +0000
@@ -0,0 +1,128 @@
+<html xmlns:tal="http://xml.zope.org/namespaces/tal"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      i18n:domain="plone">
+<body tal:define="Iterator python:modules['Products.CMFPlone'].IndexIterator;
+                  tabindex python:Iterator(mainSlot=False)">
+<div metal:define-macro="portlet"
+     tal:omit-tag=""
+     tal:define="pageloc python: request.URL.split('/')[-1];
+                 okToShowHere python: not pageloc in ('login_form', 'join_form');
+                 auth nocall:here/acl_users/credentials_cookie_auth|nothing"
+     tal:condition="python: isAnon and okToShowHere">
+
+<tal:block tal:condition="python: here.siteIsSetup()">
+<dl class="portlet"
+    id="portlet-login"
+    tal:define="ac_name auth/name_cookie|string:__ac_name;
+                ac_password auth/pw_cookie|string:__ac_password;
+                ac_persist auth/persist_cookie|nothing;
+                join python:0;
+                canRegister python:0;
+                canRequestPassword python:0"
+    tal:condition="python: auth">
+
+    <dt class="portletHeader">
+        <span class="portletTopLeft"></span>
+        <a href="#" 
+           class="tile"
+           tal:attributes="href string:$portal_url/login_form"
+           i18n:translate="box_sign_in">Log in</a>
+        <span class="portletTopRight"></span>
+    </dt>
+
+    <dd class="portletItem odd">
+        <form action="login_form"
+              name="loginform"
+              method="post"
+              tal:attributes="action string:${portal_url}/login_form">
+
+            <input type="hidden" name="form.submitted" value="1" />
+            <input type="hidden" name="came_from" value=""
+                   tal:attributes="value context/@@plone/getCurrentUrl" />
+            <input type="hidden" name="js_enabled" id="js_enabled" value="0" />
+            <input type="hidden" name="cookies_enabled" id="cookies_enabled" value="" />
+            <input type="hidden" name="login_name" id="login_name" value="" />
+            <input type="hidden" name="pwd_empty" id="pwd_empty" value="0" />
+
+            <div class="field">
+                <label for=""
+                       tal:attributes="for ac_name"
+                       i18n:translate="label_login_name">Login Name</label>
+                <br />
+                <input type="text"
+                       size="10"
+                       alt="Login Name"
+                       onclick="showCookieMessage('cookies_message')"
+                       tal:attributes="name ac_name; id ac_name;
+                                       value python:request.get(ac_name, '');
+                                       tabindex tabindex/next"
+                       i18n:attributes="alt label_login_name;"/>
+            </div>
+            
+            <div class="field">
+                <label for=""
+                       tal:attributes="for ac_password"
+                       i18n:translate="label_password">Password</label>
+                <br />
+                <input type="password"
+                       size="10"
+                       alt="Password"
+                       onclick="showCookieMessage('cookies_message')"
+                       tal:attributes="name ac_password; id ac_password;
+                                       tabindex tabindex/next;"
+                       i18n:attributes="alt label_password;"/>
+            </div>
+
+            <div id="cookies_message" i18n:translate="enable_cookies_message" class="portalMessage" style="display:none">
+                Cookies are not enabled. You must <span i18n:name="enable_cookies">
+                <a href="enabling_cookies" i18n:translate="label_enable_cookies">enable cookies</a></span> before you can log in.
+            </div>
+            
+            <div class="formControls">
+            
+                <input
+                       type="submit"
+                       name="submit"
+                       value="Log in"
+                       alt="Log in"
+                       tal:attributes="tabindex tabindex/next;
+                                  onclick string:javascript:return setLoginVars('$ac_name','login_name','$ac_password','pwd_empty','js_enabled','cookies_enabled');"
+                       i18n:attributes="value label_log_in; alt label_log_in;"/>
+            </div>
+        </form>
+    </dd>
+    
+    </dl>
+
+
+
+
+<dl class="portlet"
+    id="portlet-login"
+    tal:condition="python: not auth">
+
+    <dt class="portletHeader">
+        <a href="#" 
+           class="tile"
+           i18n:translate="box_sign_in">Log in</a>
+    </dt>
+
+    <dd class="portletItem"
+        tal:condition="python: not auth"
+        i18n:translate="login_portlet_disabled">
+        Cookie authentication is disabled. 
+        Login portlet not available.
+    </dd>
+
+</dl>
+</tal:block>
+
+<div style="margin-top:1em" tal:condition="python: not here.siteIsSetup()">
+  The Luci server has not been initialized. To initialize it, log in in to the server as root and run the command<br>
+  <code style="margin-left:+1.5em">luci_admin init</code>
+</div>
+
+
+</div>
+</body>
+</html>




More information about the Cluster-devel mailing list