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

Last change on this file since 17439 was 16311, checked in by mistic100, 12 years ago

typo in default config

File size: 1.7 KB
RevLine 
[10837]1<?php
[14527]2define('crypto_default_config', serialize(array(
[15996]3  'activate_on'     => array(
4        'picture'     => true,
[16311]5        'category'    => true,
[15996]6        'register'    => true,
7        'contactform' => true,
8        'guestbook'   => true,
9        ),
[12617]10  'comments_action' => 'reject',
11  'theme'           => 'gray',
12  'captcha_type'    => 'string',
13  'case_sensitive'  => 'false',
14  'code_length'     => 6,
[15996]15  'width'           => 180, 
16  'height'          => 70,
[12617]17  'perturbation'    => 1, 
18  'image_bg_color'  => 'ffffff', 
19  'text_color'      => '8a8a8a', 
20  'num_lines'       => 2, 
21  'line_color'      => '8a8a8a', 
22  'noise_level'     => 0.1, 
23  'noise_color'     => '8a8a8a', 
24  'ttf_file'        => 'TopSecret',
25)));
26
[10837]27function plugin_install()
28{
29  global $conf;
30 
[15996]31  conf_update_param('cryptographp', crypto_default_config);
[10837]32}
33
[11316]34function plugin_activate()
35{
36  global $conf;
37 
[12617]38  if (isset($conf['cryptograph_theme']))
[11316]39  {
[14527]40    pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="cryptographp_theme" LIMIT 1;');
[11316]41  }
[12617]42 
[14527]43  if (!isset($conf['cryptographp']))
[12617]44  {
[15996]45    conf_update_param('cryptographp', crypto_default_config);
[12617]46  }
[15996]47  else
48  {
49    $conf['cryptographp'] = unserialize($conf['cryptographp']);
50    if (!isset($conf['cryptographp']['activate_on']))
51    {
52      $conf['cryptographp']['activate_on'] = array(
53        'picture'     => $conf['cryptographp']['comments_action'] != 'inactive',
54        'category'    => $conf['cryptographp']['comments_action'] != 'inactive',
55        'register'    => true,
56        'contactform' => true,
57        'guestbook'   => true,
58        );
59      conf_update_param('cryptographp', serialize($conf['cryptographp']));
60    }
61  }
[11316]62}
[14527]63
[10837]64function plugin_uninstall()
65{
[12617]66  pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="cryptographp" LIMIT 1');
[10837]67}
68
69?>
Note: See TracBrowser for help on using the repository browser.