當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。