0
1
Fork 0
hedera-web-mindshore/rest/edi/lib/method.php

44 lines
760 B
PHP
Raw Normal View History

<?php
require_once ('vn/lib/method.php');
abstract class EdiMethod extends Vn\Lib\Method
{
protected $imap;
protected $imapConf;
protected $mailbox;
abstract function ediRun ();
function run ()
{
$db = $this->getSysConn ();
$db->selectDb ('edi');
$imapConf = $db->getRow (
'SELECT host, user, pass, success_folder, error_folder FROM imap_config');
$this->mailbox = sprintf ('{%s/imap/ssl/novalidate-cert}INBOX',
$imapConf['host']);
$imap = imap_open ($this->mailbox
,$imapConf['user']
,base64_decode ($imapConf['pass'])
);
$this->imap = $imap;
$this->imapConf = $imapConf;
if ($imap)
{
$this->ediRun ();
imap_expunge ($imap);
imap_close ($imap);
}
else
error_log (imap_last_error ());
}
}
?>