<?xml version="1.0" encoding="UTF-8"?>
<authdriver enabled="false" name="ftp" label="CONF_MESSAGE[FTP authentication]" description="CONF_MESSAGE[Authenticate users by validating their credentials against an FTP server.]" 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="ftp_auth" path="plugins/auth.ftp/i18n"/>
        </resources>
    </client_settings>
	<server_settings>
        <param name="TEST_CONNEXION" type="button" choices="run_plugin_action:auth.ftp:testParameters" default="auth.ftp" label="CONF_MESSAGE[Test connection]" description="CONF_MESSAGE[Test connection to the FTP server]" mandatory="false"/>
        <param name="FTP_LOGIN_SCREEN" type="boolean" label="CONF_MESSAGE[FTP Login Screen]" description="CONF_MESSAGE[Replace the default connection screen (username and password) by a screen allowing users to enter their own FTP connection data (server, port, etc.)]" mandatory="true" default="false"/>
        <param name="REPOSITORY_ID" type="select" choices="json_list:list_all_repositories_json" label="CONF_MESSAGE[Workspace]" description="CONF_MESSAGE[ID of the workspace used to validate credentials]" mandatory="true"/>
	</server_settings>
	<class_definition filename="plugins/auth.ftp/FtpAuthDriver.php" classname="Pydio\Auth\Driver\FtpAuthDriver"/>
	<registry_contributions>
		<external_file filename="plugins/core.auth/standard_auth_actions.xml" include="actions/action[@name='back']" exclude=""/>
        <actions>
			<action name="set_ftp_data">
				<rightsContext noUser="false" userLogged="hidden" guestLogged="show" read="false" write="false" adminOnly=""/>
				<processing>
					<serverCallback methodName="setFtpDataCallback"/>
				</processing>
			</action>
			<!-- OVERRIDE LOGOUT -->
			<action name="ftp_logout" expireDefault="true">
				<gui text="164" title="169" accessKey="" hasAccessKey="false" iconClass="mdi mdi-logout">
					<context selection="false" dir="" recycle="false"
						actionBar="false" contextMenu="false" infoPanel="false"
						actionBarGroup="zlogin,minisite">
					</context>
				</gui>
				<rightsContext noUser="false" userLogged="only" guestLogged="hidden" read="false" write="false" adminOnly=""/>
				<processing>
					<clientCallback><![CDATA[
						PydioApi.getClient().request({get_action:'ftp_logout'});
						]]></clientCallback>
					<serverCallback methodName="logoutCallback"/>
				</processing>
			</action>
		</actions>
	</registry_contributions>
	<dependencies>
		<pluginClass pluginName="access.ftp"/>
	</dependencies>
</authdriver>
