[10837] | 1 | <?php |
---|
[14527] | 2 | define('crypto_default_config', serialize(array( |
---|
[12617] | 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 | |
---|
[10837] | 20 | function plugin_install() |
---|
| 21 | { |
---|
| 22 | global $conf; |
---|
| 23 | |
---|
[12617] | 24 | if (!isset($conf['cryptographp'])) |
---|
[10837] | 25 | { |
---|
[14527] | 26 | pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("cryptographp",\''.crypto_default_config.'\',"CryptograPHP config");'); |
---|
[10837] | 27 | } |
---|
| 28 | } |
---|
| 29 | |
---|
[11316] | 30 | function plugin_activate() |
---|
| 31 | { |
---|
| 32 | global $conf; |
---|
| 33 | |
---|
[12617] | 34 | if (isset($conf['cryptograph_theme'])) |
---|
[11316] | 35 | { |
---|
[14527] | 36 | pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="cryptographp_theme" LIMIT 1;'); |
---|
[11316] | 37 | } |
---|
[12617] | 38 | |
---|
[14527] | 39 | if (!isset($conf['cryptographp'])) |
---|
[12617] | 40 | { |
---|
[14527] | 41 | pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("cryptographp",\''.crypto_default_config.'\',"CryptograPHP config");'); |
---|
[12617] | 42 | } |
---|
[11316] | 43 | } |
---|
[14527] | 44 | |
---|
[10837] | 45 | function plugin_uninstall() |
---|
| 46 | { |
---|
[12617] | 47 | pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="cryptographp" LIMIT 1'); |
---|
[10837] | 48 | } |
---|
| 49 | |
---|
| 50 | ?> |
---|