#!/usr/bin/perl -w ############################################################################### # HCCFtp.pm - A custom API module for CPanel # Version 0.2 beta - 11/MAY/2005 # (c) 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 ############################################################################### # 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 ############################################################################### # For INSTALLATION and DOCUMENTATION please see: # http://html.conclase.net/cp/scripts/HCCFtp.txt (plain text), or # http://html.conclase.net/cp/scripts/HCCFtp.pdf (Acrobat) ############################################################################### # Please consider making a donation today. Visit my amazon.com wishlist at: # http://html.conclase.net/link/wishlist # Thank you :) ############################################################################### package Cpanel::HCCFtp; use strict; use Carp; use vars qw(@ISA @EXPORT $VERSION $prefix); require Exporter; @ISA = qw(Exporter); @EXPORT = qw( HCCFtp_init HCCFtp_listftpstable HCCFtp_listftpstable2 HCCFtp_listshortftpstable HCCFtp_listshortftpstable2 ); $VERSION = '0.2.1'; $prefix = "HCCFtp"; Cpanel::Lang::loadlang($Cpanel::CPDATA{LANG}); sub HCCFtp_init { return(1); } sub HCCFtp_listftpstable { HCCFtp_listftpstable2("user main anon ftp logs"); } sub HCCFtp_listftpstable2 { my $args = shift; if ($args !~ /^\s*(?:"\s*([^"]*)\s*"|'\s*([^']*)\s*'|(.*))\s*$/) { print "Wrong parameter(s)"; return; } $args = ($1 or $2 or $3); my @args = split /\s/, $args; my @accts = `/usr/local/cpanel/bin/ftpwrap LIST 0 0`; my $rows = 0; foreach my $arg (@args) { if ($arg eq "user") { foreach (@accts) { next if (/${Cpanel::user}(_logs|\s)/); s/\s*$//; @_ = split /:/; print "