• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP imap_alerts函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中imap_alerts函数的典型用法代码示例。如果您正苦于以下问题:PHP imap_alerts函数的具体用法?PHP imap_alerts怎么用?PHP imap_alerts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了imap_alerts函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: checkPassword

 /**
  * Check if the password is correct without logging in the user
  *
  * @param string $uid      The username
  * @param string $password The password
  *
  * @return true/false
  */
 public function checkPassword($uid, $password)
 {
     if (!function_exists('imap_open')) {
         OCP\Util::writeLog('user_external', 'ERROR: PHP imap extension is not installed', OCP\Util::ERROR);
         return false;
     }
     // Check if we only want logins from ONE domain and strip the domain part from UID
     if ($this->domain != '') {
         $pieces = explode('@', $uid);
         if (count($pieces) == 1) {
             $username = $uid . "@" . $this->domain;
         } elseif (count($pieces) == 2 and $pieces[1] == $this->domain) {
             $username = $uid;
             $uid = $pieces[0];
         } else {
             return false;
         }
     } else {
         $username = $uid;
     }
     $mbox = @imap_open($this->mailbox, $username, $password, OP_HALFOPEN, 1);
     imap_errors();
     imap_alerts();
     if ($mbox !== FALSE) {
         imap_close($mbox);
         $uid = mb_strtolower($uid);
         $this->storeUser($uid);
         return $uid;
     } else {
         return false;
     }
 }
开发者ID:kosli,项目名称:apps,代码行数:40,代码来源:imap.php


示例2: checkPassword

 /**
  * @brief Check if the password is correct
  * @param $uid The username
  * @param $password The password
  * @returns true/false
  *
  * Check if the password is correct without logging in the user
  */
 public function checkPassword($uid, $password)
 {
     $mbox = @imap_open($this->mailbox, $uid, $password);
     imap_errors();
     imap_alerts();
     if ($mbox) {
         imap_close($mbox);
         return $uid;
     } else {
         return false;
     }
 }
开发者ID:blablubli,项目名称:owncloudapps,代码行数:20,代码来源:imap.php


示例3: authenticate

 /**
  * Authenticate connection
  *
  * @param string $username Username
  * @param string $password Password
  *
  * @return \Ddeboer\Imap\Connection
  * @throws AuthenticationFailedException
  */
 public function authenticate($username, $password)
 {
     $resource = @\imap_open($this->getServerString(), $username, $password, null, 1);
     if (false === $resource) {
         throw new AuthenticationFailedException($username);
     }
     $check = imap_check($resource);
     $mailbox = $check->Mailbox;
     $this->connection = substr($mailbox, 0, strpos($mailbox, '}') + 1);
     // These are necessary to get rid of PHP throwing IMAP errors
     imap_errors();
     imap_alerts();
     return new Connection($resource, $this->connection);
 }
开发者ID:ctalbot,项目名称:imap,代码行数:23,代码来源:Server.php


示例4: open

 public function open($server, $username, $password, $mailbox, array $flags)
 {
     if (!empty($flags)) {
         $server .= '/' . implode('/', $flags);
     }
     $mailbox = '{' . $server . '}' . $mailbox;
     $this->resource = @imap_open($mailbox, $username, $password);
     if (!$this->resource) {
         $error = imap_last_error();
         imap_errors();
         imap_alerts();
         throw new IMAPException($error);
     }
     return $this;
 }
开发者ID:rudiedirkx,项目名称:IMAP-reader,代码行数:15,代码来源:IMAPTransport.php


示例5: checkPassword

 /**
  * Check if the password is correct without logging in the user
  *
  * @param string $uid      The username
  * @param string $password The password
  *
  * @return true/false
  */
 public function checkPassword($uid, $password)
 {
     if (!function_exists('imap_open')) {
         OCP\Util::writeLog('user_external', 'ERROR: PHP imap extension is not installed', OCP\Util::ERROR);
         return false;
     }
     $mbox = @imap_open($this->mailbox, $uid, $password, OP_HALFOPEN);
     imap_errors();
     imap_alerts();
     if ($mbox !== FALSE) {
         imap_close($mbox);
         $this->storeUser($uid);
         return $uid;
     } else {
         return false;
     }
 }
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:25,代码来源:imap.php


示例6: connect

 function connect()
 {
     $this->conn = @imap_open('{' . $this->server . '/notls}', $this->user, $this->pass, null, 1);
     // Supress alerts
     imap_alerts();
     $errors = imap_errors();
     $searchword = 'AUTHENTICATIONFAILED';
     $matches = array_filter($errors, function ($var) use($searchword) {
         return preg_match("/\\b{$searchword}\\b/i", $var);
     });
     if (is_bool($this->conn) || !empty($matches)) {
         $this->connected = false;
         return false;
     } else {
         $this->connected = true;
         return true;
     }
 }
开发者ID:michaelsoftware1997,项目名称:vision-server,代码行数:18,代码来源:email.php


示例7: authenticate

 public function authenticate(array $credentials)
 {
     list($username, $password) = $credentials;
     $loginData = $this->imapLoginModel->getBy(array("username" => $username));
     $mbox = imap_open("{localhost:993/ssl/novalidate-cert}INBOX", $username, $password, OP_HALFOPEN | OP_SILENT);
     imap_alerts();
     imap_errors();
     if (!$loginData) {
         throw new \Nette\Security\AuthenticationException('Neznámé jméno uživatele.', self::IDENTITY_NOT_FOUND);
     } elseif (!$mbox) {
         throw new \Nette\Security\AuthenticationException('Nesprávné heslo.', self::INVALID_CREDENTIAL);
     }
     $identity = $this->buildIdentity($loginData->user_id);
     $enabled = $identity->getData()["enabled"];
     if (!$enabled) {
         throw new \Nette\Security\AuthenticationException('Tento účet je zablokovaný.', self::INACTIVE);
     }
     $this->user->login($identity);
 }
开发者ID:hajek-raven,项目名称:agenda,代码行数:19,代码来源:IMAPAuthenticator.php


示例8: authenticate

 /**
  * Authenticate connection
  *
  * @param string $username Username
  * @param string $password Password
  *
  * @return Connection
  * @throws AuthenticationFailedException
  */
 public function authenticate($username, $password)
 {
     // Wrap imap_open, which gives notices instead of exceptions
     set_error_handler(function ($nr, $message) use($username) {
         throw new AuthenticationFailedException($username, $message);
     });
     $resource = imap_open($this->getServerString(), $username, $password, null, 1, $this->parameters);
     if (false === $resource) {
         throw new AuthenticationFailedException($username);
     }
     restore_error_handler();
     $check = imap_check($resource);
     $mailbox = $check->Mailbox;
     $this->connection = substr($mailbox, 0, strpos($mailbox, '}') + 1);
     // These are necessary to get rid of PHP throwing IMAP errors
     imap_errors();
     imap_alerts();
     return new Connection($resource, $this->connection);
 }
开发者ID:voofy,项目名称:imap,代码行数:28,代码来源:Server.php


示例9: __construct

 /**
 	Initialize the mailbox connection.
 
 	The mailbox connection parameters are as follow:
 	* host:		Host name of the server hosting the mailbox. Default: localhost.
 	* port:		Port of the imap service. Default: 143.
 	* mailbox:	Mailbox name. Default: INBOX.
 	* flags:	Connection flags. Optionnal.
 	* user:		User name.
 	* password:	User password.
 
 	For a detailed list of available flags, please see the PHP documentation
 	for imap_open.
 
 	The connection to the mailbox is read-only until tested enough.
 
 	@param $aParams Mailbox connection parameters.
 	@see http://php.net/imap_open
 */
 public function __construct($aParams)
 {
     function_exists('imap_open') or burn('ConfigurationException', _WT('The IMAP PHP extension is required by the weeFetchMail class.'));
     empty($aParams['user']) and burn('InvalidParameterException', _WT('The user name was not provided in the connection parameters.'));
     empty($aParams['password']) and burn('InvalidParameterException', _WT('The user password was not provided in the connection parameters.'));
     // Fill in the default values
     $aParams = $aParams + array('host' => 'localhost', 'port' => 143, 'mailbox' => 'INBOX');
     $sConnection = '{' . $aParams['host'] . ':' . $aParams['port'];
     if (!empty($aParams['flags'])) {
         $sConnection .= $aParams['flags'];
     }
     $sConnection .= '}' . $aParams['mailbox'];
     $this->rLink = @imap_open($sConnection, $aParams['user'], $aParams['password'], OP_READONLY, 1);
     // We must clear the errors and alerts or they'll be thrown separately, possibly multiple times.
     // Despite their names, those functions also clear the errors buffer.
     imap_alerts();
     $a = imap_errors();
     // Then we only output the first error from the array we retrieved (usually good enough).
     $this->rLink === false and burn('UnexpectedValueException', _WT("Couldn't open stream \"%s\" with the following error:\n%s", $sConnection, $a[0]));
 }
开发者ID:extend,项目名称:wee,代码行数:39,代码来源:weeFetchMail.class.php


示例10: open

 /**
  * Open the remote mailbox
  *
  * @param string|null $extension Extension of the serveur to open (/Inbox, ...)
  *
  * @return int|bool
  */
 function open($extension = null)
 {
     $port = $this->source->port ? ":" . $this->source->port : "";
     $protocole = $this->source->auth_ssl ? "https://" : "http://";
     $url = $protocole . $this->source->host . $port;
     if (!isset($this->_server)) {
         CAppUI::stepAjax("CPop-error-notInitiated", UI_MSG_ERROR);
         return false;
     }
     $password = $this->source->getPassword();
     $server = $this->_server . $extension;
     $this->_mailbox = @imap_open($server, $this->source->user, $password, 0, 0);
     //avoid errors reporting
     imap_errors();
     imap_alerts();
     if ($this->_mailbox === false) {
         //CModelObject::warning("IMAP-warning-configuration-unreashable", $this->source->object_class, $this->source->object_id);
         return false;
     }
     $this->_is_open = true;
     return $this->_mailbox;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:29,代码来源:CPop.class.php


示例11: stat

 /**
 	Get Status Messages
 */
 function stat()
 {
     $r = null;
     if ($this->_c) {
         imap_check($this->_c);
     }
     $x = imap_alerts();
     if (!empty($x)) {
         $r .= "Alerts:\n  " . implode('; ', $x) . "\n";
     }
     $x = imap_errors();
     if (!empty($x)) {
         $r .= "Errors:\n  " . implode('; ', $x) . "\n";
     }
     return $r;
 }
开发者ID:edoceo,项目名称:radix,代码行数:19,代码来源:IMAP.php


示例12: alerts

 /**
  * Wrapper function for {@link imap_alerts}.  Implodes the array returned by imap_alerts,
  * (if any) and returns the text.
  *
  * @param    string    $seperator     Characters to seperate each alert message. '<br />\n' by default.
  * @return   string|FALSE
  * @access   public
  * @see      imap_alerts
  * @see      errors
  */
 function alerts($seperator = "<br />\n")
 {
     $alerts = imap_alerts();
     return is_array($alerts) && !empty($alerts) ? implode($seperator, $alerts) : FALSE;
 }
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:15,代码来源:IMAP.php


示例13: connect

 /**
  * Connect To the Mail Box
  */
 public function connect()
 {
     if (!function_exists('imap_open')) {
         throw new \Exception('imap_open function must be enabled');
     }
     $this->setMailBox(@imap_open($this->getServer(), $this->getUsername(), $this->getPassword(), OP_SILENT));
     $errors = imap_errors();
     $alerts = imap_alerts();
     if (!$this->getMailBox()) {
         if (!$errors) {
             $errors = array();
         }
         if (!$alerts) {
             $alerts = array();
         }
         throw new \Exception("Error: " . implode('. ', array_merge($errors, $alerts)));
     }
     return $this->getMailBox();
 }
开发者ID:paulbunyannet,项目名称:mail,代码行数:22,代码来源:GetMail.php


示例14: handleBounce

                     handleBounce($type, $newsletterID, EZSOFTBOUNCE);
                     break;
                 case EZHARDBOUNCE:
                     handleBounce($type, $newsletterID, EZHARDBOUNCE);
                     break;
                 case EZNOBOUNCE:
                 default:
                     // TODO
                     break;
             }
         } else {
             //do not delete
             $delete = false;
         }
         $imapErrors = imap_errors();
         $imapAlerts = imap_alerts();
         if ($imapErrors) {
             $cli->output("\nMAIL ID: {$mailID}");
             print_r($imapErrors);
         }
         if ($imapAlerts) {
             $cli->output("\nMAIL ID: {$mailID}");
             print_r($imapAlerts);
         }
         if ($delete) {
             imap_delete($mailbox, $i);
         }
     }
     // Close imap connection
     imap_close($mailbox, CL_EXPUNGE);
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:31,代码来源:check_bounce.php


示例15: close

 public function close($expunge = true)
 {
     imap_alerts();
     imap_errors();
     imap_close($this->imap, $expunge ? CL_EXPUNGE : 0);
 }
开发者ID:dapepe,项目名称:tymio,代码行数:6,代码来源:mail.php


示例16: alerts

 /**
  * Wrapper function for {@link imap_alerts}.  Implodes the array returned by imap_alerts,
  * (if any) and returns the text.
  *
  * @param    bool      $handler
  *   How to handle the imap error stack, true by default. If true adds the alerts
  *   to the PEAR_ErrorStack object. If false, returns the imap alert stack.
  *
  * @param    string    $seperator     Characters to seperate each alert message. '<br />\n' by default.
  * @return   bool|string
  * @access   public
  * @see      imap_alerts
  * @see      errors
  * @tutorial http://www.smilingsouls.net/Mail_IMAP?content=Mail_IMAP/alerts
  */
 function alerts($handler = true, $seperator = "<br />\n")
 {
     $alerts = imap_alerts();
     if (empty($alerts)) {
         return false;
     }
     if ($handler) {
         foreach ($alerts as $alert) {
             $this->error->push(Mail_IMAPv2_ERROR, 'notice', null, $alert);
         }
         return true;
     }
     return implode($seperator, $alerts);
 }
开发者ID:ralph1985,项目名称:kdc,代码行数:29,代码来源:IMAPv2.php


示例17: getEmail

 /**
  * GET INDIVIDUAL EMAILS
  * @param  [type] $email_id [description]
  * @return [type] [description]
  */
 public function getEmail($email_id, $msgOnly = TRUE)
 {
     $this->_connect();
     $email = @imap_fetchstructure($this->imap, $email_id, 0);
     imap_errors();
     imap_alerts();
     if (is_object($email)) {
         switch (strtolower($email->subtype)) {
             case "plain":
                 $partNum = 1;
                 break;
             case "alternative":
                 $partNum = 1;
                 break;
             case "mixed":
                 $partNum = 1.2;
                 break;
             case "html":
                 $partNum = 1.2;
                 break;
         }
         $message = quoted_printable_decode(@imap_fetchbody($this->imap, $email_id, $partNum, FT_PEEK));
         imap_errors();
         imap_alerts();
         if (!$msgOnly) {
             $overview = @imap_fetch_overview($this->imap, $email_id, 0);
             imap_errors();
             imap_alerts();
             // $headers = imap_rfc822_parse_headers(imap_fetchheader($this->imap,$email_id));
             switch (strtolower($email->subtype)) {
                 case "plain":
                     $partNum = 1;
                     break;
                 case "alternative":
                     $partNum = 1;
                     break;
                 case "mixed":
                     $partNum = 1.2;
                     break;
                 case "html":
                     $partNum = 1.2;
                     break;
             }
             $attachments = $this->getAttachments($email_id);
             $emailInfo = array('overview' => $overview[0], 'structure' => $email, 'message' => $message, 'attachments' => $attachments);
         }
     } else {
         return false;
     }
     $this->_close();
     return $msgOnly ? $message : $emailInfo;
 }
开发者ID:houzhenggang,项目名称:cobalt,代码行数:57,代码来源:Mail.php


示例18: disconnect

 /**
  * Close IMAP connection
  */
 protected function disconnect()
 {
     if ($this->isConnected()) {
         // Prevent these from throwing notices such as "SECURITY PROBLEM: insecure server advertised"
         imap_errors();
         imap_alerts();
         @imap_close($this->imapStream, CL_EXPUNGE);
     }
 }
开发者ID:Yame-,项目名称:mautic,代码行数:12,代码来源:Mailbox.php


示例19: __destruct

 /**
  * Clear all IMAP notices and warnings
  */
 public function __destruct()
 {
     imap_errors();
     imap_alerts();
 }
开发者ID:Rikisha,项目名称:proj,代码行数:8,代码来源:lib.php


示例20: getErrors

 public function getErrors()
 {
     $errors = imap_errors();
     $alerts = imap_alerts();
     if (is_array($errors)) {
         echo "<pre>";
         print_r($errors);
     }
     if (is_array($alerts)) {
         echo "<pre>";
         print_r($alerts);
     }
 }
开发者ID:maniargaurav,项目名称:OpenDesk,代码行数:13,代码来源:mail.php



注:本文中的imap_alerts函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP imap_append函数代码示例发布时间:2022-05-15
下一篇:
PHP imap_8bit函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap