HCCFtp A Custom API for Cpanel Version 0.2 beta 11/MAY/2005 © 2003, 2005 Juan R. Pozo http://html.conclase.net/cp/scripts/ mailto:jrpozo@conclase.net Mailing list: http://www.conclase.net/mailman/listinfo/cpanel_conclase.net License This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Note: a copy of the GNU General Public License is available at: http://html.conclase.net/cp/scripts/license.html Installation 1) Check if the file HCCFtp.pm exists in your server inside the /usr/local/cpanel/Cpanel/ directory 2) If it exists and isn't a previous version of this API please contact me. Otherwise, follow steps 3 to 8 3) switch to root user 4) # cd /usr/local/cpanel/Cpanel/ 5) # wget –N http://html.conclase.net/cp/scripts/HCCFtp.pm 6) # chown root.root HCCFtp.pm 7) # chmod 0644 HCCFtp.pm 8) Add the following language variables to your language files: // HCCFtp (English) HCCFtp_Delete=Delete HCCFtp_ChangePassword=Change Password HCCFtp_MainAccount=Main Account HCCFtp_DeleteImg=/images/delete.jpg HCCFtp_ChangePasswordImg=/images/passwd.jpg HCCFtp_MainAccountImg=/images/mainacct.jpg // HCCFtp (Spanish) HCCFtp_Delete=Borrar HCCFtp_ChangePassword=Cambiar Contraseña HCCFtp_MainAccount=Cuenta Principal HCCFtp_DeleteImg=/images/delete.jpg HCCFtp_ChangePasswordImg=/images/passwd.jpg HCCFtp_MainAccountImg=/images/mainacct.jpg API Reference Invokes listftpstable2 with the argument string "user main anon ftp logs". See listftpstable2 definition below for more information. Displays a table of FTP accounts defined for this user. format is a space separated string of format tokens. Currently available format tokens are: ? user: displays a table row for each FTP account defined by the user from Cpanel's interface. Each rows contains three cells: the first cell contains the login name and a link to the web space of the FTP account; the second cell contains an image link to delete the account; and the third cell contains an image link to change the account's password. ? main: displays a table row corresponding to the user's main FTP account. The first cell contains the account name and the second cell contains an image showing the user that this is a main account (and therefore it cannot be deleted or its password modified from this interface). ? anon: as main, but referred to the anonymous FTP account anonymous. ? ftp: as main, but referred to the anonymous FTP account ftp. ? logs: as main, but referred to the username_logs FTP account. ? anon_auto: as anon, but isn't displayed if anonymous FTP has been disabled server-wide from WHM. ? ftp_auto: as ftp, but isn't displayed if anonymous FTP has been disabled server-wide from WHM. Any other value is ignored. Only table rows are inserted. The TABLE tags must be inserted in the theme page. If no rows have been inserted, the variable $CPERROR{'HCCFtp_NoRows'} returns with the value 1. Otherwise it returns with the value 0. Example:
User defined FTP accounts
No FTP accounts have been defined yet
As listftpstable, but doesn't include the domain name in the account list. As listftpstable2, but doesn't include the domain name in the account list. Changelog 0.2 Beta – May 11, 2005 Include listshortftpstable* functions. Fix lang function to account for Cpanel's cachelang mechanism. 0.1.1 Beta – December 7, 2003 Follow same convention for key values in language files than in the other HCC Api modules, i.e., HCCFtp_Delete instead of HCCFtpDelete, etc. 0.1 Beta – June 19, 2003 First public release. Please consider making a donation today. Visit my amazon.com wishlist at: http://html.conclase.net/link/wishlist Thank you :)