Changeset 12617
- Timestamp:
- Nov 13, 2011, 12:34:07 AM (12 years ago)
- Location:
- extensions/CryptograPHP
- Files:
-
- 45 added
- 3 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/CryptograPHP/admin.php
r11316 r12617 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 3 4 $conf['cryptographp'] = unserialize($conf['cryptographp']); 4 5 load_language('plugin.lang', CRYPTO_PATH); 5 $conf['cryptographp_theme'] = explode(',', $conf['cryptographp_theme']);6 6 7 7 if ( isset($_POST['submit'])) 8 8 { 9 $conf['cryptographp_theme'] = array( 10 $_POST['cryptographp_theme'], 11 $_POST['comments_action'], 9 $conf['cryptographp'] = array( 10 'comments_action' => $_POST['comments_action'], 11 'theme' => $_POST['theme'], 12 'captcha_type' => $_POST['captcha_type'], 13 'case_sensitive' => $conf['cryptographp']['case_sensitive'], //not used, problem with some fonts 14 'width' => (int)$_POST['width'], 15 'height' => (int)$_POST['height'], 16 'perturbation' => (float)$_POST['perturbation'], 17 'image_bg_color' => $_POST['image_bg_color'], 18 'code_length' => (int)$_POST['code_length'], 19 'text_color' => $_POST['text_color'], 20 'num_lines' => (float)$_POST['num_lines'], 21 'line_color' => $_POST['line_color'], 22 'noise_level' => (float)$_POST['noise_level'], 23 'noise_color' => $_POST['noise_color'], 24 'ttf_file' => $_POST['ttf_file'], 12 25 ); 13 conf_update_param('cryptographp_theme', implode(',', $conf['cryptographp_theme'])); 26 27 conf_update_param('cryptographp', serialize($conf['cryptographp'])); 14 28 array_push($page['infos'], l10n('Information data registered in database')); 15 29 } 16 30 17 $template->set_filename('plugin_admin_content', dirname(__FILE__).'/admin.tpl'); 31 $presets = array( 32 'bluenoise' => array('perturbation'=>0.25, 'image_bg_color'=>'ffffff', 'text_color'=>'0000ff', 'num_lines'=>2, 'line_color'=>'0000ff', 'noise_level'=>2, 'noise_color'=>'0000ff', 'ttf_file'=>'AlteHassGroteskB'), 33 'gray' => array('perturbation'=>1, 'image_bg_color'=>'ffffff', 'text_color'=>'8a8a8a', 'num_lines'=>2, 'line_color'=>'8a8a8a', 'noise_level'=>0.1, 'noise_color'=>'8a8a8a', 'ttf_file'=>'TopSecret'), 34 'xcolor' => array('perturbation'=>0.5, 'image_bg_color'=>'ffffff', 'text_color'=>'random', 'num_lines'=>1, 'line_color'=>'ffffff', 'noise_level'=>2, 'noise_color'=>'ffffff', 'ttf_file'=>'Dread'), 35 'pencil' => array('perturbation'=>0.8, 'image_bg_color'=>'9e9e9e', 'text_color'=>'363636', 'num_lines'=>0, 'line_color'=>'ffffff', 'noise_level'=>0, 'noise_color'=>'ffffff', 'ttf_file'=>'AllStar'), 36 ); 37 38 function list_fonts($dir) 39 { 40 $dir = rtrim($dir, '/'); 41 $dh = opendir($dir); 42 $fonts = array(); 43 44 while (($file = readdir($dh)) !== false ) 45 { 46 if ($file !== '.' && $file !== '..') $fonts[] = str_replace('.ttf', null, $file); 47 } 48 49 closedir($dh); 50 return $fonts; 51 } 52 53 function presets_to_js($presets) 54 { 55 $out = null; 56 57 foreach ($presets as $name => $param) 58 { 59 $out.= ' 60 function apply_'.$name.'() { 61 $("input[name=perturbation]").val("'.$param['perturbation'].'"); 62 $("input[name=image_bg_color]").val("'.$param['image_bg_color'].'"); 63 $("input[name=text_color]").val("'.$param['text_color'].'"); 64 $("input[name=num_lines]").val("'.$param['num_lines'].'"); 65 $("input[name=line_color]").val("'.$param['line_color'].'"); 66 $("input[name=noise_level]").val("'.$param['noise_level'].'"); 67 $("input[name=noise_color]").val("'.$param['noise_color'].'"); 68 $("input[name=ttf_file]").val(["'.$param['ttf_file'].'"]); 69 70 }'; 71 } 72 73 return $out; 74 } 75 76 $template->set_filename('plugin_admin_content', dirname(__FILE__).'/template/admin.tpl'); 18 77 19 78 $template->assign(array( 20 'cryptographp_theme' => $conf['cryptographp_theme'][0], 21 'comments_action' => $conf['cryptographp_theme'][1], 22 'available_themes' => array('cryptographp', 'bluenoise', 'gray', 'pencil', 'xcolor'), 79 'crypto' => $conf['cryptographp'], 80 'fonts' => list_fonts(CRYPTO_PATH.'securimage/fonts'), 81 'presets' => array_keys($presets), 82 'PRESETS_FUNC' => presets_to_js($presets), 23 83 'CRYPTO_PATH' => CRYPTO_PATH, 24 ) 25 ); 84 )); 26 85 27 86 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); -
extensions/CryptograPHP/include/category.inc.php
r11370 r12617 1 1 <?php 2 3 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 5 $cryptinstall = CRYPTO_PATH.'cryptographp/cryptographp.fct.php';6 include($cryptinstall);7 3 8 4 add_event_handler('loc_begin_index', 'add_crypto'); … … 11 7 function add_crypto() 12 8 { 13 global $template , $conf;9 global $template; 14 10 15 11 if (!is_a_guest()) return; 16 12 17 13 $template->set_prefilter('comments_on_albums', 'prefilter_crypto'); 18 $template->assign('CAPTCHA', dsp_crypt($conf['cryptographp_theme'][0].'.cfg.php',1));19 14 } 20 15 21 16 function prefilter_crypto($content, $smarty) 22 17 { 23 load_language('plugin.lang', CRYPTO_PATH);18 global $conf; 24 19 25 20 $search = '<input type="hidden" name="key" value="{$comment_add.KEY}">'; 26 21 $replace = $search.' 27 <label>{$CAPTCHA}<input type="text" name="code"></label>'; 22 <label> 23 <img id="captcha" src="'.CRYPTO_PATH.'securimage/securimage_show.php" alt="CAPTCHA Image"> 24 <a href="#" onclick="document.getElementById(\'captcha\').src = \''.CRYPTO_PATH.'securimage/securimage_show.php?\' + Math.random(); return false"> 25 <img src="'.CRYPTO_PATH.'template/refresh.png"></a> 26 <br>{\''.($conf['cryptographp']['captcha_type']=='string'?'Enter code':'Solve equation').'\'|@translate} : 27 <input type="text" name="captcha_code" size="'.($conf['cryptographp']['code_length']+1).'" maxlength="'.$conf['cryptographp']['code_length'].'" /> 28 29 </label>'; 28 30 29 31 return str_replace($search, $replace, $content); … … 32 34 function check_crypto($action, $comment) 33 35 { 34 global $conf , $user;36 global $conf; 35 37 36 $my_action = ($conf['cryptographp_theme'][1] == 'reject') ? 'reject':'moderate'; 38 include_once(CRYPTO_PATH.'securimage/securimage.php'); 39 $securimage = new Securimage(); 37 40 38 if ( $action == 'reject' OR $action == $my_action OR !is_a_guest())41 if ( $action == 'reject' or $action == $conf['cryptographp']['comments_action'] or !is_a_guest() ) 39 42 { 40 43 return $action; 41 44 } 42 45 43 if ( !chk_crypt($_POST['code']))46 if ($securimage->check($_POST['captcha_code']) == false) 44 47 { 45 return $ my_action;48 return $conf['cryptographp']['comments_action']; 46 49 } 47 else 48 { 49 return $action; 50 } 50 51 return $action; 51 52 } 52 53 -
extensions/CryptograPHP/include/contactform.inc.php
r11370 r12617 1 1 <?php 2 3 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 5 $cryptinstall = CRYPTO_PATH.'cryptographp/cryptographp.fct.php';6 include($cryptinstall);7 3 8 4 add_event_handler('display_contactform', 'add_crypto'); … … 11 7 function add_crypto() 12 8 { 13 global $template , $conf;9 global $template; 14 10 15 11 if (!is_a_guest()) return; 16 12 17 13 $template->set_prefilter('cf_form', 'prefilter_crypto'); 18 $template->assign('CAPTCHA', dsp_crypt($conf['cryptographp_theme'][0].'.cfg.php',1));19 14 } 20 15 21 16 function prefilter_crypto($content, $smarty) 22 17 { 18 global $conf; 19 23 20 $search = ' 24 21 <tr> … … 26 23 <td class="contact-form-right"><input class="submit" type="submit" value="{\'cf_submit\'|@translate}"></td> 27 24 </tr>'; 28 $replace = ' 25 $replace = ' 29 26 <tr> 30 <td class="contact-form-left" style="vertical-align:top;">{\'Antibot test\'|@translate}</td> 31 <td class="contact-form-right"><input type="text" name="code"> <span style="vertical-align:top;">{$CAPTCHA}</span></td> 27 <td class="contact-form-left" style="vertical-align:top;"> 28 {\''.($conf['cryptographp']['captcha_type']=='string'?'Enter code':'Solve equation').'\'|@translate} 29 <img id="captcha" src="'.CRYPTO_PATH.'securimage/securimage_show.php" alt="CAPTCHA Image"> 30 </td> 31 <td class="contact-form-right"><input type="text" name="captcha_code" size="'.($conf['cryptographp']['code_length']+1).'" maxlength="'.$conf['cryptographp']['code_length'].'" /> 32 <a href="#" onclick="document.getElementById(\'captcha\').src = \''.CRYPTO_PATH.'securimage/securimage_show.php?\' + Math.random(); return false"> 33 <img src="'.CRYPTO_PATH.'template/refresh.png"></a> 34 </td> 32 35 </tr>' 33 36 ."\n".$search; … … 39 42 { 40 43 if (!is_a_guest()) return $infos; 41 42 if (!chk_crypt($_POST['code'])) 44 45 include_once(CRYPTO_PATH.'securimage/securimage.php'); 46 $securimage = new Securimage(); 47 48 if ($securimage->check($_POST['captcha_code']) == false) 43 49 { 44 load_language('plugin.lang', CRYPTO_PATH);45 50 array_push($infos['errors'], l10n('Invalid Captcha')); 46 51 } -
extensions/CryptograPHP/include/picture.inc.php
r11370 r12617 1 1 <?php 2 3 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 3 5 $cryptinstall = CRYPTO_PATH.'cryptographp/cryptographp.fct.php'; 6 include($cryptinstall); 7 8 add_event_handler('loc_begin_picture', 'add_crypto'); 4 add_event_handler('loc_end_picture', 'add_crypto'); 9 5 add_event_handler('user_comment_check', 'check_crypto', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 10 6 11 7 function add_crypto() 12 8 { 13 global $template , $conf;9 global $template; 14 10 15 11 if (!is_a_guest()) return; 16 12 17 13 $template->set_prefilter('picture', 'prefilter_crypto'); 18 $template->assign('CAPTCHA', dsp_crypt($conf['cryptographp_theme'][0].'.cfg.php',1));19 14 } 20 15 21 16 function prefilter_crypto($content, $smarty) 22 17 { 23 load_language('plugin.lang', CRYPTO_PATH);18 global $conf; 24 19 25 20 $search = '<input type="hidden" name="key" value="{$comment_add.KEY}">'; 26 21 $replace = $search.' 27 <label>{$CAPTCHA}<input type="text" name="code"></label>'; 22 <label> 23 <img id="captcha" src="'.CRYPTO_PATH.'securimage/securimage_show.php" alt="CAPTCHA Image"> 24 <a href="#" onclick="document.getElementById(\'captcha\').src = \''.CRYPTO_PATH.'securimage/securimage_show.php?\' + Math.random(); return false"> 25 <img src="'.CRYPTO_PATH.'template/refresh.png"></a> 26 <br>{\''.($conf['cryptographp']['captcha_type']=='string'?'Enter code':'Solve equation').'\'|@translate} : 27 <input type="text" name="captcha_code" size="'.($conf['cryptographp']['code_length']+1).'" maxlength="'.$conf['cryptographp']['code_length'].'" /> 28 29 </label>'; 28 30 29 31 return str_replace($search, $replace, $content); … … 32 34 function check_crypto($action, $comment) 33 35 { 34 global $conf , $user;36 global $conf; 35 37 36 $my_action = ($conf['cryptographp_theme'][1] == 'reject') ? 'reject':'moderate'; 38 include_once(CRYPTO_PATH.'securimage/securimage.php'); 39 $securimage = new Securimage(); 37 40 38 if ( $action == 'reject' OR $action == $my_action OR !is_a_guest())41 if ( $action == 'reject' or $action == $conf['cryptographp']['comments_action'] or !is_a_guest() ) 39 42 { 40 43 return $action; 41 44 } 42 45 43 if ( !chk_crypt($_POST['code']))46 if ($securimage->check($_POST['captcha_code']) == false) 44 47 { 45 return $ my_action;48 return $conf['cryptographp']['comments_action']; 46 49 } 47 else 48 { 49 return $action; 50 } 50 51 return $action; 51 52 } 52 53 -
extensions/CryptograPHP/include/register.inc.php
r11370 r12617 1 1 <?php 2 3 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 5 $cryptinstall = CRYPTO_PATH.'cryptographp/cryptographp.fct.php';6 include($cryptinstall);7 3 8 4 add_event_handler('loc_end_page_header', 'add_crypto'); … … 11 7 function add_crypto() 12 8 { 13 global $template , $conf;9 global $template; 14 10 15 11 $template->set_prefilter('register', 'prefilter_crypto'); 16 $template->assign('CAPTCHA', dsp_crypt($conf['cryptographp_theme'][0].'.cfg.php',1));17 12 } 18 13 19 14 function prefilter_crypto($content, $smarty) 20 15 { 21 load_language('plugin.lang', CRYPTO_PATH);16 global $conf; 22 17 23 $search = ' <p class="bottomButtons">';18 $search = '#\<\/ul\>(.{0,10})\<\/fieldset\>(.{0,10})\<p class\=\"bottomButtons\"\>#is'; 24 19 $replace = ' 25 <fieldset>26 <legend>{\'Antibot test\'|@translate}</legend>27 <ul>28 20 <li> 29 21 <span class="property"> 30 <label> {$CAPTCHA}</label>22 <label><img id="captcha" src="'.CRYPTO_PATH.'securimage/securimage_show.php" alt="CAPTCHA Image"></label> 31 23 </span> 32 <input type="text" name="code"> 24 <b>{\''.($conf['cryptographp']['captcha_type']=='string'?'Enter code':'Solve equation').'\'|@translate} :</b><br> 25 <input type="text" name="captcha_code" size="'.($conf['cryptographp']['code_length']+1).'" maxlength="'.$conf['cryptographp']['code_length'].'" /> 26 <a href="#" onclick="document.getElementById(\'captcha\').src = \''.CRYPTO_PATH.'securimage/securimage_show.php?\' + Math.random(); return false"> 27 <img src="'.CRYPTO_PATH.'template/refresh.png"></a> 33 28 </li> 34 </ul> 35 </fieldset>' 36 ."\n".$search; 29 </ul> 37 30 38 return str_replace($search, $replace, $content); 31 </fieldset> 32 33 <p class="bottomButtons">'; 34 35 return preg_replace($search, $replace, $content); 39 36 } 40 37 41 38 function check_crypto($errors) 42 39 { 43 if (!chk_crypt($_POST['code'])) 40 include_once(CRYPTO_PATH.'securimage/securimage.php'); 41 $securimage = new Securimage(); 42 43 if ($securimage->check($_POST['captcha_code']) == false) 44 44 { 45 load_language('plugin.lang', CRYPTO_PATH);46 45 array_push($errors, l10n('Invalid Captcha')); 47 46 } -
extensions/CryptograPHP/language/cs_CZ/description.txt
r11142 r12617 1 Vloží CryptograPHPcaptcha ověření pro registrační stránku a kontaktní formulář (thanks to P@t)1 Vloží captcha ověření pro registrační stránku a kontaktní formulář (thanks to P@t) -
extensions/CryptograPHP/language/cs_CZ/plugin.lang.php
r11734 r12617 6 6 $lang['Moderate'] = 'Moderovat'; 7 7 $lang['No captcha'] = 'Bez captcha kódu'; 8 $lang['Antibot test'] = 'Antirobot test';9 8 10 9 ?> -
extensions/CryptograPHP/language/el_GR/description.txt
r11672 r12617 1 Πρόσθεσε ένα CryptograPHPcaptcha για εγγραφή, σχόλιο και φόρμα επικοινωνίας1 Πρόσθεσε ένα captcha για εγγραφή, σχόλιο και φόρμα επικοινωνίας -
extensions/CryptograPHP/language/el_GR/plugin.lang.php
r11672 r12617 3 3 $lang['Invalid Captcha'] = 'Άκυρο Captcha'; 4 4 $lang['Captcha theme'] = 'Θέμα Captcha'; 5 $lang['Antibot test'] = 'Δοκιμή Antibot';6 5 $lang['Comments action'] = 'Ενέργεια σχολίου'; 7 6 $lang['Moderate'] = 'Μέτριο'; -
extensions/CryptograPHP/language/en_UK/description.txt
r11375 r12617 1 Add a CryptograPHPcaptcha to register, comment and ContactForm pages (thanks to P@t)1 Add a captcha to register, comment and ContactForm pages (thanks to P@t) -
extensions/CryptograPHP/language/en_UK/plugin.lang.php
r11316 r12617 2 2 3 3 $lang['Invalid Captcha'] = 'Invalid Captcha'; 4 $lang['Captcha theme'] = 'Captcha theme'; 5 $lang['Antibot test'] = 'Antibot test'; 4 $lang['Enter code'] = 'Enter code'; 5 $lang['Solve equation'] = 'Solve equation'; 6 6 7 $lang['Comments action'] = 'Comments action'; 7 8 $lang['Moderate'] = 'Moderate'; 8 9 $lang['No captcha'] = 'No captcha'; 10 $lang['Captcha type'] = 'Captcha type'; 11 $lang['Random string'] = 'Random string'; 12 $lang['Simple equation'] = 'Simple equation'; 13 $lang['Case sensitive'] = 'Case sensitive'; 14 $lang['Code lenght'] = 'Code lenght'; 15 $lang['good value:'] = 'good value:'; 16 $lang['Captcha theme'] = 'Captcha theme'; 17 18 $lang['Perturbation'] = 'Perturbation'; 19 $lang['range:'] = 'range:'; 20 $lang['Background color'] = 'Background color'; 21 $lang['Text color'] = 'Text color'; 22 $lang['Lines density'] = 'Lines density'; 23 $lang['Lines color'] = 'Lines color'; 24 $lang['Noise level'] = 'Noise level'; 25 $lang['Noise color'] = 'Noise color'; 26 $lang['Font'] = 'Font'; 27 $lang['Preview'] = 'Preview'; 28 $lang['Tip: type "random" on a color field to have a random color'] = 'Tip: type "random" on a color field to have a random color'; 9 29 10 30 ?> -
extensions/CryptograPHP/language/es_ES/description.txt
r11405 r12617 1 Añade un captcha CryptograPHPa la página de registro y en la página de ContactForm (gracias a P@t)1 Añade un captcha a la página de registro y en la página de ContactForm (gracias a P@t) -
extensions/CryptograPHP/language/es_ES/plugin.lang.php
r11405 r12617 3 3 $lang['Invalid Captcha'] = 'Captcha no valido'; 4 4 $lang['Captcha theme'] = 'Tema del captcha'; 5 $lang['Antibot test'] = 'Test anti-bots';6 5 $lang['Comments action'] = 'Acción para los Comentario'; 7 6 $lang['Moderate'] = 'Moderar'; -
extensions/CryptograPHP/language/fr_FR/description.txt
r11375 r12617 1 Ajoute un captcha CryptograPHPà la page d'enregistrement, au formulaire de commentaire et sur la page de ContactForm (merci à P@t)1 Ajoute un captcha à la page d'enregistrement, au formulaire de commentaire et sur la page de ContactForm (merci à P@t) -
extensions/CryptograPHP/language/fr_FR/plugin.lang.php
r11316 r12617 2 2 3 3 $lang['Invalid Captcha'] = 'Captcha non valide'; 4 $lang['Captcha theme'] = 'Thème du captcha'; 5 $lang['Antibot test'] = 'Test anti-bots'; 4 $lang['Enter code'] = 'Entrez le code'; 5 $lang['Solve equation'] = 'Resolvez l\'équation'; 6 6 7 $lang['Comments action'] = 'Action pour les commentaires'; 7 8 $lang['Moderate'] = 'Modérer'; 8 9 $lang['No captcha'] = 'Pas de captcha'; 10 $lang['Captcha type'] = 'Type de captcha'; 11 $lang['Random string'] = 'Code aléatoire'; 12 $lang['Simple equation'] = 'Equation simple'; 13 $lang['Case sensitive'] = 'Sensibilité à la case'; 14 $lang['Code lenght'] = 'Longueur du code'; 15 $lang['good value:'] = 'conseillé:'; 16 $lang['Captcha theme'] = 'Thème du captcha'; 17 18 $lang['Perturbation'] = 'Perturbation'; 19 $lang['range:'] = 'plage:'; 20 $lang['Background color'] = 'Couleur de fond'; 21 $lang['Text color'] = 'Couleur du texte'; 22 $lang['Lines density'] = 'Nombre de lignes'; 23 $lang['Lines color'] = 'Couleur des lignes'; 24 $lang['Noise level'] = 'Quantité de bruit'; 25 $lang['Noise color'] = 'Couleur du bruit'; 26 $lang['Font'] = 'Police'; 27 $lang['Preview'] = 'Prévisualisation'; 28 $lang['Tip: type "random" on a color field to have a random color'] = 'Astuce: inscrivez "random" dans un champs de couleur pour avoir une couleur aléatoire'; 9 29 10 30 ?> -
extensions/CryptograPHP/language/hu_HU/description.txt
r11666 r12617 1 C ryptograPHP captcha hozzáadása a regisztrációs, komment és KapcsolatŰrlap oldalakhoz.1 Captcha hozzáadása a regisztrációs, komment és KapcsolatŰrlap oldalakhoz. -
extensions/CryptograPHP/language/hu_HU/plugin.lang.php
r11663 r12617 3 3 $lang['Invalid Captcha'] = 'Érvénytelen Captcha'; 4 4 $lang['Captcha theme'] = 'Captcha téma'; 5 $lang['Antibot test'] = 'Antibot teszt';6 5 $lang['Comments action'] = 'Hozzászólás műveletek'; 7 6 $lang['Moderate'] = 'Moderálás'; -
extensions/CryptograPHP/language/it_IT/description.txt
r11391 r12617 1 Aggiunge un captcha CryptograPHPsulla pagina di iscrizione, sul modulo dei commenti e sulla pagina di ContactForm (grazie a P@t)1 Aggiunge un captcha sulla pagina di iscrizione, sul modulo dei commenti e sulla pagina di ContactForm (grazie a P@t) -
extensions/CryptograPHP/language/it_IT/plugin.lang.php
r11400 r12617 3 3 $lang['Invalid Captcha'] = 'Captcha non valido'; 4 4 $lang['Captcha theme'] = 'Tema del captcha'; 5 $lang['Antibot test'] = 'Test Antibot';6 5 $lang['Comments action'] = 'Azione per i commenti'; 7 6 $lang['Moderate'] = 'Moderare'; -
extensions/CryptograPHP/language/pl_PL/plugin.lang.php
r12084 r12617 1 1 <?php 2 // +-----------------------------------------------------------------------+ 3 // | Piwigo - a PHP based photo gallery | 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org | 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | 8 // +-----------------------------------------------------------------------+ 9 // | This program is free software; you can redistribute it and/or modify | 10 // | it under the terms of the GNU General Public License as published by | 11 // | the Free Software Foundation | 12 // | | 13 // | This program is distributed in the hope that it will be useful, but | 14 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 // | General Public License for more details. | 17 // | | 18 // | You should have received a copy of the GNU General Public License | 19 // | along with this program; if not, write to the Free Software | 20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 21 // | USA. | 22 // +-----------------------------------------------------------------------+ 23 $lang['Antibot test'] = 'Test antybotowy'; 2 24 3 $lang['Captcha theme'] = 'Wygląd captcha'; 25 4 $lang['Comments action'] = 'Akcja wykonywana dla komentarzy'; … … 27 6 $lang['Moderate'] = 'Średni'; 28 7 $lang['No captcha'] = 'Brak captcha'; 8 29 9 ?> -
extensions/CryptograPHP/main.inc.php
r11375 r12617 3 3 Plugin Name: Crypto Captcha 4 4 Version: auto 5 Description: Add a CryptograPHPcaptcha to register, comment and ContactForm pages (thanks to P@t)5 Description: Add a captcha to register, comment and ContactForm pages (thanks to P@t) 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=535 7 7 Author: Mistic 8 8 Author URI: http://www.strangeplanet.fr 9 */ 10 11 ## TODO : add customization of background image 12 13 /* 14 Author note : 15 Le plugin était appellé à l'origine CryptograPHP et utilisait la librairie CryptograPHP 16 Puis il a été renommé Crypto Captcha pour plus de clareté 17 La version actuelle s'appelle toujours Crypto Captcha mais utilise la librairie Securimage 9 18 */ 10 19 … … 17 26 { 18 27 global $conf, $pwg_loaded_plugins, $page; 19 $conf['cryptographp_theme'] = explode(',', $conf['cryptographp_theme']); 28 29 $conf['cryptographp'] = unserialize($conf['cryptographp']); 30 load_language('plugin.lang', CRYPTO_PATH); 20 31 21 32 if (script_basename() == 'register') … … 23 34 include(CRYPTO_PATH.'include/register.inc.php'); 24 35 } 25 else if (script_basename() == 'picture' AND $conf['cryptographp_theme'][1] != 'inactive')36 else if (script_basename() == 'picture' and $conf['cryptographp']['comments_action'] != 'inactive') 26 37 { 27 38 include(CRYPTO_PATH.'include/picture.inc.php'); 28 }29 else if (30 script_basename() == 'index' AND $conf['cryptographp_theme'][1] != 'inactive' AND31 isset($pwg_loaded_plugins['Comments_on_Albums']) AND32 $page['section'] == 'categories' AND isset($page['category'])33 ) {34 include(CRYPTO_PATH.'include/category.inc.php');35 39 } 36 40 else if (isset($_GET['/contact'])) 37 41 { 38 42 include(CRYPTO_PATH.'include/contactform.inc.php'); 43 } 44 else if ( 45 script_basename() == 'index' and $conf['cryptographp']['comments_action'] != 'inactive' and 46 isset($pwg_loaded_plugins['Comments_on_Albums']) and isset($page['section']) and 47 $page['section'] == 'categories' and isset($page['category']) 48 ) 49 { 50 include(CRYPTO_PATH.'include/category.inc.php'); 39 51 } 40 52 } … … 46 58 function crypto_plugin_admin_menu($menu) 47 59 { 48 global $page,$conf; 49 50 array_push( 51 $menu, 52 array( 53 'NAME' => 'CryptograPHP', 54 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) 55 ) 56 ); 60 array_push($menu, array( 61 'NAME' => 'Crypto Captcha', 62 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) 63 )); 57 64 return $menu; 58 65 } -
extensions/CryptograPHP/maintain.inc.php
r11316 r12617 1 1 <?php 2 define('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 2 20 function plugin_install() 3 21 { 4 22 global $conf; 5 23 6 if (!isset($conf['cryptographp _theme']))24 if (!isset($conf['cryptographp'])) 7 25 { 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");'); 9 27 } 10 28 } … … 13 31 { 14 32 global $conf; 15 $conf['cryptographp_theme'] = explode(',', $conf['cryptographp_theme']);16 33 17 if (count($conf['cryptographp_theme']) == 1)34 if (isset($conf['cryptograph_theme'])) 18 35 { 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");'); 20 42 } 21 43 } 22 44 function plugin_uninstall() 23 45 { 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'); 25 47 } 26 48
Note: See TracChangeset
for help on using the changeset viewer.