当前位置: 首页>>代码示例>>PHP>>正文


PHP Piwik::isValidEmailString方法代码示例

本文整理汇总了PHP中Piwik\Piwik::isValidEmailString方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::isValidEmailString方法的具体用法?PHP Piwik::isValidEmailString怎么用?PHP Piwik::isValidEmailString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\Piwik的用法示例。


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

示例1: checkAdditionalEmails

 public function checkAdditionalEmails($additionalEmails)
 {
     foreach ($additionalEmails as $email) {
         if (!Piwik::isValidEmailString($email)) {
             throw new \Exception(Piwik::translate('UsersManager_ExceptionInvalidEmail') . ' (' . $email . ')');
         }
     }
 }
开发者ID:andrzejewsky,项目名称:plugin-CustomAlerts,代码行数:8,代码来源:Validator.php

示例2: validateOwner

 function validateOwner()
 {
     return Piwik::isValidEmailString($this->owner->getValue());
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:4,代码来源:FormGeneralSetup.php

示例3: checkAdditionalEmails

 private static function checkAdditionalEmails($additionalEmails)
 {
     foreach ($additionalEmails as &$email) {
         $email = trim($email);
         if (empty($email)) {
             $email = false;
         } elseif (!Piwik::isValidEmailString($email)) {
             throw new Exception(Piwik::translate('UsersManager_ExceptionInvalidEmail') . ' (' . $email . ')');
         }
     }
     $additionalEmails = array_values(array_filter($additionalEmails));
     return $additionalEmails;
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:13,代码来源:ScheduledReports.php

示例4: isValid

 protected function isValid($email)
 {
     return Piwik::isValidEmailString($email);
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:4,代码来源:EmailValidatorTest.php

示例5: checkEmail

 private function checkEmail($email)
 {
     if ($this->userEmailExists($email)) {
         throw new Exception(Piwik::translate('UsersManager_ExceptionEmailExists', $email));
     }
     if (!Piwik::isValidEmailString($email)) {
         throw new Exception(Piwik::translate('UsersManager_ExceptionInvalidEmail'));
     }
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:9,代码来源:API.php

示例6: sendFeedback

 /**
  * send email to Piwik team and display nice thanks
  * @throws Exception
  */
 function sendFeedback()
 {
     $email = Common::getRequestVar('email', '', 'string');
     $body = Common::getRequestVar('body', '', 'string');
     $category = Common::getRequestVar('category', '', 'string');
     $nonce = Common::getRequestVar('nonce', '', 'string');
     $view = new View('@Feedback/sendFeedback');
     $view->feedbackEmailAddress = Config::getInstance()->General['feedback_email_address'];
     try {
         $minimumBodyLength = 40;
         if (strlen($body) < $minimumBodyLength || strpos($email, 'probe@') !== false || strpos($body, '&lt;probe') !== false) {
             throw new Exception(Piwik::translate('Feedback_ExceptionBodyLength', array($minimumBodyLength)));
         }
         if (!Piwik::isValidEmailString($email)) {
             throw new Exception(Piwik::translate('UsersManager_ExceptionInvalidEmail'));
         }
         if (preg_match('/https?:/i', $body)) {
             throw new Exception(Piwik::translate('Feedback_ExceptionNoUrls'));
         }
         if (!Nonce::verifyNonce('Feedback.sendFeedback', $nonce)) {
             throw new Exception(Piwik::translate('General_ExceptionNonceMismatch'));
         }
         Nonce::discardNonce('Feedback.sendFeedback');
         $mail = new Mail();
         $mail->setFrom(Common::unsanitizeInputValue($email));
         $mail->addTo($view->feedbackEmailAddress, 'Piwik Team');
         $mail->setSubject('[ Feedback form - Piwik ] ' . $category);
         $mail->setBodyText(Common::unsanitizeInputValue($body) . "\n" . 'Piwik ' . Version::VERSION . "\n" . 'IP: ' . IP::getIpFromHeader() . "\n" . 'URL: ' . Url::getReferrer() . "\n");
         @$mail->send();
     } catch (Exception $e) {
         $view->errorString = $e->getMessage();
         $view->message = $body;
     }
     return $view->render();
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:39,代码来源:Controller.php


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