本文整理匯總了PHP中POP3::apop方法的典型用法代碼示例。如果您正苦於以下問題:PHP POP3::apop方法的具體用法?PHP POP3::apop怎麽用?PHP POP3::apop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類POP3
的用法示例。
在下文中一共展示了POP3::apop方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: workPopfetcher
function workPopfetcher(&$eventData)
{
global $serendipity;
static $debug = null;
if ($debug === null) {
$debug = $this->debug = serendipity_db_bool($this->get_config('debug'));
}
// updertEntry() will not function unless this is set:
$serendipity['POST']['properties']['fake'] = 'fake';
$_SESSION['serendipityRightPublish'] = true;
$this->out('<h3>' . PLUGIN_MF_NAME . ' v' . POPFETCHER_VERSION . ' @ ' . date("D M j G:i:s T Y") . '</h3>');
$debug_file = null;
// DEVELOPERS: If set to a filename, you can bypass fetching POP and use a file instead.
$debug_mail = $this->get_config('debug_mail');
if (strlen($debug_mail) != '' && file_exists($debug_mail)) {
$debug_file = $debug_mail;
}
if ($debug_file != null) {
$this->debug = true;
}
$authorid = $this->get_config('author');
if (empty($authorid) || $authorid == 'empty') {
$authorid = isset($serendipity['authorid']) ? $serendipity['authorid'] : 1;
}
$mailserver = trim($this->get_config('mailserver'));
$mailport = $this->get_config('mailport');
$mailuser = trim($this->get_config('mailuser'));
$mailpass = trim($this->get_config('mailpass'));
$timeout = $this->get_config('timeout');
$deleteflag = serendipity_db_bool($this->get_config('deleteflag'));
$apopflag = serendipity_db_bool($this->get_config('apopflag'));
$blogflag = serendipity_db_bool($this->get_config('blogflag'));
$striptagsflag = serendipity_db_bool($this->get_config('striptagsflag'));
$publishflag = serendipity_db_bool($this->get_config('publishflag'));
$onlyfrom = $this->get_config('onlyfrom', '');
$maildir = trim($this->get_config('maildir'));
$category = trim($this->get_config('category'));
$adflag = serendipity_db_bool($this->get_config('adflag'));
$plaintext_is_body_flag = serendipity_db_bool($this->get_config('plaintext_is_body'));
$plaintext_use_extended_flag = serendipity_db_bool($this->get_config('plaintext_use_extended'));
$list_virus = array('.pif', '.vbs', '.scr', '.bat', '.com', '.exe');
$list_imagetype = array('jpg', 'jpeg', 'gif', 'png', 'x-png', 'pjpeg');
$list_imageext = array('.gif', '.jpg', '.png', '.jpeg');
$list_ignore = array('.smil');
$output = '';
$dirpath = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $maildir;
$dupcount = 0;
// Upload directory must end with a slash character
if (strrchr($dirpath, '/') != '/') {
$output = MF_ERROR7;
$this->out('<br />' . $output . '<br />');
return true;
}
// Upload directory must be writable
if (!is_writable($dirpath)) {
$output = MF_ERROR6;
$this->out('<br />' . $output . '<br />');
return true;
}
if (serendipity_db_bool($this->get_config('subfolder'))) {
$dirpath = $dirpath . '/' . date('Y');
if (!is_dir($dirpath)) {
mkdir($dirpath);
}
$dirpath = $dirpath . '/' . date('m') . '/';
if (!is_dir($dirpath)) {
mkdir($dirpath);
}
$maildir .= date('Y') . '/' . date('m') . '/';
}
$maildir = str_replace('//', '/', $maildir);
// Category (if specified) must exist
if (!empty($category)) {
$cid = serendipity_fetchCategoryInfo(null, $category);
if ($cid == false) {
$output = MF_ERROR8;
$this->out('<br />' . $output . '<br />');
return true;
}
}
if ($debug_file === null) {
// Create new instance of POP3 connection
$pop3 = new POP3($mailserver, $timeout);
// Attempt to connect to mail server
if (!$pop3->connect($mailserver, $mailport)) {
$output = MF_ERROR1 . ': ' . $pop3->ERROR;
$this->out('<br />' . $output . '<br />');
return true;
}
// Try APOP login if requested, otherwise, regular login
if ($apopflag) {
$Count = $pop3->apop($mailuser, $mailpass);
} else {
$Count = $pop3->login($mailuser, $mailpass);
}
// Check for error retrieving number of msgs in mailbox
if ($Count === false or $Count == -1) {
$output = MF_ERROR2 . ': ' . $pop3->ERROR;
$this->out('<br />' . $output . '<br />');
return true;
//.........這裏部分代碼省略.........