#!/usr/bin/perl -w ############################################################################### # HCCLogIP - A custom API module for CPanel # Version 0.2.1 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/HCCLogIP.txt (plain text), or # http://html.conclase.net/cp/scripts/HCCLogIP.pdf (Acrobat) ############################################################################### # License: http://html.conclase.net/cp/scripts/license.txt ############################################################################### # Please consider making a donation today. Visit my amazon.com wishlist at: # http://html.conclase.net/link/wishlist # Thank you :) ############################################################################### package Cpanel::HCCLogIP; use strict; use vars qw(@ISA @EXPORT $VERSION $prefix); require Exporter; @ISA = qw(Exporter); @EXPORT = qw( HCCLogIP_init HCCLogIP_Log ); $VERSION = '0.2.1'; $prefix = "HCCLogIP"; Cpanel::Lang::loadlang($Cpanel::CPDATA{LANG}); require 5.004; sub HCCLogIP_init { return(1); } sub HCCLogIP_Log { reset_error(); system("/usr/local/cpanel/Cpanel/HCCLogIP/HCCLogIP"); if ($?) { set_error("errno", ($? >> 8)); } } sub reset_error { $Cpanel::CPERROR{$prefix} = 0; delete($Cpanel::CPERROR{"${prefix}_errno"}); delete($Cpanel::CPERROR{"${prefix}_errstr"}); } sub set_error { my ($key, $value) = @_; $Cpanel::CPERROR{$prefix} = 1; $Cpanel::CPERROR{"${prefix}_${key}"} = $value; $Cpanel::CPERROR{"${prefix}_errstr"} = lang("errstr_$key"); } sub lang { my ($key) = @_; return $Cpanel::Lang::LANG{$Cpanel::CPDATA{LANG}}{"${prefix}_${key}"}; } 1;