Added feature #16437: Introduce a form protection API (Thanks to the Security Team...
[Packages/TYPO3.CMS.git] / tests / t3lib / formprotection / fixtures / class.t3lib_formprotection_testing.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2010 Oliver Klee <typo3-coding@oliverklee.de>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25 /**
26 * Class t3lib_formProtection_Testing.
27 *
28 * This is a testing subclass of the abstract t3lib_formprotection_Abstract
29 * class.
30 *
31 * $Id$
32 *
33 * @package TYPO3
34 * @subpackage t3lib
35 *
36 * @author Oliver Klee <typo3-coding@oliverklee.de>
37 */
38 class t3lib_formProtection_Testing extends t3lib_formprotection_Abstract {
39 /**
40 * the maximum number of tokens that can exist at the same time
41 *
42 * @var integer
43 */
44 protected $maximumNumberOfTokens = 100;
45
46 /**
47 * Sets the maximum number of tokens that can exist at the same time.
48 *
49 * @param integer $number maximum number of tokens, must be > 0
50 *
51 * @return void
52 */
53 public function setMaximumNumberOfTokens($number) {
54 $this->maximumNumberOfTokens = $number;
55 }
56
57 /**
58 * Creates or displayes an error message telling the user that the submitted
59 * form token is invalid.
60 *
61 * @return void
62 */
63 protected function createValidationErrorMessage() {}
64
65 /**
66 * Retrieves all saved tokens.
67 *
68 * @return array the saved tokens as a two-dimensional array, will be empty
69 * if no tokens have been saved
70 */
71 protected function retrieveTokens() {}
72
73 /**
74 * Saves the tokens so that they can be used by a later incarnation of this
75 * class.
76 *
77 * @return void
78 */
79 public function persistTokens() {}
80
81 /**
82 * Drops the token with the ID $tokenId and persists all tokens.
83 *
84 * If there is no token with that ID, this function is a no-op.
85 *
86 * @param string $tokenId
87 * the 32-character ID of an existing token, must not be empty
88 *
89 * @return void
90 */
91 public function dropToken($tokenId) {
92 parent::dropToken($tokenId);
93 }
94 }
95
96 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/formprotection/class.t3lib_formprotection_testing.php']) {
97 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/formprotection/class.t3lib_formprotection_testing.php']);
98 }
99 ?>