Got an iPhone or iPad? We have a brand new Pastebin App for both devices, and it's totally free! Click here to download the new Pastebin App for iOS.
Guest

Untitled

By: a guest on Feb 10th, 2010  |  syntax: None  |  size: 6.32 KB  |  hits: 43  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <ae:configurations
  3.         xmlns="http://agavi.org/agavi/config/parts/validators/1.0"
  4.         xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0"
  5.         parent="%core.module_dir%/UserAuthentication/config/validators.xml"
  6. >
  7.         <ae:configuration>
  8.                
  9.     <validators method="write">
  10.           <validator class="string" required="true" name="firstname_valid">
  11.         <argument>firstname</argument>
  12.         <error>You did not enter a first name.</error>
  13.         <ae:parameters>
  14.           <ae:parameter name="min">1</ae:parameter>
  15.         </ae:parameters>
  16.       </validator>
  17.          
  18.          <validator class="string" required="true" name="lastname_valid">
  19.         <argument>lastname</argument>
  20.         <error>Your did not enter a last name.</error>
  21.         <ae:parameters>
  22.           <ae:parameter name="min">1</ae:parameter>
  23.         </ae:parameters>
  24.       </validator>
  25.          
  26.          <validator class="string" name="customer_specification" provides="customer_specification">
  27.                 <arguments>
  28.         <argument>customer</argument>
  29.                 </arguments>
  30.                 <errors>
  31.                         <error>You did not enter a company.</error>
  32.                 </errors>      
  33.         <ae:parameters>
  34.           <ae:parameter name="min">1</ae:parameter>
  35.         </ae:parameters>
  36.       </validator>
  37.          
  38.         <validator class="not" name="customer_usage" depends="customer_specification">
  39.                 <validator class="UserAuthenticationCustomerValidator">
  40.                         <arguments>
  41.                                 <argument>customer</argument>
  42.                         </arguments>
  43.                 </validator>
  44.                 <errors>
  45.                         <error>That company is already registered, please contact your company administrator to add you.</error>
  46.                 </errors>
  47.         </validator>
  48.          
  49.  
  50.           <validator class="string" name="username_valid" depends="username_specification">
  51.         <argument>username</argument>
  52.         <error>You must provide a username of at least 6 charachters.</error>
  53.         <ae:parameters>
  54.           <ae:parameter name="min">6</ae:parameter>
  55.         </ae:parameters>
  56.       </validator>
  57.            
  58.                 <validator class="string" name="password_specification" provides="password_specification">
  59.                                 <arguments>
  60.                                         <argument>password</argument>
  61.                                 </arguments>
  62.                                 <errors>
  63.                                         <error for="required">You must provide a password.</error>
  64.                                 </errors>
  65.                                 <ae:parameters>
  66.                                         <ae:parameter name="min">6</ae:parameter>
  67.                                 </ae:parameters>
  68.                         </validator>
  69.                        
  70.                         <validator class="string" name="password_confirm_specification" provides="password_confirm_specification" depends="password_specification">
  71.                                 <arguments>
  72.                                         <argument>conpassword</argument>
  73.                                 </arguments>
  74.                                 <errors>
  75.                                         <error for="required">You must confirm your password.</error>
  76.                                 </errors>
  77.                                 <ae:parameters>                                                    
  78.                                         <ae:parameter name="min">6</ae:parameter>
  79.                                 </ae:parameters>
  80.                         </validator>
  81.                        
  82.                         <validator class="equals" name="password_and_password_confirm_validation" depends="password_specification password_confirm_specification">
  83.                                 <arguments>
  84.                                         <argument>password</argument>
  85.                                         <argument>conpassword</argument>
  86.                                 </arguments>
  87.                                 <errors>
  88.                                         <error>The passwords must match.</error>
  89.                                 </errors>
  90.                         </validator>
  91.          
  92.                         <validator class="string" name="email_specification" provides="email_specification">
  93.                                 <arguments>
  94.                                         <argument>email</argument>
  95.                                 </arguments>
  96.                                 <errors>
  97.                                         <error for="required">You must provide your e-mail address.</error>
  98.                                         <error for="max">Your e-mail address may not exceed 255 characters in length.</error>
  99.                                 </errors>
  100.                                 <ae:parameters>
  101.                                         <ae:parameter name="min">1</ae:parameter>
  102.                                         <ae:parameter name="max">255</ae:parameter>
  103.                                         <ae:parameter name="trim">true</ae:parameter>
  104.                                         <ae:parameter name="export">email</ae:parameter>
  105.                                 </ae:parameters>
  106.                         </validator>
  107.  
  108.                         <validator class="email" name="email_validation" depends="email_specification" provides="email_valid">
  109.                                 <arguments>
  110.                                         <argument>email</argument>
  111.                                 </arguments>
  112.                                 <errors>
  113.                                         <error>You must provide a valid e-mail address.</error>
  114.                                 </errors>
  115.                         </validator>
  116.  
  117.                         <validator class="not" name="email_usage" depends="email_valid">
  118.                                 <validator class="UserAuthenticationEmailValidator">
  119.                                         <arguments>
  120.                                                 <argument>email</argument>
  121.                                         </arguments>
  122.                                 </validator>
  123.                                 <errors>
  124.                                         <error>That e-mail address is already in use.</error>
  125.                                 </errors>
  126.                         </validator>
  127.  
  128.  
  129.                 </validators>
  130.                
  131.         </ae:configuration>
  132. </ae:configurations>
  133.  
  134. <?xml version="1.0" encoding="UTF-8"?>
  135. <ae:configurations xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0" xmlns="http://agavi.org/agavi/config/parts/filters/1.0">
  136.  
  137.         <!-- this section is only for web contexts -->
  138.         <ae:configuration context="web">
  139.                 <filters>
  140.                         <filter name="FormPopulationFilter" class="AgaviFormPopulationFilter">
  141.                                 <ae:parameter name="methods">
  142.                                         <ae:parameter>write</ae:parameter>
  143.                                 </ae:parameter>
  144.                                 <ae:parameter name="output_types">
  145.                                         <ae:parameter>html</ae:parameter>
  146.                                 </ae:parameter>
  147.                                 <ae:parameter name="field_error_messages">
  148.                                         <ae:parameter name="parent::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' contacular-input-element ')]">
  149.                                                 <ae:parameter name="location">after</ae:parameter>
  150.                                                 <ae:parameter name="container"><![CDATA[${errorMessages}]]></ae:parameter>
  151.                                                 <ae:parameter name="markup"><![CDATA[<div class="contacular-error">${errorMessage}</div>]]></ae:parameter>
  152.                                         </ae:parameter>
  153.                                 </ae:parameter>
  154.                                 <ae:parameter name="error_messages">
  155.                                         <ae:parameter name="self::*">
  156.                                                 <ae:parameter name="location">before</ae:parameter>
  157.                                                 <ae:parameter name="container"><![CDATA[<div class="contacular-display-error"><strong>The following errors occurred while processing your request:</strong><ul>${errorMessages}</ul></div>]]></ae:parameter>
  158.                                                 <ae:parameter name="markup"><![CDATA[<li>${errorMessage}</li>]]></ae:parameter>
  159.                                         </ae:parameter>
  160.                                 </ae:parameter>
  161.                                 <ae:parameter name="error_class">contacular-input-error</ae:parameter>
  162.                         </filter>
  163.  
  164.                         <!-- <filter name="TidyFilter" class="AgaviTidyFilter">
  165.                                 <ae:parameter name="tidy_options">
  166.                                         <ae:parameter name="output-xhtml">true</ae:parameter>
  167.                                         <ae:parameter name="numeric-entities">true</ae:parameter>
  168.                                 </ae:parameter>
  169.                                 <ae:parameter name="tidy_encoding">utf8</ae:parameter>
  170.                         </filter> -->
  171.                 </filters>
  172.  
  173.         </ae:configuration>
  174.  
  175. </ae:configurations>