1: <?php
2: // $Id: formhiddentoken.php,v 1.1 2007/05/15 02:34:42 minahito Exp $ // ------------------------------------------------------------------------ //
3: // XOOPS - PHP Content Management System //
4: // Copyright (c) 2000 XOOPS.org //
5: // <http://www.xoops.org/> //
6: // ------------------------------------------------------------------------ //
7: // This program is free software; you can redistribute it and/or modify //
8: // it under the terms of the GNU General Public License as published by //
9: // the Free Software Foundation; either version 2 of the License, or //
10: // (at your option) any later version. //
11: // //
12: // You may not change or alter any portion of this comment or credits //
13: // of supporting developers from this source code or any supporting //
14: // source code which is considered copyrighted (c) material of the //
15: // original comment or credit authors. //
16: // //
17: // This program 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: // You should have received a copy of the GNU General Public License //
23: // along with this program; if not, write to the Free Software //
24: // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------ //
25: // Author: Kazumi Ono (AKA onokazu) //
26: // URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
27: // Project: The XOOPS Project //
28: // ------------------------------------------------------------------------- //
29:
30: if (!defined('XOOPS_ROOT_PATH')) exit();
31:
32: /**
33: *
34: * @author Kazumi Ono <onokazu@xoops.org>
35: * @copyright copyright (c) 2000-2005 XOOPS.org
36: */
37: /**
38: * A hidden token field
39: *
40: *
41: * @author Kazumi Ono <onokazu@xoops.org>
42: * @copyright copyright (c) 2000-2005 XOOPS.org
43: */
44: class XoopsFormHiddenToken extends XoopsFormHidden {
45:
46: /**
47: * Constructor
48: *
49: * @param string $name "name" attribute
50: */
51: function XoopsFormHiddenToken($name = null, $timeout = 360){
52: if (empty($name)) {
53: $token =& XoopsMultiTokenHandler::quickCreate(XOOPS_TOKEN_DEFAULT);
54: $name = $token->getTokenName();
55: } else {
56: $token =& XoopsSingleTokenHandler::quickCreate(XOOPS_TOKEN_DEFAULT);
57: }
58: $this->XoopsFormHidden($name, $token->getTokenValue());
59: }
60: }
61: ?>