source: extensions/CryptograPHP/maintain.inc.php @ 13318

Last change on this file since 13318 was 12617, checked in by mistic100, 13 years ago

rewrite some prefilters, replace CryptograPHP by Securimage (not abandoned project!)

File size: 1.2 KB
Line 
1<?php
2define('default_config', serialize(array(
3  'comments_action' => 'reject',
4  'theme'           => 'gray',
5  'captcha_type'    => 'string',
6  'case_sensitive'  => 'false',
7  'code_length'     => 6,
8  'width'           => 120, 
9  'height'          => 40,
10  'perturbation'    => 1, 
11  'image_bg_color'  => 'ffffff', 
12  'text_color'      => '8a8a8a', 
13  'num_lines'       => 2, 
14  'line_color'      => '8a8a8a', 
15  'noise_level'     => 0.1, 
16  'noise_color'     => '8a8a8a', 
17  'ttf_file'        => 'TopSecret',
18)));
19
20function plugin_install()
21{
22  global $conf;
23 
24  if (!isset($conf['cryptographp']))
25  {
26    pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("cryptographp",\''.default_config.'\',"CryptograPHP config");');
27  }
28}
29
30function plugin_activate()
31{
32  global $conf;
33 
34  if (isset($conf['cryptograph_theme']))
35  {
36    pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="cryptographp_theme" LIMIT 1');
37  }
38 
39  if (!isset($conf['cryptograph']))
40  {
41    pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("cryptographp",\''.default_config.'\',"CryptograPHP config");');
42  }
43}
44function plugin_uninstall()
45{
46  pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="cryptographp" LIMIT 1');
47}
48
49?>
Note: See TracBrowser for help on using the repository browser.