TYPO3 API  SVNRelease
class.t3lib_formprotection_disabledformprotection.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003  * Copyright notice
00004  *
00005  * (c) 2011 Helmut Hummel <helmut.hummel@typo3.org>
00006  * All rights reserved
00007  *
00008  * This script is part of the TYPO3 project. The TYPO3 project is
00009  * free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * The GNU General Public License can be found at
00015  * http://www.gnu.org/copyleft/gpl.html.
00016  *
00017  * This script is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * This copyright notice MUST APPEAR in all copies of the script!
00023  ***************************************************************/
00024 
00025 /**
00026  * Class t3lib_formprotection_DisabledFormProtection.
00027  *
00028  * This class is a dummy implementation of the form protection,
00029  * which is used when no authentication is used.
00030  *
00031  * $Id$
00032  *
00033  * @package TYPO3
00034  * @subpackage t3lib
00035  *
00036  * @author Helmut Hummel <helmut.hummel@typo3.org>
00037  */
00038 class t3lib_formprotection_DisabledFormProtection extends t3lib_formprotection_Abstract {
00039 
00040     /**
00041      * Disable parent constructor
00042      */
00043     public function __construct() {
00044         // Do nothing.
00045     }
00046 
00047     /**
00048      * Disable parent method
00049      */
00050     public function generateToken(
00051         $formName, $action = '', $formInstanceName = ''
00052     ) {
00053         return 'dummyToken';
00054     }
00055 
00056     /**
00057      * Disable parent method.
00058      * Always return true.
00059      *
00060      * @return boolean
00061      */
00062     public function validateToken(
00063         $tokenId, $formName, $action = '', $formInstanceName = ''
00064     ) {
00065         return TRUE;
00066     }
00067 
00068     /**
00069      * Dummy implementation
00070      */
00071     protected function createValidationErrorMessage() {
00072         // Do nothing.
00073     }
00074 
00075     /**
00076      * Dummy implementation
00077      */
00078     protected function retrieveTokens() {
00079         // Do nothing.
00080     }
00081 
00082     /**
00083      * Dummy implementation
00084      */
00085     public function persistTokens() {
00086         // Do nothing.
00087     }
00088 }
00089 
00090 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/formprotection/class.t3lib_formprotection_backendformprotection.php'])) {
00091     include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/formprotection/class.t3lib_formprotection_backendformprotection.php']);
00092 }
00093 ?>