cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Man <Martin....@seznam.cz>
Subject Re: [c2] [patch] validator action feature
Date Fri, 27 Apr 2001 19:35:29 GMT
On Fri, Apr 27, 2001 at 08:59:27PM +0200, Martin Man wrote:
> hi all,
> 	attached is a patch that enables new functionality in form and session
> validator. it is a new way to specify which parameters to validate and
> hopefully it cleans a little bit sitemap and introduces more flexibile syntax
> (comparsion of parameters and comparsion to strings is possible, now just
> specify what to implement more...)
> 
> <map:act type="session-validator">
>     <parameter name="descriptor" value="context://desc.xml"/>
>     <parameter name="validate-set" value="is-logged-in"/>
> </map:act>
> 
> where desc.xml contains
> <root>
>     <parameter name="username" type="string" nullable="no"/>
>     <parameter name="role" type="string" nullable="no"/>
> 
>     <constraint-set name="is-logged-in">
>         <validate name="username"/>
>         <validate name="role"/>
>     </constraint-set>
> 
>     <constraint-set name="is-logged-in-admin-role">
>         <validate name="username"/>
>         <validate name="role" equals-to="admin"/>
>     </constraint-set>
> 
>     <constraint-set name="do-new-passwords-match">
>         <validate name="newpass"/>
>         <validate name="renewpass" equals-to-admin="newpass"/>
oops, typo here
         <validate name="renewpass" equals-to-param="newpass"/>
>     </constraint-set>
> </root>
> 
> rgds,
> martin man

BTW: old functionality with
<parameter name="validate" value="username,role"/>
is still preserved...
-- 
-------------------------------------------------------------------------------
"Only dead fish swims with a stream"
gpg_key_available: http://globales.cz/~mman/martin.man.gpg
gpg_key_fingerprint: 2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message