#!/usr/bin/perl BEGIN { use lib '/usr/home/cfg' ; require push_inc ; } use CGI qw( :standard ); use CGI::Carp qw(fatalsToBrowser); use Mail::POP3Client; use MIME::Parser; use Fcntl qw(:flock) ; use MIME::Lite; use Mail::Sendmail; require cfg ; print header; # CGI.pm method # unless ($useropts{admin}{$userid} eq $username) { require '401.pm' ; exit ; } # https://itvadmin.co.za/cgi-bin/scripts/dialog/getmail.pl?debug=1 #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- &today; #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'}); $action = $ARGV[0] ; our ($q) = CGI -> new() ; our $iaction = $q -> param('iaction') || $action ; our $isaved = $q -> param('isaved') || '' ; our $debug = $q -> param('debug') || '' ; #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- &start_html ; &getmail_fetch; &reload_parent ; exit; #------------------------------------------------------------------------------------------ sub start_html { print < $useropts{title} "Fetching tickets..." ENDOFTEXT # } #------------------------------------------------------------------------------------------ sub reload_parent { my $jquery_raw = qq~parent.location.reload(); parent.\$("#alertbar").html(""); parent.BootstrapDialog.closeAll() ;~; if ($debug) { $jquery_raw = '' ; } print < \$(function () { $jquery_raw }); ENDOFTEXT # } #------------------------------------------------------------------------------------------ use db ; use common ; use today ; use getmail ; 1;