<?xml version="1.0" encoding="UTF-8"?>
<authdriver name="remote" label="CONF_MESSAGE[Remote authentication]" description="CONF_MESSAGE[Authentication is done remotely (useful in CMS system).]" mixins="authdriver_commons"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
    <client_settings>
        <resources>
            <i18n namespace="remote_auth" path="plugins/auth.remote/i18n"/>
        </resources>
    </client_settings>
	<server_settings>
        <param name="CMS_TYPE" type="group_switch:cms" label="CONF_MESSAGE[CMS Type]" description="CONF_MESSAGE[Choose a predefined CMS or define your custom values]" mandatory="true"/>
        <param name="SECRET" type="string" label="CONF_MESSAGE[Secret key]" description="CONF_MESSAGE[This key must only be known by remote end]" mandatory="false" />
        <param name="USERS_FILEPATH" type="string" label="CONF_MESSAGE[Users]" description="CONF_MESSAGE[The users list]" mandatory="true"/>
        <!-- WP -->
        <param group_switch_name="cms" group_switch_label="WordPress" group_switch_value="wp" name="cms" type="hidden" label="" description="" default="wp"/>
        <param group_switch_name="cms" group_switch_label="WordPress" group_switch_value="wp" name="MASTER_URL" type="string" label="CONF_MESSAGE[Wordpress URL]" description="CONF_MESSAGE[URL of your WP installation, either http://host/path or simply /path if it's on the same host]" mandatory="false"/>
        <param group_switch_name="cms" group_switch_label="WordPress" group_switch_value="wp" default="/wp-login.php" name="LOGIN_URI" type="string" label="CONF_MESSAGE[Login URI]" description="CONF_MESSAGE[When not in slave mode, AJXP calls the given URL as URL?name=XXX&amp;pass=XXX&amp;key=XXX. Else it redirect to the given URL]" mandatory="true" />
        <param group_switch_name="cms" group_switch_label="WordPress" group_switch_value="wp" default="wordpress_remote_auth" name="MASTER_AUTH_FUNCTION" type="hidden" label="CONF_MESSAGE[Master Auth Function]" description="CONF_MESSAGE[User-defined function for performing real password check, necessary for REST API (including iOS client)]" mandatory="false"/>
        <param group_switch_name="cms" group_switch_label="WordPress" group_switch_value="wp" name="LOGOUT_ACTION" default="back" type="select" choices="logout|Logout,back|Back to main page" label="CONF_MESSAGE[Exit Action]" description="CONF_MESSAGE[Choose the action performed when the user wants to quit AjaXplorer : either trigger a Joomla! logout, or simply go back to the main page.]" mandatory="true" />
        <!-- Joomla! -->
        <param group_switch_name="cms" group_switch_label="Joomla!" group_switch_value="joomla" name="cms" type="hidden" label="" description="" default="joomla"/>
        <param group_switch_name="cms" group_switch_label="Joomla!" group_switch_value="joomla" name="MASTER_URL" type="string" label="CONF_MESSAGE[Joomla! URL]" description="CONF_MESSAGE[Full path to Joomla! installation, either in the form of http://localhost/joomla/ or simply /joomla/]" mandatory="true"/>
        <param group_switch_name="cms" group_switch_label="Joomla!" group_switch_value="joomla" name="LOGIN_URI" default="/" type="string" label="CONF_MESSAGE[Home node]" description="CONF_MESSAGE[Main page of your Joomla! installation that contains a login form. When not logged, accessing AjaXplorer will redirect to this page. It's also used for the API calls for logging in a user from within AjaXplorer. Make sure it does contain a login form!]" mandatory="true" />
        <param group_switch_name="cms" group_switch_label="Joomla!" group_switch_value="joomla" name="MASTER_AUTH_FUNCTION" default="joomla_remote_auth" type="hidden" label="CONF_MESSAGE[Master Auth Function]" description="CONF_MESSAGE[User-defined function for performing real password check, necessary for REST API (including iOS client)]" mandatory="false"/>
        <param group_switch_name="cms" group_switch_label="Joomla!" group_switch_value="joomla" name="MASTER_AUTH_FORM_ID" default="login-form" type="string" label="CONF_MESSAGE[Auth Form ID]" description="CONF_MESSAGE[The HTML ID of the form tag displayed for login on the page defined previously. Not necessary for WP, login-form by default for Joomla, and user-login-form for Drupal]" mandatory="false"/>
        <param group_switch_name="cms" group_switch_label="Joomla!" group_switch_value="joomla" name="LOGOUT_ACTION" default="back" type="hidden" label="CONF_MESSAGE[Exit Action]" description="CONF_MESSAGE[Choose the action performed when the user wants to quit AjaXplorer : either trigger a Joomla! logout, or simply go back to the main page.]" mandatory="true" />
        <!-- Drupal -->
        <param group_switch_name="cms" group_switch_label="Drupal" group_switch_value="drupal" name="cms" type="hidden" label="" description="" default="drupal"/>
        <param group_switch_name="cms" group_switch_label="Drupal" group_switch_value="drupal" name="MASTER_URL" type="string" label="CONF_MESSAGE[Drupal URL]" description="CONF_MESSAGE[Full path to Drupal installation, either in the form of http://localhost/drupal/ or simply /drupal/]" mandatory="true"/>
        <param group_switch_name="cms" group_switch_label="Drupal" group_switch_value="drupal" name="LOGIN_URI" type="string" label="CONF_MESSAGE[Login URL]" description="CONF_MESSAGE[Main page of your Drupal installation that contains a login form. When not logged, accessing AjaXplorer will redirect to this page. It's also used for the API calls for logging in a user from within AjaXplorer. Make sure it does contain a login form.]" mandatory="true" />
        <param group_switch_name="cms" group_switch_label="Drupal" group_switch_value="drupal" name="MASTER_AUTH_FUNCTION" type="hidden" default="drupal_remote_auth" label="" description="" mandatory="false"/>
	    <param group_switch_name="cms" group_switch_label="Drupal" group_switch_value="drupal" name="MASTER_AUTH_FORM_ID" type="string" default="user-login-form" label="CONF_MESSAGE[Auth Form ID]" description="CONF_MESSAGE[The HTML ID of the form tag displayed for login on the page defined previously. Not necessary for WP, login-form by default for Joomla, and user-login-form for Drupal]" mandatory="false"/>
        <param group_switch_name="cms" group_switch_label="Drupal" group_switch_value="drupal" name="LOGOUT_ACTION" default="back" type="select" choices="logout|Logout,back|Back to main page" label="CONF_MESSAGE[Exit Action]" description="CONF_MESSAGE[Choose the action performed when the user wants to quit AjaXplorer : either trigger a Joomla! logout, or simply go back to the main page.]" mandatory="true" />
        <!-- Custom -->
        <param group_switch_name="cms" group_switch_label="Custom" group_switch_value="custom" name="cms" type="hidden" label="" description="" default="custom"/>
        <param group_switch_name="cms" group_switch_label="Custom" group_switch_value="custom" name="LOGIN_URL" type="string" label="CONF_MESSAGE[Login URL]" description="CONF_MESSAGE[When not in slave mode, AJXP calls the given URL as URL?name=XXX&amp;pass=XXX&amp;key=XXX. Else it redirect to the given URL]" mandatory="true" />
        <param group_switch_name="cms" group_switch_label="Custom" group_switch_value="custom" name="LOGOUT_URL" type="string" label="CONF_MESSAGE[Logout URL]" description="CONF_MESSAGE[Redirect to the given URL on loggin out]" mandatory="false" />
	    <param group_switch_name="cms" group_switch_label="Custom" group_switch_value="custom" name="MASTER_AUTH_FUNCTION" type="string" label="CONF_MESSAGE[Custom Auth Function]" description="CONF_MESSAGE[User-defined function for performing real password check, necessary for REST API (including iOS client). Add this function inside the plugin cms_auth_functions.php file]" mandatory="true"/>
	</server_settings>
	<class_definition filename="plugins/auth.remote/class.remoteAuthDriver.php" classname="remoteAuthDriver"/>
	<registry_contributions>
		<external_file filename="plugins/core.auth/standard_auth_actions.xml" include="actions/*" exclude="actions/action[@name='logout']"/>
		<external_file filename="plugins/auth.remote/remoteAuthActions.xml" include="actions/*"/>		
	</registry_contributions>
</authdriver>