MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //scripts.20110531.215904.25158/icontact
#!/usr/bin/perl
# cpanel - icontact                               Copyright(c) 2010 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

BEGIN { unshift @INC, '/usr/local/cpanel'; }

use strict;
use Storable;
use Getopt::Long;
use Cpanel::iContact qw( );

exit if (! defined $ARGV[0]);

my %msgdata = -f $ARGV[0] ? getparamsfromfile($ARGV[0]) : getparamsfromcli();

Cpanel::iContact::icontact(%msgdata);

sub getparamsfromfile {
    my $file = shift;
    my $msg_ref;
    eval {
        $msg_ref = retrieve($file);
    };
    if (defined $msg_ref && ref $msg_ref eq 'HASH') {
        unlink $file;
        return %{ $msg_ref };
    } else {
        warn "Unable to retrieve message hash from file $file";
        exit;
    }
}

sub getparamsfromcli {
    my %msg_hash = ( 'application' => q{Info},
                     'level'       => 3,
                     'subject'     => q{},
                     'message'     => q{},
                     'msgtype'     => q{},
                    );
    GetOptions('define=s' => \%msg_hash);
    return %msg_hash;
}