Gateway: Configuring

From CFTP

Jump to: navigation, search

This explains configuration for the latest Version 1.02


The plug-in is configured in the file conf/beans.xml located in your server's home directory.


Contents

Plain XML module

Users and passwords stored in the conf/xml-users.xml in your FTP server. This is a very simple proprietary XML file. It contains user tags and every tag defines username, password and role attributes. The role is an optional attribute which is not used by any known implementation at the time of this writing.


Constructor of the DAO object (XmlUserDAO) you installed into your beans.xml takes the name of the XML file and reads usernames and passwords from there.


Spring XML module

This module has been deprecated due to its poor design

User objects stored in the conf/spring-users.xml file in your FTP server. Spring Framework reads this XML file and creates a list of user objects. This must be a valid Spring Framework XML file and the file must contain users set with all the available users.


Constructor of the DAO object (SpringUserDAO) you installed into your beans.xml takes the name of the XML file and feeds it to its internal Spring Framework factory.


Database module

<bean id="databaseUserDAO"
  class="com.coldcore.coloradoftp.plugin.gateway.dao.database.DatabaseUserDAO">
  <constructor-arg index="0" ref="usersDataSource"/>
  <property name="table" value="users"/>
  <property name="nameColumn" value="name"/>
  <property name="passColumn" value="passwd"/>
  <property name="roleColumn" value="role"/>
</bean>

Properties you may apply:


constructor

A data source to use. Connections will be created from this data source and closed after. You must add this bean yourself and point it to your database. If you not sure how to describe a data source, look for examples in the internet.


table

Table name that holds users' records. Defaults value is USERS.


nameColumn

Column name that holds usernames. Default column is USERNAME.


passColumn

Column name that holds passwords. Default column is PASSWORD.


nameColumn

Column name that holds roles. If you do not want to use roles then set it to the same value as the nameColumn and the role will be the same as the username. Default column is ROLE.


Acegi module

<bean id="acegiUserDAO"
  class="com.coldcore.coloradoftp.plugin.gateway.dao.acegi.ExternalAcegiUserDAO">
  <constructor-arg index="0" value="conf/acegi-conf.xml"/>
</bean>

Properties you may apply:


constructor

A Spring file to read configuration from.


acegi-conf.xml

This file must define authenticationManager and allowedUserRoles those will be loaded automatically. To modify acegi-conf.xml file you have to know how Acegi works.


Set allowedUserRoles defines the user roles allowed to sign in. If the set is empty then all users will be allowed. In the example below only administrators and employees will be allowed to sign in:

<bean id="allowedUserRoles" class="java.util.HashSet">
  <constructor-arg index="0">
    <set>
      <value>ROLE_ADMIN</value>
      <value>ROLE_EMPLOYEE</value>
    </set>
  </constructor-arg>
</bean>



Return to Plug-in: Gateway

Personal tools