1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category modules
|
5
|
* @package captcha_control
|
6
|
* @author WebsiteBaker Project
|
7
|
* @copyright 2009-2011, Website Baker Org. e.V.
|
8
|
* @link http://www.websitebaker2.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.x
|
11
|
* @requirements PHP 5.2.2 and higher
|
12
|
* @version $Id: install.php 1536 2011-12-10 04:22:29Z Luisehahne $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/tags/2.8.3/wb/modules/captcha_control/install.php $
|
14
|
* @lastmodified $Date: 2011-12-10 05:22:29 +0100 (Sat, 10 Dec 2011) $
|
15
|
*
|
16
|
*/
|
17
|
|
18
|
// prevent this file from being accessed directly
|
19
|
/* -------------------------------------------------------- */
|
20
|
if(defined('WB_PATH') == false)
|
21
|
{
|
22
|
// Stop this file being access directly
|
23
|
die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
|
24
|
}
|
25
|
/* -------------------------------------------------------- */
|
26
|
|
27
|
$table = TABLE_PREFIX.'mod_captcha_control';
|
28
|
$database->query("DROP TABLE IF EXISTS `$table`");
|
29
|
|
30
|
$database->query("CREATE TABLE IF NOT EXISTS `$table` (
|
31
|
`enabled_captcha` VARCHAR(1) NOT NULL DEFAULT '1',
|
32
|
`enabled_asp` VARCHAR(1) NOT NULL DEFAULT '0',
|
33
|
`captcha_type` VARCHAR(255) NOT NULL DEFAULT 'calc_text',
|
34
|
`asp_session_min_age` INT(11) NOT NULL DEFAULT '20',
|
35
|
`asp_view_min_age` INT(11) NOT NULL DEFAULT '10',
|
36
|
`asp_input_min_age` INT(11) NOT NULL DEFAULT '5',
|
37
|
`ct_text` LONGTEXT NOT NULL
|
38
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"
|
39
|
);
|
40
|
|
41
|
// add new row using the table default values defined above
|
42
|
$database->query("
|
43
|
INSERT INTO `$table`
|
44
|
(`enabled_captcha`, `enabled_asp`, `captcha_type`)
|
45
|
VALUES
|
46
|
('1', '1', 'calc_text')
|
47
|
");
|