<web-app xmlns="http://caucho.com/ns/resin"
         xmlns:resin="urn:java:com.caucho.resin">

  <servlet-mapping url-pattern="*.php"
                   servlet-class="com.caucho.quercus.servlet.QuercusServlet">
     <init compile="false">
       <!--
         if the application being deployed is greater then 128Mb (134217728)
         please increase the value accordingly
       -->
       <php-ini upload_max_filesize="134217728"/>
     </init>
  </servlet-mapping>

  <session-config>
    <use-persistent-store/>
  </session-config>

  <!--
     - Security configuration
    -->
  <resin:LoginList>
    <resin:FormLogin login-page="/login.php"
                     error-page="/error.php"
                     authenticator="#{resinAdmin}"/>
    <resin:BasicLogin authenticator="#{resinAdmin}"/>
  </resin:LoginList>

  <resin:Require>
    <resin:if test="${! resin_admin_external}">
      <resin:IfNetwork>
        <value>127.0.0.1</value>
        <value>192.168.0.0/16</value>
        <value>[::1]</value>
      </resin:IfNetwork>
    </resin:if>

    <resin:if test="${! resin_admin_insecure}">
      <resin:IfSecure/>
    </resin:if>
  </resin:Require>

  <resin:Allow>
    <url-pattern>/login.php</url-pattern>
    <url-pattern>/error.php</url-pattern>
  </resin:Allow>

  <resin:Allow>
    <url-pattern>*.php</url-pattern>
    <resin:IfUserInRole role="resin-admin"/>
  </resin:Allow>

</web-app>
