當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Piwik::isValidEmailString方法代碼示例

本文整理匯總了PHP中Piwik::isValidEmailString方法的典型用法代碼示例。如果您正苦於以下問題:PHP Piwik::isValidEmailString方法的具體用法?PHP Piwik::isValidEmailString怎麽用?PHP Piwik::isValidEmailString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik的用法示例。


在下文中一共展示了Piwik::isValidEmailString方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sendFeedback

 /**
  * send email to Piwik team and display nice thanks
  */
 function sendFeedback()
 {
     $email = Piwik_Common::getRequestVar('email', '', 'string');
     $body = Piwik_Common::getRequestVar('body', '', 'string');
     $category = Piwik_Common::getRequestVar('category', '', 'string');
     $nonce = Piwik_Common::getRequestVar('nonce', '', 'string');
     $view = Piwik_View::factory('sent');
     $view->feedbackEmailAddress = Zend_Registry::get('config')->General->feedback_email_address;
     try {
         $minimumBodyLength = 35;
         if (strlen($body) < $minimumBodyLength) {
             throw new Exception(Piwik_TranslateException('Feedback_ExceptionBodyLength', array($minimumBodyLength)));
         }
         if (!Piwik::isValidEmailString($email)) {
             throw new Exception(Piwik_TranslateException('UsersManager_ExceptionInvalidEmail'));
         }
         if (preg_match('/https?:/i', $body)) {
             throw new Exception(Piwik_TranslateException('Feedback_ExceptionNoUrls'));
         }
         if (!Piwik_Nonce::verifyNonce('Piwik_Feedback.sendFeedback', $nonce)) {
             throw new Exception(Piwik_TranslateException('General_ExceptionNonceMismatch'));
         }
         Piwik_Nonce::discardNonce('Piwik_Feedback.sendFeedback');
         $mail = new Piwik_Mail();
         $mail->setFrom(Piwik_Common::unsanitizeInputValue($email));
         $mail->addTo($view->feedbackEmailAddress, 'Piwik Team');
         $mail->setSubject('[ Feedback form - Piwik ] ' . $category);
         $mail->setBodyText(Piwik_Common::unsanitizeInputValue($body) . "\n" . 'Piwik ' . Piwik_Version::VERSION . "\n" . 'IP: ' . Piwik_Common::getIpString() . "\n" . 'URL: ' . Piwik_Url::getReferer() . "\n");
         @$mail->send();
     } catch (Exception $e) {
         $view->ErrorString = $e->getMessage();
         $view->message = $body;
     }
     echo $view->render();
 }
開發者ID:Gninety,項目名稱:Microweber,代碼行數:38,代碼來源:Controller.php

示例2: sendFeedback

 /**
  * send email to Piwik team and display nice thanks
  */
 function sendFeedback()
 {
     $body = Piwik_Common::getRequestVar('body', '', 'string');
     $email = Piwik_Common::getRequestVar('email', '', 'string');
     $view = new Piwik_View('Feedback/templates/sent.tpl');
     try {
         $minimumBodyLength = 35;
         if (strlen($body) < $minimumBodyLength) {
             throw new Exception(sprintf("Message must be at least %s characters long.", $minimumBodyLength));
         }
         if (!Piwik::isValidEmailString($email)) {
             throw new Exception(Piwik_Translate('UsersManager_ExceptionInvalidEmail'));
         }
         if (strpos($body, 'http://') !== false) {
             throw new Exception("The message cannot contain a URL, to avoid spams messages.");
         }
         $mail = new Piwik_Mail();
         $mail->setFrom($email);
         $mail->addTo('hello@piwik.org', 'Piwik Team');
         $mail->setSubject('[ Feedback form - Piwik ]');
         $mail->setBodyText($body);
         @$mail->send();
     } catch (Exception $e) {
         $view->ErrorString = $e->getMessage();
         $view->message = $body;
     }
     echo $view->render();
 }
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:31,代碼來源:Controller.php

示例3: checkEmail

 private function checkEmail($email)
 {
     if ($this->userEmailExists($email)) {
         throw new Exception(Piwik_TranslateException('UsersManager_ExceptionEmailExists', $email));
     }
     if (!Piwik::isValidEmailString($email)) {
         throw new Exception(Piwik_TranslateException('UsersManager_ExceptionInvalidEmail'));
     }
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:9,代碼來源:API.php

示例4: checkAdditionalEmails

 private function checkAdditionalEmails($additionalEmails)
 {
     if (empty($additionalEmails)) {
         return '';
     }
     $additionalEmails = self::getEmailsFromString($additionalEmails);
     foreach ($additionalEmails as &$email) {
         $email = trim($email);
         if (!Piwik::isValidEmailString($email)) {
             throw new Exception(Piwik_TranslateException('UsersManager_ExceptionInvalidEmail') . ' (' . $email . ')');
         }
     }
     $additionalEmails = implode(',', $additionalEmails);
     return $additionalEmails;
 }
開發者ID:0h546f6f78696342756e4e59,項目名稱:piwik,代碼行數:15,代碼來源:API.php

示例5: validateOwner

	function validateOwner()
	{
		return Piwik::isValidEmailString($this->owner->getValue());
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:4,代碼來源:FormGeneralSetup.php

示例6: Piwik_Form_isValidEmailString

function Piwik_Form_isValidEmailString($element, $value)
{
    return Piwik::isValidEmailString($value);
}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:4,代碼來源:Form.php

示例7: checkAdditionalEmails

 private static function checkAdditionalEmails($additionalEmails)
 {
     foreach ($additionalEmails as &$email) {
         $email = trim($email);
         if (!Piwik::isValidEmailString($email)) {
             throw new Exception(Piwik_TranslateException('UsersManager_ExceptionInvalidEmail') . ' (' . $email . ')');
         }
     }
     return $additionalEmails;
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:10,代碼來源:PDFReports.php

示例8: checkEmail

 private static function checkEmail($email)
 {
     if (self::userEmailExists($email)) {
         throw new Exception(sprintf(Piwik_TranslateException('UsersManager_ExceptionEmailExists'), $email));
     }
     if (!Piwik::isValidEmailString($email)) {
         throw new Exception(Piwik_TranslateException('UsersManager_ExceptionInvalidEmail'));
     }
 }
開發者ID:klando,項目名稱:pgpiwik,代碼行數:9,代碼來源:API.php


注:本文中的Piwik::isValidEmailString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。