user.js

/**
 * @classdesc
 * Represents a CompleteFTP user. It may be a Windows or Non-Windows user. 
 * Instances of this class should be obtained using {@link UserManager#get UserManager.get}.
 * @class
 * @hideconstructor
*/
User = function () {
	/**
	* The ID of this user.
	*
	* @type {String}
	* @readonly
	*/
	this.id = null;

	/**
	* The user-name of this user. This is the name they must log in with.
	*
	* @type {String}
	*/
	this.userName = null;

	/**
	* The type of this user. This must be 'Windows' or 'Non-Windows'. 
	*
	* @type {String}
	* @readonly
	*/
	this.type = null;

	/**
	* The full name of this user.
	*
	* @type {String}
	*/
	this.fullName = null;

	/**
	* The password of this user. Returns "" if {@link site$storeEncryptedPasswords|site.storeEncryptedPasswords} 
	* is disabled. 
	*
	* Note that this property is not required for Windows users. 
	* 
	* @type {String} 
	*/
	this.password = null;

	/**
	* The hash of this user's password.
	*
	* @type {String}
	* @readOnly
	*/
	this.passwordHash = null;

	/**
	* The description of this user.
	*
	* @type {String}
	*/
	this.description = null;

	/**
	* A user's e-mail address may be used in e-mail notifications.
	*
	* @type {String}
	*/
	this.email = null;

	/**
	* Determines which type of console interface (shell) the user is placed into when they connect
	* with SSH terminal. Currently 'UNIX' and 'JSS' are supported.
	*
	* @type {String}
	*/
	this.sshTerminalShell = null;

	/**
	* Is this user currently enabled?
	*
	* @type {Boolean}
	*/
	this.enabled = null;

	/**
	* Is the FTP protocol enabled for this user? 
	*
	* @type {Boolean}
	*/
	this.ftpEnabled = null;

	/**
	* Is the FTPS protocol enabled for this user? If {@link User#ftpEnabled User.ftpEnabled} is false and 
	* {@link User#ftpsEnabled User.ftpsEnabled} is true, then clients must connect using FTPS.
	*
	* @type {Boolean}
	*/
	this.ftpsEnabled = null;

	/**
	* Is the HTTP protocol enabled for this user?
	*
	* @type {Boolean}
	*/
	this.httpEnabled = null;

	/**
	* Is the HTTPS protocol enabled for this user?
	*
	* @type {Boolean}
	*/
	this.httpsEnabled = null;

	/**
	* Is Server-Side Javascript (JSS) enabled for this user? If it is, then JSS
	* will be enabled for .jss files in folders owned by this user. 
	*
	* JSS must also be enabled for the site serving up the page (see {@link Site#jssEnabled Site.jssEnabled}).
	*
	* @type {Boolean}
	*/
	this.jssEnabled = null;

	/**
	* Is the SCP protocol enabled for this user?
	*
	* @type {Boolean}
	*/
	this.scpEnabled = null;

	/**
	* Is the SFTP protocol enabled for this user?
	*
	* @type {Boolean}
	*/
	this.sftpEnabled = null;

	/**
	* Is local SSH TCP/IP forwarding enabled for this user? If it is, then local (to a client machine)
	* SSH tunnels can be established between a client and CompleteFTP, and data will be forwarded
	* on to the host specified when the tunnel was set up. On the client side, the tunnel must 
	* be set up by an SSH utility such as PuTTY. 
	*
	* @type {Boolean}
	*/
	this.sshForwardingEnabled = null;

	/**
	* Is SSH terminal access enabled for this user? If it is, SSH terminal access must be enabled
	* for the site as well as the user (see {@link Site#sshTerminalEnabled Site.sshTerminalEnabled}).
	* Non-Windows users cannot use 'exec' in the terminal to minimize security risks.
	*
	* @type {Boolean}
	*/
	this.sshTerminalEnabled = null;

	/**
	* An array of SSH authentication methods ('Password' | 'PublicKey' | 'PublicKeyAndPassword' | 'All') 
	* available for this user.
	*
	* The SSH authentication methods are also specified at the site level 
	* (see {@link Site#sshAuthMethods Site.sshAuthMethods}). 
	* When a user logs in, only the authentication methods specified at both levels are 
	* available. For example, if the site permits password only, and the user
	* permits password and publickey, then only password will be available.
	*
	* @type {String[]} 
	*/
	this.sshAuthMethods = null;

	/**
	* An array of RSA public keys in OpenSSH format that the user may use to authenticate with.
	*
	* @type {String[]}
	*/
	this.sshPublicKeyRSA = null;

	/**
	* An array of DSA public keys in OpenSSH format that the user may use to authenticate with.
	*
	* @type {String[]}
	*/
	this.sshPublicKeyDSA = null;

	/**
	* An array of ECDSA public keys in OpenSSH format that the user may use to authenticate with.
	*
	* @type {String[]}
	*/
	this.sshPublicKeyECDSA = null;

	/**
	* Is this an inbuilt user who is created automatically during installation? 
	*
	* @type {Boolean}
	* @readonly
	*/
	this.inbuilt = null;

	/**
	* Access control setting for this user which must be 'Non-Windows' or 'Windows'. If it's set to 
	* 'Windows', then the user's file-access permissions will be controlled by Windows. 
	* Otherwise, those will be controlled by CompleteFTP.
	*
	* Note that Windows users may have their permissions controlled by Windows or CompleteFTP but 
	* the permissions of non-Windows users are always controlled by CompleteFTP.
	*
	* @type {String}
	*/
	this.accessControl = null;

	/**
	* A user's bandwidth quota can be set for download, meaning that if the set rate is exceeded, 
	* the download will be slowed down. 
	*
	* Note that bandwidth quotas are per site, so if in the Enterprise Edition a user is enabled
	* on two sites, they will have double the bandwidth compared to a single site.
	* 
	* The default is zero means unlimited, and the value is entered in bytes/second.
	*
	* @type {Number}
	*/
	this.quotaSpeedDownload = null;

	/**
	* A user's bandwidth quota can be set for upload, meaning that if the set rate is exceeded,
	* the upload will be slowed down.
	* 
	* Note that bandwidth quotas are per site, so if in the Enterprise Edition a user is enabled
	* on two sites, they will have double the bandwidth compared to a single site.
	*
	* The default is zero means unlimited, and the value is entered in bytes/second.
	*
	* @type {Number}
	*/
	this.quotaSpeedUpload = null;

	/**
	* A user's disk quota can be set, meaning that uploads will fail if the quota is exceeded. 
	* The disk quota is a cumulative limit across all sites (in the Enterprise Edition).
	*
	* The default is zero means unlimited, and the value is entered in bytes.
	*
	* @type {Number}
	*/
	this.quotaStorage = null;

	/**
	* Date and time when the user was created.
	* 
	* @type {Date}
	* @readonly
	*/
	this.createdTime = null;

	/**
	* Date and time when the user was last modified.
	* 
	* @type {Date}
	* @readonly
	*/
	this.modifiedTime = null;

	/**
	* The user's expiry date. After this date the user cannot log in, which is useful for temporary users.
	*
	* @type {Date}
	*/
	this.expiryDate = null;

	/**
	* Is File sharing enabled for this user? It must be enabled for users to begin using
	* CompleteBox to share their files.
	*
	* The CompleteFTP site must have sharing enabled (see {@link Site#sharingEnabled Site.sharingEnabled}).
	*
	* @type {Boolean}
	*/
	this.sharingEnabled = null;

	/**
	* If this flag is set then the user will be unable to make upload, delete and rename files and folders.
	*
	* @type {Boolean}
	*/
	this.readOnly = null;

	/**
	* File encryption mode setting for this user which must be 'GlobalEncryption' or 'EncryptionOff'.
	* If it's set to 'GlobalEncryption' and the site also has the equivalent setting enabled 
	* (see {@link Site#fileEncryptionMode Site.fileEncryptionMode}), all files
	* transferred to the server by this user will be encrypted on the server (encryption at rest). 
	* The only way to decrypt files is by transferring them from the server, or via  {@link https://enterprisedt.com/products/completeftp/doc/guide/html/admincommands.html an administrator command}.
	*  
	* @type {String}
	*/
	this.fileEncryptionMode = null;

	/**
	* An array of {@link SiteMapping} objects represents the sites and home folders setting for this user.
	* 
	* @type {SiteMapping[]}
	*/
	this.siteMapping = null;

	/**
	* If this option is enabled then the user will see their home folder as the root (i.e. /) for any site
	* they connect to. If it is disabled then the user will see the absolute virtual file-system path.
	*
	* @type {Boolean}
	*/
	this.homeDirIsRoot = null;

	/**
	* Deletes this user. 
	*
	* @method
	*/
	this.remove = function () { }
}