Show
Ignore:
Timestamp:
11/13/11 00:34:07 (19 months ago)
Author:
mistic100
Message:

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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • extensions/CryptograPHP/maintain.inc.php

    r11316 r12617  
    11<?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 
    220function plugin_install() 
    321{ 
    422  global $conf; 
    523   
    6   if (!isset($conf['cryptographp_theme'])) 
     24  if (!isset($conf['cryptographp'])) 
    725  { 
    8     pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("cryptographp_theme","cryptographp,reject","CryptograPHP config");'); 
     26    pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("cryptographp",\''.default_config.'\',"CryptograPHP config");'); 
    927  } 
    1028} 
     
    1331{ 
    1432  global $conf; 
    15   $conf['cryptographp_theme'] = explode(',', $conf['cryptographp_theme']); 
    1633   
    17   if(count($conf['cryptographp_theme']) == 1) 
     34  if (isset($conf['cryptograph_theme'])) 
    1835  { 
    19     pwg_query('UPDATE '.CONFIG_TABLE.' SET value = "'.$conf['cryptographp_theme'][0].',reject" WHERE param = "cryptographp_theme";'); 
     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");'); 
    2042  } 
    2143} 
    2244function plugin_uninstall() 
    2345{ 
    24   pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="cryptographp_theme" LIMIT 1'); 
     46  pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="cryptographp" LIMIT 1'); 
    2547} 
    2648