Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation



integrationblogcta.jpg

Ftp Module Documentation

The Ftp module allows you to manage FTP accounts.

The functions within this module may or may not be governed by a feature list. The required feature list may vary from function to function, to review a total list of the available features sets on a cPanel server, please see "Feature Manager" in WHM.

Ftp::getftpquota

API Version: 1 - Click here for documentation
Syntax: Ftp::getftpquota( user )
Description: Retrieve the FTP quota for a particular account.
Parameters:  
  user (string)
  The name of the FTP account whose quota will be retrieved.
Returns:  
 
An integer that indicates the quota in megabytes, or 'unlimited' if the FTP account has no quota.

Ftp::addftp

API Version: 1 - Click here for documentation
Syntax: Ftp::addftp( user, pass, homedir, quota, disallowdot, homedir2 )
Description: Add a new FTP account.
Parameters:  
  user (string)
  The name of the new FTP account. When authenticating with this name, remember to append the main domain to the end (e.g., user@example.com).
  pass (string)
  The password for the new FTP account.
  homedir (string (optional))
  The FTP account's root directory. This should be relative to the account's public_html directory.
  quota (int (optional))
  The new FTP account's quota. 0 indicates that the account will not use a quota. This parameter defaults to 0.
  disallowdot (bool (optional))
  When this parameter is set to 1, any 'dots' (periods) will be stripped from the username.
  homedir2 (string)
  The path to the FTP account's root directory. This value should be relative to the account's home directory.
Returns:  
 
Nothing if successful. If the function fails, it will return an error message.

Ftp::ftpservername

API Version: 1 - Click here for documentation
Syntax: Ftp::ftpservername( )
Description: Display the FTP daemon the server is using.
Returns:  
 
'proftpd' or 'pure-ftpd', depending on which FTP daemon is being used.

Ftp::get_welcomemsg

API Version: 1 - Click here for documentation
Syntax: Ftp::get_welcomemsg( )
Description: Retrieve the anonymous FTP welcome message.
Returns:  
 
The anonymous FTP welcome message.

Ftp::ftpquota

API Version: 1 - Click here for documentation
Syntax: Ftp::ftpquota( user, quota, kill )
Description: Change an FTP account's quota.
Parameters:  
  user (string)
  The name of the FTP account whose quota will be changed.
  quota (int (optional))
  The new quota for the FTP account.
  kill (boolean (optional))
  Indicates whether or not the quota should be removed. If the quota parameter is set to 0, this parameter is automatically set.
Returns:  
 
Nothing.

Ftp::kill_ftp_session

API Version: 1 - Click here for documentation
Syntax: Ftp::kill_ftp_session( pid )
Description: Kill one or all FTP sessions associated with the authenticated user.
Parameters:  
  pid (string)
  The process identification number (PID) of the FTP session to kill. To kill all FTP sessions associated with the account, pass 'all' to this parameter.
Returns:  
 
Nothing

Ftp::get_anonftp

API Version: 1 - Click here for documentation
Syntax: Ftp::get_anonftp( )
Description: Create the public_ftp directory used for anonymous FTP logins. This function will also return whether or not the directory is writable.
Returns:  
 
checked="checked" if the directory is writable. Otherwise the function will return nothing.

Ftp::listftpstatsurl

API Version: 1 - Click here for documentation
Syntax: Ftp::listftpstatsurl( )
Description: Retrieve an HTML link to the logs for a domain. The username and password are included in this URL.
Returns:  
 
<a href="ftp://cpuser_logs+cpdomain.com:cpuserpassword@ftp.cpdomain.com/cpdomain.com">ftp://ftp.cpdomain.com/cpdomain.com</a>

Ftp::passwdftp

API Version: 1 - Click here for documentation
Syntax: Ftp::passwdftp( user, passwd )
Description: Change an FTP user's password.
Parameters:  
  user (string)
  The name of the FTP account whose password will be changed.
  passwd (string)
  The new password for the FTP account.
Returns:  
 
Nothing.

Ftp::delftp

API Version: 1 - Click here for documentation
Syntax: Ftp::delftp( user, destroy )
Description: Delete an FTP account.
Parameters:  
  user (string)
  The name of the FTP account to be removed.
  destroy (boolean (optional))
  Setting this parameter to 1 causes the FTP account's document root to be deleted.
Returns:  
 
Nothing.

Ftp::ftpstatslogin

API Version: 1 - Click here for documentation
Syntax: Ftp::ftpstatslogin( )
Description: Retrieve FTP stats login information for the current username. This username can be used for downloading server logs.
Returns:  
 
The username of the cPanel account, appended with _logs. (e.g. user_logs)

Ftp::get_anonftpin

API Version: 1 - Click here for documentation
Syntax: Ftp::get_anonftpin( )
Description: Create the incoming public_ftp directory used for anonymous FTP uploads. This function will also return whether or not the directory is writable.
Returns:  
 
checked="checked" if the directory is writable. Otherwise the function will return nothing.

Ftp::set_anonftp

API Version: 1 - Click here for documentation
Syntax: Ftp::set_anonftp( set )
Description: Enable or disable anonymous FTP logins.
Parameters:  
  set (bool)
  A boolean value indicating whether FTP logins should be enabled or disabled.
Returns:  
 
Nothing.

Ftp::set_anonftpin

API Version: 1 - Click here for documentation
Syntax: Ftp::set_anonftpin( set )
Description: Change whether the directory for anonymous FTP uploads is writable.
Parameters:  
  set (bool)
  A boolean integer indicating whether the directory should be writable.
Returns:  
 
Nothing.

Ftp::set_welcomemsg

API Version: 1 - Click here for documentation
Syntax: Ftp::set_welcomemsg( message )
Description: Change the anonymous FTP welcome message (banner).
Parameters:  
  message (string)
  The welcome message to display to anonymous FTP users.
Returns:  
 
Nothing.

Topic revision: r2 - 27 Mar 2012 - 18:17:31 - Main.JenniferDoubrava