svn commit: r645311 - in /lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac: login-shibboleth.xsl login-user.xsl

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Sun Apr  6 14:37:39 2008
New Revision: 645311

URL: http://svn.apache.org/viewvc?rev=645311&view=rev
Log:
Don't show login form for pages that are only protected with rules.

Modified:
    lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac/login-shibboleth.xsl
    lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac/login-user.xsl

Modified: lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac/login-shibboleth.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac/login-shibboleth.xsl?rev=645311&r1=645310&r2=645311&view=diff
==============================================================================
--- lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac/login-shibboleth.xsl (original)
+++ lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac/login-shibboleth.xsl Sun Apr  6 14:37:39 2008
@@ -16,21 +16,23 @@
   limitations under the License.
 -->
 
-<!-- $Id: login.xsl 473841 2006-11-12 00:46:38Z gregor $ -->
-    
-    <xsl:stylesheet version="1.0"
-      xmlns:i18n="http://apache.org/cocoon/i18n/2.1"      
-      xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
-      xmlns:session="http://www.apache.org/xsp/session/2.0"
-      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-      
-      <xsl:import href="login-user.xsl"/>
-      
-      <xsl:template name="afterLoginForm">
-        <br/>
-        <a href="?lenya.usecase=shibboleth&amp;lenya.step=wayf">Login via Shibboleth</a>
-      </xsl:template>
-      
-    </xsl:stylesheet>
-    
-    
\ No newline at end of file
+<xsl:stylesheet version="1.0"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"      
+  xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+  xmlns:session="http://www.apache.org/xsp/session/2.0"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  
+  <xsl:import href="login-user.xsl"/>
+  
+  <xsl:template name="loginFormWrapper">
+    <xsl:if test="not(/page/body/login/errors/error[normalize-space() = 'shibboleth-delete-cookies'])">
+      <xsl:call-template name="loginForm"/>
+      <br/>
+    </xsl:if>
+    <a href="?lenya.usecase=shibboleth&amp;lenya.step=wayf">Login via Shibboleth</a>
+  </xsl:template>
+  
+  
+</xsl:stylesheet>
+

Modified: lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac/login-user.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac/login-user.xsl?rev=645311&r1=645310&r2=645311&view=diff
==============================================================================
--- lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac/login-user.xsl (original)
+++ lenya/branches/branch_1_2_x_shibboleth/src/webapp/lenya/xslt/ac/login-user.xsl Sun Apr  6 14:37:39 2008
@@ -22,6 +22,7 @@
       xmlns:i18n="http://apache.org/cocoon/i18n/2.1"      
       xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
       xmlns:session="http://www.apache.org/xsp/session/2.0"
+      xmlns="http://www.w3.org/1999/xhtml"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       <xsl:output indent="yes" version="1.0" />
       <xsl:param name="publication_name" />
@@ -75,36 +76,49 @@
             <i18n:text>Login</i18n:text>
           </div>
           <div class="lenya-box-body">
-            <form name="login" method="post" action="?lenya.usecase=login&amp;lenya.step=login">
-              <table class="lenya-table-noborder">
-                <tr>
-                  <td>
-                    <i18n:text>Username</i18n:text>:</td>
-                  <td>
-                    <input class="lenya-form-element" name="username"
-                      type="text" />
-                  </td>
-                </tr>
-                <tr>
-                  <td>
-                    <i18n:text>Password</i18n:text>:</td>
-                  <td>
-                    <input class="lenya-form-element" name="password"
-                      type="password" />
-                  </td>
-                </tr>
-                <tr>
-                  <td />
-                  <td>
-                    <input i18n:attr="value" type="submit" value="Login" name="submit"/>
-                  </td>
-                </tr>
-              </table>
-            </form>
-            <xsl:call-template name="afterLoginForm"/>
+            <xsl:call-template name="loginFormWrapper"/>
           </div>
         </div>
       </xsl:template>
+      
+      
+      <!--
+        This template allows extending stylesheets to hide or change the login form.
+      -->
+      <xsl:template name="loginFormWrapper">
+        <xsl:call-template name="loginForm"/>
+      </xsl:template>
+      
+      
+      <xsl:template name="loginForm">
+        <form name="login" method="post" action="?lenya.usecase=login&amp;lenya.step=login">
+          <table class="lenya-table-noborder">
+            <tr>
+              <td>
+                <i18n:text>Username</i18n:text>:</td>
+              <td>
+                <input class="lenya-form-element" name="username"
+                  type="text" />
+              </td>
+            </tr>
+            <tr>
+              <td>
+                <i18n:text>Password</i18n:text>:</td>
+              <td>
+                <input class="lenya-form-element" name="password"
+                  type="password" />
+              </td>
+            </tr>
+            <tr>
+              <td />
+              <td>
+                <input i18n:attr="value" type="submit" value="Login" name="submit"/>
+              </td>
+            </tr>
+          </table>
+        </form>
+      </xsl:template>
+      
       
       <xsl:template name="afterLoginForm"/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.