本文整理汇总了PHP中TYPO3\CMS\Frontend\Page\PageRepository::checkRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRepository::checkRecord方法的具体用法?PHP PageRepository::checkRecord怎么用?PHP PageRepository::checkRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Frontend\Page\PageRepository
的用法示例。
在下文中一共展示了PageRepository::checkRecord方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendFormmail
/**
* Sends the emails from the formmail content object.
*
* @return void
* @access private
* @see checkDataSubmission()
* @todo Define visibility
*/
public function sendFormmail()
{
$formmail = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_formmail');
$EMAIL_VARS = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST();
$locationData = $EMAIL_VARS['locationData'];
unset($EMAIL_VARS['locationData']);
unset($EMAIL_VARS['formtype_mail'], $EMAIL_VARS['formtype_mail_x'], $EMAIL_VARS['formtype_mail_y']);
$integrityCheck = $this->TYPO3_CONF_VARS['FE']['strictFormmail'];
if (!$this->TYPO3_CONF_VARS['FE']['secureFormmail']) {
// Check recipient field:
// These two fields are the ones which contain recipient addresses that can be misused to send mail from foreign servers.
$encodedFields = explode(',', 'recipient, recipient_copy');
foreach ($encodedFields as $fieldKey) {
if (strlen($EMAIL_VARS[$fieldKey])) {
// Decode...
if ($res = $this->codeString($EMAIL_VARS[$fieldKey], TRUE)) {
$EMAIL_VARS[$fieldKey] = $res;
} elseif ($integrityCheck) {
// Otherwise abort:
$GLOBALS['TT']->setTSlogMessage('"Formmail" discovered a field (' . $fieldKey . ') which could not be decoded to a valid string. Sending formmail aborted due to security reasons!', 3);
return FALSE;
} else {
$GLOBALS['TT']->setTSlogMessage('"Formmail" discovered a field (' . $fieldKey . ') which could not be decoded to a valid string. The security level accepts this, but you should consider a correct coding though!', 2);
}
}
}
} else {
$locData = explode(':', $locationData);
$record = $this->sys_page->checkRecord($locData[1], $locData[2], 1);
$EMAIL_VARS['recipient'] = $record['subheader'];
$EMAIL_VARS['recipient_copy'] = $this->extractRecipientCopy($record['bodytext']);
}
// Hook for preprocessing of the content for formmails:
if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sendFormmail-PreProcClass'])) {
foreach ($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sendFormmail-PreProcClass'] as $_classRef) {
$_procObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
$EMAIL_VARS = $_procObj->sendFormmail_preProcessVariables($EMAIL_VARS, $this);
}
}
$formmail->start($EMAIL_VARS);
$formmail->sendtheMail();
$GLOBALS['TT']->setTSlogMessage('"Formmail" invoked, sending mail to ' . $EMAIL_VARS['recipient'], 0);
}
示例2: locDataCheck
/**
* Checks if a formmail submission can be sent as email, also used for JumpURLs
* should be removed once JumpURL is handled outside TypoScriptFrontendController
*
* @param string $locationData The input from $_POST['locationData']
* @return void|int
*/
protected function locDataCheck($locationData)
{
$locData = explode(':', $locationData);
if (!$locData[1] || $this->sys_page->checkRecord($locData[1], $locData[2], 1)) {
// $locData[1] -check means that a record is checked only if the locationData has a value for a record else than the page.
if (!empty($this->sys_page->getPage($locData[0]))) {
return 1;
} else {
$GLOBALS['TT']->setTSlogMessage('LocationData Error: The page pointed to by location data (' . $locationData . ') was not accessible.', 2);
}
} else {
$GLOBALS['TT']->setTSlogMessage('LocationData Error: Location data (' . $locationData . ') record pointed to was not accessible.', 2);
}
}