1 | <?php |
---|
2 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | function crypto_install() |
---|
5 | { |
---|
6 | global $conf, $prefixeTable; |
---|
7 | |
---|
8 | if (isset($conf['cryptograph_theme'])) |
---|
9 | { |
---|
10 | pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="cryptographp_theme" LIMIT 1;'); |
---|
11 | } |
---|
12 | |
---|
13 | if (empty($conf['cryptographp'])) |
---|
14 | { |
---|
15 | $crypto_default_config = serialize(array( |
---|
16 | 'activate_on' => array( |
---|
17 | 'picture' => true, |
---|
18 | 'category' => true, |
---|
19 | 'register' => true, |
---|
20 | 'contactform' => true, |
---|
21 | 'guestbook' => true, |
---|
22 | ), |
---|
23 | 'comments_action' => 'reject', |
---|
24 | 'theme' => 'gray', |
---|
25 | 'captcha_type' => 'string', |
---|
26 | 'case_sensitive' => 'false', |
---|
27 | 'code_length' => 6, |
---|
28 | 'width' => 180, |
---|
29 | 'height' => 70, |
---|
30 | 'perturbation' => 1, |
---|
31 | 'image_bg_color' => 'ffffff', |
---|
32 | 'text_color' => '8a8a8a', |
---|
33 | 'num_lines' => 2, |
---|
34 | 'line_color' => '8a8a8a', |
---|
35 | 'noise_level' => 0.1, |
---|
36 | 'noise_color' => '8a8a8a', |
---|
37 | 'ttf_file' => 'TopSecret', |
---|
38 | 'button_color' => 'dark', |
---|
39 | )); |
---|
40 | |
---|
41 | conf_update_param('cryptographp', $crypto_default_config); |
---|
42 | $conf['cryptographp'] = $crypto_default_config; |
---|
43 | } |
---|
44 | else |
---|
45 | { |
---|
46 | $conf['cryptographp'] = unserialize($conf['cryptographp']); |
---|
47 | |
---|
48 | if (!isset($conf['cryptographp']['activate_on'])) |
---|
49 | { |
---|
50 | $conf['cryptographp']['activate_on'] = array( |
---|
51 | 'picture' => $conf['cryptographp']['comments_action'] != 'inactive', |
---|
52 | 'category' => $conf['cryptographp']['comments_action'] != 'inactive', |
---|
53 | 'register' => true, |
---|
54 | 'contactform' => true, |
---|
55 | 'guestbook' => true, |
---|
56 | ); |
---|
57 | } |
---|
58 | if (!isset($conf['cryptographp']['button_color'])) |
---|
59 | { |
---|
60 | $conf['cryptographp']['button_color'] = 'dark'; |
---|
61 | } |
---|
62 | |
---|
63 | $conf['cryptographp'] = serialize($conf['cryptographp']); |
---|
64 | conf_update_param('cryptographp', $conf['cryptographp']); |
---|
65 | } |
---|
66 | } |
---|
67 | |
---|
68 | ?> |
---|