本文整理汇总了PHP中cfip函数的典型用法代码示例。如果您正苦于以下问题:PHP cfip函数的具体用法?PHP cfip怎么用?PHP cfip使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cfip函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
!cfip() ? header('HTTP/1.1 401 Unauthorized') : 0;
class Mail extends Base
{
/**
* Mail form contact site admin
* @param senderName string senderName
* @param senderEmail string senderEmail
* @param senderSubject string senderSubject
* @param senderMessage string senderMessage
* @param email string config Email address
* @param subject string header subject
* @return bool
**/
public function contactform($senderName, $senderEmail, $senderSubject, $senderMessage)
{
$this->debug->append("STA " . __METHOD__, 4);
if (preg_match('/[^a-z_\\.\\!\\?\\-0-9\\s ]/i', $senderName)) {
$this->setErrorMessage($this->getErrorMsg('E0024'));
return false;
}
if (empty($senderEmail) || !filter_var($senderEmail, FILTER_VALIDATE_EMAIL)) {
$this->setErrorMessage($this->getErrorMsg('E0023'));
return false;
}
if (preg_match('/[^a-z_\\.\\!\\?\\-0-9\\s ]/i', $senderSubject)) {
$this->setErrorMessage($this->getErrorMsg('E0034'));
return false;
}
if (strlen(strip_tags($senderMessage)) < strlen($senderMessage)) {
示例2: exit
<?php
$defflip = !cfip() ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
// Check user to ensure they are admin
if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) {
header("HTTP/1.1 404 Page not found");
die("404 Page not found");
}
// Include markdown library
use Michelf\Markdown;
if ($setting->getValue('notifications_disable_pool_newsletter', 0) == 1) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Pool newsletters are disabled.', 'TYPE' => 'alert alert-info');
$smarty->assign("CONTENT", "");
} else {
if (@$_REQUEST['do'] == 'send') {
if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) {
$iFailed = 0;
$iSuccess = 0;
foreach ($user->getAllAssoc() as $aData) {
$aUserNotificationSettings = $notification->getNotificationSettings($aData['id']);
if ($aData['is_locked'] != 0 || $aUserNotificationSettings['newsletter'] != 1 || empty($aData['email'])) {
continue;
}
$aData['subject'] = $_REQUEST['data']['subject'];
$aData['CONTENT'] = $_REQUEST['data']['content'];
if (!$mail->sendMail('newsletter/body', $aData, true)) {
$iFailed++;
} else {
$iSuccess++;
}
}