cziegeler    2002/06/25 01:52:58

  Modified:    src/documentation/xdocs/developing/webapps
                        authentication.xml
               src/java/org/apache/cocoon/webapps/authentication/acting
                        LoginAction.java
               src/webapp/samples/portal sitemap.xmap
  Log:
  Using new input modules for the login action instead of creating own syntax
  
  Revision  Changes    Path
  1.3       +8 -7      
xml-cocoon2/src/documentation/xdocs/developing/webapps/authentication.xml
  
  Index: authentication.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/developing/webapps/authentication.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- authentication.xml        18 Jun 2002 03:36:02 -0000      1.2
  +++ authentication.xml        25 Jun 2002 08:52:58 -0000      1.3
  @@ -122,8 +122,8 @@
           <source>&lt;map:match pattern="login"&gt;
     &lt;map:act type="auth-login"&gt;
       &lt;map:parameter name="handler" value="unique"/&gt;
  -    &lt;map:parameter name="parameter_userid" value="request:name"/&gt;
  -    &lt;map:parameter name="parameter_password" value="request:password"/&gt;
  +    &lt;map:parameter name="parameter_userid" value="{request:name}"/&gt;
  +    &lt;map:parameter name="parameter_password" value="{request:password}"/&gt;
       &lt;map:redirect-to uri="authentication-successful"/&gt;
     &lt;/map:act&gt;
     &lt;!-- authentication failed: --&gt;
  @@ -131,15 +131,16 @@
     &lt;map:transform src="tohtml.xsl"/&gt;
     &lt;map:serialize/&gt;
   &lt;/map:match&gt;</source>
  -        <p>The "auth-protect" action uses the handler parameter to call the
  +        <p>The <em>auth-login</em> action uses the handler parameter to call the
             authentication resource of this handler. This authentication resource 
needs to
             know the information provided by the user. For each piece of information 
an own
  -          parameter is created which name starts with "parameter_". So in the 
example
  +          parameter is created which name starting with "parameter_". So in the 
example
             above, the authentication resource gets two parameters: userid and 
password. As
             the values for these parameters were send by a form they need to be 
passed on
  -          to the authentication resource. If you use "request:..." for the value of 
a
  -          parameter, the auth-login action will pass the actual value of that 
request
  -          parameter to the authentication resource.</p>
  +          to the authentication resource. If you use "{request:...}" for the value 
of a
  +          parameter, the <em>auth-login</em> action will pass the actual value of 
that request
  +          parameter to the authentication resource (by using the input modules 
concept
  +          of Cocoon).</p>
           <p>If the user is not authenticated with this handler, the framework calls
             the authentication resource and passes it the parameters. If this
             authentication is successful, the action returns an empty map and the 
sitemap
  
  
  
  1.3       +2 -7      
xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/acting/LoginAction.java
  
  Index: LoginAction.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/acting/LoginAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LoginAction.java  19 Apr 2002 11:02:58 -0000      1.2
  +++ LoginAction.java  25 Jun 2002 08:52:58 -0000      1.3
  @@ -105,13 +105,8 @@
               for(int i = 0; i < enum.length; i++) {
                   final String key = enum[i];
                   if ( key.startsWith("parameter_") ) {
  -                    String value = par.getParameter(key);
  -                    if ( value.startsWith("request:") ) {
  -                        value = request.getParameter( 
value.substring("request:".length()) );
  -                        if (value == null) value = "";
  -                    }
                       authenticationParameters.setParameter( 
key.substring("parameter_".length()),
  -                                                           value);
  +                                                           par.getParameter(key));
                   }
               }
   
  
  
  
  1.4       +2 -2      xml-cocoon2/src/webapp/samples/portal/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/portal/sitemap.xmap,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sitemap.xmap      6 Jun 2002 12:08:37 -0000       1.3
  +++ sitemap.xmap      25 Jun 2002 08:52:58 -0000      1.4
  @@ -102,8 +102,8 @@
                </map:act>
                <map:act type="auth-login">
                <map:parameter name="handler" value="portalhandler"/>
  -                     <map:parameter name="parameter_name" value="request:name"/>
  -                     <map:parameter name="parameter_password" 
value="request:password"/>
  +                     <map:parameter name="parameter_name" value="{request:name}"/>
  +                     <map:parameter name="parameter_password" 
value="{request:password}"/>
                        <map:redirect-to uri="sunspotdemo-portal"/>
              </map:act>
                <map:generate src="resources/free/auth.xml"/>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to