Changeset 26041 for extensions/CryptograPHP
- Timestamp:
- Dec 19, 2013, 3:24:59 PM (11 years ago)
- Location:
- extensions/CryptograPHP
- Files:
-
- 1 deleted
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/CryptograPHP/admin.php
r23209 r26041 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 4 global $pwg_loaded_plugins; … … 7 7 'category' => isset($pwg_loaded_plugins['Comments_on_Albums']), 8 8 'guestbook' => isset($pwg_loaded_plugins['GuestBook']), 9 'easycaptcha' => isset($pwg_loaded_plugins['EasyCaptcha']), 9 10 ); 10 11 11 12 load_language('plugin.lang', CRYPTO_PATH); 13 12 if ($loaded['easycaptcha']) 13 { 14 $page['warnings'][] = l10n('We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'); 15 } 14 16 15 17 if ( isset($_POST['submit'])) 16 { 18 { 19 if (!isset($_POST['activate_on'])) $_POST['activate_on'] = array(); 20 17 21 $conf['cryptographp'] = array( 18 22 'activate_on' => array( 19 20 21 22 23 24 23 'picture' => in_array('picture', $_POST['activate_on']), 24 'category' => in_array('category', $_POST['activate_on']) || !$loaded['category'], 25 'register' => in_array('register', $_POST['activate_on']), 26 'contactform' => in_array('contactform', $_POST['activate_on']) || !$loaded['contactform'], 27 'guestbook' => in_array('guestbook', $_POST['activate_on']) || !$loaded['guestbook'], 28 ), 25 29 'comments_action' => $_POST['comments_action'], 26 30 'theme' => $_POST['theme'], … … 42 46 43 47 conf_update_param('cryptographp', serialize($conf['cryptographp'])); 44 array_push($page['infos'], l10n('Information data registered in database'));48 $page['infos'][] = l10n('Information data registered in database'); 45 49 } 46 50 … … 78 82 $template->set_filename('plugin_admin_content', dirname(__FILE__).'/template/admin.tpl'); 79 83 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 80 81 ?> -
extensions/CryptograPHP/include/category.inc.php
r19428 r26041 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 4 include(CRYPTO_PATH.'include/common.inc.php'); … … 29 29 if ($securimage->check($_POST['captcha_code']) == false) 30 30 { 31 if ($conf['cryptographp']['comments_action'] == 'reject') array_push($page['errors'], l10n('Invalid Captcha'));31 if ($conf['cryptographp']['comments_action'] == 'reject') $page['errors'][] = l10n('Invalid Captcha'); 32 32 return ($action != 'reject') ? $conf['cryptographp']['comments_action'] : 'reject'; 33 33 } … … 35 35 return $action; 36 36 } 37 38 ?> -
extensions/CryptograPHP/include/common.inc.php
r20189 r26041 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 4 global $template; … … 18 18 $template->set_filename('cryptographp', realpath(CRYPTO_PATH.'template/'.$conf['cryptographp']['template'].'.tpl')); 19 19 $template->assign_var_from_handle('CRYPTOGRAPHP', 'cryptographp'); 20 21 ?> -
extensions/CryptograPHP/include/contactform.inc.php
r19428 r26041 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 4 include(CRYPTO_PATH.'include/common.inc.php'); … … 29 29 if ($securimage->check($_POST['captcha_code']) == false) 30 30 { 31 array_push($page['errors'], l10n('Invalid Captcha'));31 $page['errors'][] = l10n('Invalid Captcha'); 32 32 return 'reject'; 33 33 } … … 35 35 return $action; 36 36 } 37 38 ?> -
extensions/CryptograPHP/include/guestbook.inc.php
r20189 r26041 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 4 include(CRYPTO_PATH.'include/common.inc.php'); … … 29 29 if ($securimage->check($_POST['captcha_code']) == false) 30 30 { 31 array_push($page['errors'], l10n('Invalid Captcha'));31 $page['errors'][] = l10n('Invalid Captcha'); 32 32 return 'reject'; 33 33 } … … 35 35 return $action; 36 36 } 37 38 ?> -
extensions/CryptograPHP/include/picture.inc.php
r19428 r26041 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 4 include(CRYPTO_PATH.'include/common.inc.php'); … … 29 29 if ($securimage->check($_POST['captcha_code']) == false) 30 30 { 31 if ($conf['cryptographp']['comments_action'] == 'reject') array_push($page['errors'], l10n('Invalid Captcha'));31 if ($conf['cryptographp']['comments_action'] == 'reject') $page['errors'][] = l10n('Invalid Captcha'); 32 32 return ($action != 'reject') ? $conf['cryptographp']['comments_action'] : 'reject'; 33 33 } … … 35 35 return $action; 36 36 } 37 38 ?> -
extensions/CryptograPHP/include/register.inc.php
r19428 r26041 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 4 include(CRYPTO_PATH.'include/common.inc.php'); … … 26 26 if ($securimage->check($_POST['captcha_code']) == false) 27 27 { 28 array_push($errors, l10n('Invalid Captcha'));28 $errors[] = l10n('Invalid Captcha'); 29 29 } 30 30 31 31 return $errors; 32 32 } 33 34 ?> -
extensions/CryptograPHP/language/cs_CZ/plugin.lang.php
r20889 r26041 33 33 $lang['Register form'] = 'Registrační formulář'; 34 34 $lang['Button color'] = 'Barva tlačítka'; 35 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Zjistili jsme, že používáte také EasyCaptcha plugin. Oba pluginy mohou být používány současně, ale nesmějí být za žádných okolností aktivovány na stejné stránce.'; 36 35 37 ?> -
extensions/CryptograPHP/language/da_DK/plugin.lang.php
r19430 r26041 52 52 $lang['Picture comments'] = 'Billedkommentarer'; 53 53 $lang['Button color'] = 'Knapfarve'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Vi har opdaget, at EasyCaptcha-plugin\'en er aktiveret i dit galleri. Begge plugin\'er kan benyttes på samme tid, men du bør under ingen omstændigheder aktivere dem begge på den samme side.'; 55 54 56 ?> -
extensions/CryptograPHP/language/de_DE/plugin.lang.php
r24143 r26041 52 52 $lang['Register form'] = 'Registrierungs-Formular '; 53 53 $lang['Button color'] = 'Tastenfarbe'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Es wurde festgestellt, dass das EasyCaptcha Plugin in deiner Gallerie verfügbar ist. Beide Plugins können zeitgleich benutzt werden, aber auf keinen Fall dürfen beide auf der gleichen Seite aktiviert sein.'; 55 54 56 ?> -
extensions/CryptograPHP/language/el_GR/plugin.lang.php
r24143 r26041 33 33 $lang['Register form'] = 'Φόρμα Εγγραφής'; 34 34 $lang['Button color'] = 'χρώμα κουμπιού'; 35 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Διαπιστώθηκε ότι το πρόσθετο EasyCaptcha είναι διαθέσιμο στην γκαλερί σας. Και τα δύο plugins μπορούν να χρησιμοποιηθούν ταυτόχρονα, αλλά δεν πρέπει σε καμία περίπτωση να ενεργοποιηθούν και τα δύο στην ίδια σελίδα.'; 36 35 37 ?> -
extensions/CryptograPHP/language/en_UK/plugin.lang.php
r20428 r26041 34 34 $lang['Preview'] = 'Preview'; 35 35 $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'; 36 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'We detected that EasyCaptcha plugin is available in your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'; 36 37 37 38 ?> -
extensions/CryptograPHP/language/es_ES/plugin.lang.php
r19505 r26041 33 33 $lang['Register form'] = 'Formulario de registro'; 34 34 $lang['Button color'] = 'color del botón'; 35 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Hemos detectado que EasyCaptcha plugin está disponible en su galería. Ambos plugins se pueden utilizar al mismo tiempo, pero no debe, bajo ninguna circunstancia activar los dos en la misma página.'; 36 35 37 ?> -
extensions/CryptograPHP/language/fr_FR/plugin.lang.php
r19428 r26041 34 34 $lang['Preview'] = 'Prévisualisation'; 35 35 $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'; 36 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Nous avons détecté que EasyCaptcha est activé sur votre galerie. Les deux plugins peuvent fonctionner en même temps, mais sous aucun prétexte ils ne doivent être activés sur les mêmes pages.'; 36 37 37 38 ?> -
extensions/CryptograPHP/language/it_IT/plugin.lang.php
r19445 r26041 33 33 $lang['Register form'] = 'Modulo registrazione'; 34 34 $lang['Button color'] = 'Colore pulsante'; 35 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Abbiamo rilevato che il plugin EasyCaptcha è disponibile nella tua galleria. Entrambi i plugin possono essere utilizzati allo stesso tempo, ma non devono in nessun caso essere attivati entrambi sulla stessa pagina.'; 36 35 37 ?> -
extensions/CryptograPHP/language/lv_LV/plugin.lang.php
r19853 r26041 33 33 $lang['Register form'] = 'Reģistra forma'; 34 34 $lang['Button color'] = 'Pogas krāsa'; 35 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Mēs esam konstatējuši, ka jūsu galerijā ir pieejams EasyCaptcha spraudnis. Abus spraudņus var izmantot vienlaicīgi, bet nekādā gadījumā jūs nedrikstat aktivēt abus vienā un tajā pašā lapā.'; 36 35 37 ?> -
extensions/CryptograPHP/language/nl_NL/plugin.lang.php
r20006 r26041 52 52 $lang['Invalid Captcha'] = 'Ongeldige Captcha'; 53 53 $lang['Button color'] = 'Knopkleur'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Geconstateerd wordt dat u ook EasyCaptcha gebruikt. Beide plugins kunnen tegelijkertijd gebruikt worden, maar kunnen beter niet op dezelfde pagina tegelijkertijd gebruikt worden.'; 55 54 56 ?> -
extensions/CryptograPHP/language/pl_PL/plugin.lang.php
r20694 r26041 33 33 $lang['Register form'] = 'Formularz rejestracyjny'; 34 34 $lang['Button color'] = 'Kolor przycisku'; 35 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'W galerii wykryto wtyczkę EasyCaptcha. Obie wtyczki mogą być używane jednoczenie, ale pod żadnym pozorem nie na jednej stronie.'; 36 35 37 ?> -
extensions/CryptograPHP/language/pt_BR/plugin.lang.php
r24143 r26041 52 52 $lang['Noise level'] = 'Nível barulhento'; 53 53 $lang['Perturbation'] = 'Pertubação'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Detectamos que EasyCaptcha plugin está disponível em sua galeria. Ambos os plugins podem ser usados ao mesmo tempo, mas você não deve em hipótese alguma ativar ambos na mesma página.'; 55 54 56 ?> -
extensions/CryptograPHP/language/pt_PT/plugin.lang.php
r24143 r26041 51 51 $lang['Noise color'] = 'Cor do ruído '; 52 52 $lang['Noise level'] = 'Nível de ruído'; 53 $lang['Perturbation'] = 'Perturbação 54 '; 53 $lang['Perturbation'] = 'Perturbação'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Detectamos que a extensão EasyCaptcha está disponível na sua galeria. Ambas as extensões podem ser usadas ao mesmo tempo, mas não deverá em nenhuma circunstância ativar ambas na mesma página ..'; 55 55 56 ?> -
extensions/CryptograPHP/language/ru_RU/plugin.lang.php
r19529 r26041 52 52 $lang['Register form'] = 'Форма регистрации'; 53 53 $lang['Button color'] = 'Цвет кнопки'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Мы обнаружили, что в Вашей галерее также доступен плагин EasyCaptcha. Оба плагина могут быть использованы, но Вы не должны ни при каких обстоятельствах активировать оба этих плагина на одной и той же странице.'; 55 54 56 ?> -
extensions/CryptograPHP/language/sk_SK/plugin.lang.php
r20527 r26041 52 52 $lang['range:'] = 'rozsah:'; 53 53 $lang['Button color'] = 'Farba tlačidla'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Zistili sme, že EasyCaptcha plugin je k dispozícii v galérii. Oba moduly je možné použiť súčasne, ale musia byť za každých okolností aktivované na rovnakej strane.'; 55 54 56 ?> -
extensions/CryptograPHP/language/sv_SE/plugin.lang.php
r24033 r26041 52 52 $lang['Lines density'] = 'Rad-densitet'; 53 53 $lang['Moderate'] = 'Moderera'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Vi upptäckte att EasyCaptcha-pluginet är tillgängligt i ditt galleri. Bägge plugins kan användas parallelt men du borde verkligen inte aktivera bägge på samma sida.'; 55 54 56 ?> -
extensions/CryptograPHP/language/tr_TR/plugin.lang.php
r19453 r26041 52 52 $lang['Picture comments'] = 'Resim yorumları'; 53 53 $lang['Button color'] = 'Buton rengi'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'EasyCaptcha eklentisinin galeriniz için etkin olduğu tespit edildi. Her iki eklenti de aynı anda kullanılabilir fakat hiç bir koşulda aynı sayfada her ikisi de aktif halde olmamalıdır.'; 55 54 56 ?> -
extensions/CryptograPHP/language/uk_UA/plugin.lang.php
r19971 r26041 52 52 $lang['Register form'] = 'Зареєстровано з'; 53 53 $lang['Button color'] = 'Колір кнопки'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Ми виявили, що плаґін EasyCaptcha доступний у вашій галереї. Обидва плаґіна можуть бути використані одночасно, але ви не повинні ні за яких обставин активувати обидва з них на одній і тій же сторінці.'; 55 54 56 ?> -
extensions/CryptograPHP/language/zh_CN/description.txt
r20426 r26041 1 'Crypto Captcha' (原'CryptograPHP')通过在注册、评论界面和'ContactForm'插件中加入验证码的方式限制您相册中的垃圾信息。1 'Crypto Captcha'通过在注册、评论界面和'ContactForm'插件中加入验证码的方式限制您相册中的垃圾信息。 2 2 其工作原理与 P@t 的插件'Captcha'一样,但它采用的是 Securimage generator (www.phpcaptcha.org) 而非 reCAPTCHA (www.google.com/recaptcha)。 3 3 与'Comments on Albums'、'GuestBook'和'Contact Form'插件兼容。 -
extensions/CryptograPHP/language/zh_CN/plugin.lang.php
r20426 r26041 52 52 $lang['Noise level'] = '噪点密度'; 53 53 $lang['Perturbation'] = '扭曲度'; 54 $lang['We detected that EasyCaptcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = '发现 EasyCaptcha 插件已在图库启用,这两个插件可以同时使用,但是绝不可以在相同页面上同时启用这两个插件。'; 55 54 56 ?> -
extensions/CryptograPHP/main.inc.php
r24143 r26041 23 23 } 24 24 25 define d('CRYPTO_ID') or define('CRYPTO_ID',basename(dirname(__FILE__)));26 define('CRYPTO_PATH' , PHPWG_PLUGINS_PATH . CRYPTO_ID . '/');27 define('CRYPTO_ADMIN', get_root_url() . 'admin.php?page=plugin-' . CRYPTO_ID);28 define('CRYPTO_VERSION', 'auto');25 define('CRYPTO_ID', basename(dirname(__FILE__))); 26 define('CRYPTO_PATH' , PHPWG_PLUGINS_PATH . CRYPTO_ID . '/'); 27 define('CRYPTO_ADMIN', get_root_url() . 'admin.php?page=plugin-' . CRYPTO_ID); 28 define('CRYPTO_VERSION', 'auto'); 29 29 30 30 … … 37 37 else 38 38 { 39 add_event_handler('init', 'crypto_document_init'); 40 add_event_handler('loc_end_section_init', 'crypto_section_init', EVENT_HANDLER_PRIORITY_NEUTRAL+30); 39 add_event_handler('loc_end_section_init', 'crypto_document_init', EVENT_HANDLER_PRIORITY_NEUTRAL+30); 41 40 } 42 41 … … 45 44 function crypto_init() 46 45 { 47 global $conf , $pwg_loaded_plugins;46 global $conf; 48 47 49 if ( 50 CRYPTO_VERSION == 'auto' or 51 $pwg_loaded_plugins[CRYPTO_ID]['version'] == 'auto' or 52 version_compare($pwg_loaded_plugins[CRYPTO_ID]['version'], CRYPTO_VERSION, '<') 53 ) 54 { 55 include_once(CRYPTO_PATH . 'include/install.inc.php'); 56 crypto_install(); 57 58 if ( $pwg_loaded_plugins[CRYPTO_ID]['version'] != 'auto' and CRYPTO_VERSION != 'auto' ) 59 { 60 $query = ' 61 UPDATE '. PLUGINS_TABLE .' 62 SET version = "'. CRYPTO_VERSION .'" 63 WHERE id = "'. CRYPTO_ID .'"'; 64 pwg_query($query); 65 66 $pwg_loaded_plugins[CRYPTO_ID]['version'] = CRYPTO_VERSION; 67 68 if (defined('IN_ADMIN')) 69 { 70 $_SESSION['page_infos'][] = 'Crypto Captcha updated to version '. CRYPTO_VERSION; 71 } 72 } 73 } 48 include_once(CRYPTO_PATH . 'maintain.inc.php'); 49 $maintain = new CryptograPHP_maintain(CRYPTO_ID); 50 $maintain->autoUpdate(CRYPTO_VERSION, 'install'); 74 51 52 load_language('plugin.lang', CRYPTO_PATH); 75 53 $conf['cryptographp'] = unserialize($conf['cryptographp']); 76 54 } 77 55 78 56 79 // modules : picture comment & register57 // modules 80 58 function crypto_document_init() 81 59 { 82 60 global $conf, $user; 83 61 84 if (!is_a_guest()) return; 62 if (!is_a_guest()) 63 { 64 return; 65 } 85 66 86 if ( script_basename() == 'register' and $conf['cryptographp']['activate_on']['register'])67 if (script_basename() == 'register' and $conf['cryptographp']['activate_on']['register']) 87 68 { 88 69 $conf['cryptographp']['template'] = 'register'; 89 include(CRYPTO_PATH .'include/register.inc.php');70 include(CRYPTO_PATH . 'include/register.inc.php'); 90 71 } 91 else if ( script_basename() == 'picture' and $conf['cryptographp']['activate_on']['picture'])72 else if (script_basename() == 'picture' and $conf['cryptographp']['activate_on']['picture']) 92 73 { 93 74 $conf['cryptographp']['template'] = 'comment'; 94 include(CRYPTO_PATH .'include/picture.inc.php');75 include(CRYPTO_PATH . 'include/picture.inc.php'); 95 76 } 96 97 } 98 99 // modules : album comment & contact & guestbook 100 function crypto_section_init() 101 { 102 global $conf, $pwg_loaded_plugins, $page, $user; 103 104 if (!is_a_guest()) return; 105 106 if ( 107 script_basename() == 'index' and $conf['cryptographp']['activate_on']['category'] and 108 isset($pwg_loaded_plugins['Comments_on_Albums']) and isset($page['section']) and 109 $page['section'] == 'categories' and isset($page['category']) 110 ) 77 else if (isset($page['section'])) 111 78 { 112 $conf['cryptographp']['template'] = 'comment'; 113 include(CRYPTO_PATH.'include/category.inc.php'); 114 } 115 else if ( isset($page['section']) and $page['section'] == 'contact' and $conf['cryptographp']['activate_on']['contactform'] ) 116 { 117 $conf['cryptographp']['template'] = 'contactform'; 118 include(CRYPTO_PATH.'include/contactform.inc.php'); 119 } 120 else if ( isset($page['section']) and $page['section'] == 'guestbook' and $conf['cryptographp']['activate_on']['guestbook'] ) 121 { 122 $conf['cryptographp']['template'] = 'guestbook'; 123 include(CRYPTO_PATH.'include/guestbook.inc.php'); 79 if ( 80 script_basename() == 'index' && 81 $page['section'] == 'categories' && isset($page['category']) && 82 isset($pwg_loaded_plugins['Comments_on_Albums']) && 83 $conf['cryptographp']['activate_on']['category'] 84 ) 85 { 86 $conf['cryptographp']['template'] = 'comment'; 87 include(CRYPTO_PATH . 'include/category.inc.php'); 88 } 89 else if ($page['section'] == 'contact' && $conf['cryptographp']['activate_on']['contactform']) 90 { 91 $conf['cryptographp']['template'] = 'contactform'; 92 include(CRYPTO_PATH . 'include/contactform.inc.php'); 93 } 94 else if ($page['section'] == 'guestbook' && $conf['cryptographp']['activate_on']['guestbook']) 95 { 96 $conf['cryptographp']['template'] = 'guestbook'; 97 include(CRYPTO_PATH . 'include/guestbook.inc.php'); 98 } 124 99 } 125 100 } … … 129 104 function crypto_plugin_admin_menu($menu) 130 105 { 131 array_push($menu,array(106 $menu[] = array( 132 107 'NAME' => 'Crypto Captcha', 133 108 'URL' => CRYPTO_ADMIN, 134 ) );109 ); 135 110 return $menu; 136 111 } 137 138 ?> -
extensions/CryptograPHP/maintain.inc.php
r20189 r26041 2 2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 defined('CRYPTO_ID') or define('CRYPTO_ID', basename(dirname(__FILE__))); 5 include_once(PHPWG_PLUGINS_PATH . CRYPTO_ID . '/include/install.inc.php'); 4 class CryptograPHP_maintain extends PluginMaintain 5 { 6 private $installed = false; 6 7 7 function plugin_install() 8 { 9 crypto_install(); 10 define('crypto_installed', true); 11 } 8 function install($plugin_version, &$errors=array()) 9 { 10 if (isset($conf['cryptograph_theme'])) 11 { 12 conf_delete_param('cryptograph_theme'); 13 } 14 15 if (empty($conf['cryptographp'])) 16 { 17 $default_config = array( 18 'activate_on' => array( 19 'picture' => true, 20 'category' => true, 21 'register' => true, 22 'contactform' => true, 23 'guestbook' => true, 24 ), 25 'comments_action' => 'reject', 26 'theme' => 'gray', 27 'captcha_type' => 'string', 28 'case_sensitive' => 'false', 29 'code_length' => 6, 30 'width' => 180, 31 'height' => 70, 32 'perturbation' => 1, 33 'image_bg_color' => 'ffffff', 34 'text_color' => '8a8a8a', 35 'num_lines' => 2, 36 'line_color' => '8a8a8a', 37 'noise_level' => 0.1, 38 'noise_color' => '8a8a8a', 39 'ttf_file' => 'TopSecret', 40 'button_color' => 'dark', 41 ); 42 43 $conf['cryptographp'] = serialize($default_config); 44 conf_update_param('cryptographp', $conf['cryptographp']); 45 } 46 else 47 { 48 $old_conf = is_string($conf['cryptographp']) ? unserialize($conf['cryptographp']) : $conf['cryptographp']; 49 50 if (!isset($old_conf['activate_on'])) 51 { 52 $old_conf['activate_on'] = array( 53 'picture' => $old_conf['comments_action'] != 'inactive', 54 'category' => $old_conf['comments_action'] != 'inactive', 55 'register' => true, 56 'contactform' => true, 57 'guestbook' => true, 58 ); 59 } 60 if (!isset($old_conf['button_color'])) 61 { 62 $old_conf['button_color'] = 'dark'; 63 } 64 65 $conf['cryptographp'] = serialize($old_conf); 66 conf_update_param('cryptographp', $conf['cryptographp']); 67 } 12 68 13 function plugin_activate() 14 { 15 if (!defined('crypto_installed')) 69 $this->installed = true; 70 } 71 72 function activate($plugin_version, &$errors=array()) 16 73 { 17 crypto_install(); 74 if (!$this->installed) 75 { 76 $this->install($plugin_version, $errors); 77 } 78 } 79 80 function deactivate() 81 { 82 } 83 84 function uninstall() 85 { 86 conf_delete_param('cryptographp'); 18 87 } 19 88 } 20 21 function plugin_uninstall()22 {23 pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="cryptographp" LIMIT 1');24 }25 26 ?> -
extensions/CryptograPHP/securimage/securimage_preview.php
r19428 r26041 7 7 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 8 8 9 i f (!is_admin())die('Hacking attempt!');9 is_admin() or die('Hacking attempt!'); 10 10 11 11 -
extensions/CryptograPHP/template/admin.tpl
r24143 r26041 1 {combine_css path=$CRYPTO_PATH| @cat:"template/style.css"}2 3 {combine_css path=$CRYPTO_PATH| @cat:"template/colorpicker/colorpicker.css"}4 {combine_script id= "jquery.colorpicker" load="footer" path=$CRYPTO_PATH|@cat:"template/colorpicker/colorpicker.js"}5 6 {combine_css path= "themes/default/js/plugins/chosen.css"}1 {combine_css path=$CRYPTO_PATH|cat:'template/style.css'} 2 3 {combine_css path=$CRYPTO_PATH|cat:'template/colorpicker/colorpicker.css'} 4 {combine_script id='jquery.colorpicker' load='footer' path=$CRYPTO_PATH|cat:'template/colorpicker/colorpicker.js'} 5 6 {combine_css path='themes/default/js/plugins/chosen.css'} 7 7 {combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} 8 8 9 9 10 {footer_script} {literal}10 {footer_script} 11 11 // colorpicker 12 12 $('.colorpicker-input') … … 26 26 } 27 27 }) 28 .bind('keyup', function() {28 .bind('keyup', function() { 29 29 $(this).ColorPickerSetColor(this.value); 30 30 changeColor(this, $(this).val()); … … 39 39 $(this).addClass('selected'); 40 40 $('input[name=button_color]').val($(this).attr('title')); 41 $('#reload').attr('src', '{ /literal}{$CRYPTO_PATH}{literal}template/refresh_'+ $(this).attr('title') +'.png');41 $('#reload').attr('src', '{$CRYPTO_PATH}template/refresh_'+ $(this).attr('title') +'.png'); 42 42 }); 43 43 … … 53 53 } 54 54 55 $('.colorpicker-input').each(function() { changeColor(this, $(this).val()); }); 55 $('.colorpicker-input').each(function() { 56 changeColor(this, $(this).val()); 57 }); 56 58 $('input[name="theme"]').val($(this).attr('title')); 57 59 changePreview(); … … 86 88 // multiselect 87 89 $("select").css({ 88 "width":"700px"90 width: 300 89 91 }).chosen({ 90 92 disable_search:true, … … 96 98 } 97 99 98 function changePreview() 99 { 100 function changePreview() { 100 101 options = new Array(); 101 102 str = ''; … … 108 109 str+= '&' + x + '=' + options[x]; 109 110 } 110 $('#captcha').attr('src', '{ /literal}{$CRYPTO_PATH}{literal}securimage/securimage_preview.php?' + new Date().getTime() + str);111 $('#captcha').attr('src', '{$CRYPTO_PATH}securimage/securimage_preview.php?' + new Date().getTime() + str); 111 112 } 112 113 … … 115 116 if (parseInt(color, 16) > 16777215/2) { 116 117 $(target).css('color', '#222'); 117 } else { 118 } 119 else { 118 120 $(target).css('color', '#ddd'); 119 121 } 120 122 $(target).css('background', '#'+color) 121 123 } 122 {/literal} 123 124 var presets = {ldelim} 124 125 var presets = { 125 126 {foreach from=$PRESETS key=name item=params} 126 "{$name}" : { ldelim}127 "{$name}" : { 127 128 {foreach from=$params key=key item=value} 128 129 "{$key}" : "{$value}", … … 136 137 {html_style} 137 138 {foreach from=$fonts item=font} 138 @font-face { ldelim}139 font-family: {$font};139 @font-face { 140 font-family: '{$font}'; 140 141 src: url({$CRYPTO_PATH}securimage/fonts/{$font}.ttf) format("truetype"); 141 142 } … … 150 151 <form method="post" class="properties"> 151 152 <fieldset> 152 <legend>{'Configuration'| @translate}</legend>153 <legend>{'Configuration'|translate}</legend> 153 154 154 155 <ul> 155 156 <li> 156 <b>{'Activate on'| @translate}</b>157 <b>{'Activate on'|translate}</b> 157 158 <select name="activate_on[]" multiple> 158 <option value="picture" {if $crypto.activate_on.picture}selected{/if}>{'Picture comments'| @translate}</option>159 {if $loaded.category}<option value="category" {if $crypto.activate_on.category}selected{/if}>{'Album comments'| @translate}</option>{/if}160 <option value="register" {if $crypto.activate_on.register}selected{/if}>{'Register form'| @translate}</option>161 {if $loaded.contactform}<option value="contactform" {if $crypto.activate_on.contactform}selected{/if}>{'Contact form'| @translate}</option>{/if}162 {if $loaded.guestbook}<option value="guestbook" {if $crypto.activate_on.guestbook}selected{/if}>{'Guestbook'| @translate}</option>{/if}159 <option value="picture" {if $crypto.activate_on.picture}selected{/if}>{'Picture comments'|translate}</option> 160 {if $loaded.category}<option value="category" {if $crypto.activate_on.category}selected{/if}>{'Album comments'|translate}</option>{/if} 161 <option value="register" {if $crypto.activate_on.register}selected{/if}>{'Register form'|translate}</option> 162 {if $loaded.contactform}<option value="contactform" {if $crypto.activate_on.contactform}selected{/if}>{'Contact form'|translate}</option>{/if} 163 {if $loaded.guestbook}<option value="guestbook" {if $crypto.activate_on.guestbook}selected{/if}>{'Guestbook'|translate}</option>{/if} 163 164 </select> 164 165 </li> 165 166 <li> 166 <b>{'Comments action'| @translate}</b>167 <label><input type="radio" name="comments_action" value="reject" {if $crypto.comments_action == 'reject'}checked="checked"{/if}> {'Reject'| @translate}</label>168 <label><input type="radio" name="comments_action" value="moderate" {if $crypto.comments_action == 'moderate'}checked="checked"{/if}> {'Moderate'| @translate}</label>169 </li> 170 <li> 171 <b>{'Captcha type'| @translate}</b>172 <label><input type="radio" name="captcha_type" class="preview" value="string" {if $crypto.captcha_type == 'string'}checked="checked"{/if}> {'Random string'| @translate}</label>173 <label><input type="radio" name="captcha_type" class="preview" value="math" {if $crypto.captcha_type == 'math'}checked="checked"{/if}> {'Simple equation'| @translate}</label>167 <b>{'Comments action'|translate}</b> 168 <label><input type="radio" name="comments_action" value="reject" {if $crypto.comments_action == 'reject'}checked="checked"{/if}> {'Reject'|translate}</label> 169 <label><input type="radio" name="comments_action" value="moderate" {if $crypto.comments_action == 'moderate'}checked="checked"{/if}> {'Moderate'|translate}</label> 170 </li> 171 <li> 172 <b>{'Captcha type'|translate}</b> 173 <label><input type="radio" name="captcha_type" class="preview" value="string" {if $crypto.captcha_type == 'string'}checked="checked"{/if}> {'Random string'|translate}</label> 174 <label><input type="radio" name="captcha_type" class="preview" value="math" {if $crypto.captcha_type == 'math'}checked="checked"{/if}> {'Simple equation'|translate}</label> 174 175 </li> 175 176 <!--<li> 176 <b>{'Case sensitive'| @translate}</b>177 <label><input type="radio" name="case_sensitive" value="false" {if $crypto.case_sensitive == 'false'}checked="checked"{/if}> {'No'| @translate}</label>178 <label><input type="radio" name="case_sensitive" value="true" {if $crypto.case_sensitive == 'true'}checked="checked"{/if}> {'Yes'| @translate}</label>177 <b>{'Case sensitive'|translate}</b> 178 <label><input type="radio" name="case_sensitive" value="false" {if $crypto.case_sensitive == 'false'}checked="checked"{/if}> {'No'|translate}</label> 179 <label><input type="radio" name="case_sensitive" value="true" {if $crypto.case_sensitive == 'true'}checked="checked"{/if}> {'Yes'|translate}</label> 179 180 </li>--> 180 181 <li> 181 <b>{'Code lenght'| @translate}</b>182 <b>{'Code lenght'|translate}</b> 182 183 <label><input type="text" name="code_length" class="preview" value="{$crypto.code_length}" size="6" maxlength="2"></label> 183 184 </li> 184 185 <li> 185 <b>{'Width'| @translate}</b>186 <label><input type="text" name="width" class="preview" value="{$crypto.width}" size="6" maxlength="3"> {'good value:'| @translate} lenght×30</label>187 </li> 188 <li> 189 <b>{'Height'| @translate}</b>190 <label><input type="text" name="height" class="preview" value="{$crypto.height}" size="6" maxlength="3"> {'good value:'| @translate} lenght×12</label>191 </li> 192 <li> 193 <b>{'Button color'| @translate}</b>186 <b>{'Width'|translate}</b> 187 <label><input type="text" name="width" class="preview" value="{$crypto.width}" size="6" maxlength="3"> {'good value:'|translate} lenght×30</label> 188 </li> 189 <li> 190 <b>{'Height'|translate}</b> 191 <label><input type="text" name="height" class="preview" value="{$crypto.height}" size="6" maxlength="3"> {'good value:'|translate} lenght×12</label> 192 </li> 193 <li> 194 <b>{'Button color'|translate}</b> 194 195 <a class="button {if $crypto.button_color == 'dark'}selected{/if}" title="dark"><img src="{$CRYPTO_PATH}template/refresh_dark.png" alt="dark"></a> 195 196 <a class="button {if $crypto.button_color == 'light'}selected{/if}" title="light"><img src="{$CRYPTO_PATH}template/refresh_light.png" alt="light"></a> … … 197 198 </li> 198 199 <li> 199 <b>{'Captcha theme'| @translate}</b>200 <b>{'Captcha theme'|translate}</b> 200 201 {foreach from=$PRESETS key=preset item=params} 201 202 <a class="preset {if $crypto.theme == $preset}selected{/if}" title="{$preset}"><img src="{$CRYPTO_PATH}template/presets/{$preset}.png" alt="{$preset}"></a> 202 203 {/foreach} 203 204 <input type="hidden" name="theme" value="{$crypto.theme}"> 204 <a class="customize">{'Customize'| @translate}</a>205 <a class="customize">{'Customize'|translate}</a> 205 206 </li> 206 207 </ul> 207 208 208 209 <fieldset {if $crypto.theme != 'custom'}style="display:none;"{/if} id="theming"> 209 <legend>{'Customize'| @translate}</legend>210 <legend>{'Customize'|translate}</legend> 210 211 211 212 <ul> 212 213 <li> 213 <b>{'Perturbation'| @translate}</b>214 <label><input type="text" name="perturbation" value="{$crypto.perturbation}" class="istheme" size="6" maxlength="4"> {'range:'| @translate} 0 - 1</label>215 </li> 216 <li> 217 <b>{'Background color'| @translate}</b>214 <b>{'Perturbation'|translate}</b> 215 <label><input type="text" name="perturbation" value="{$crypto.perturbation}" class="istheme" size="6" maxlength="4"> {'range:'|translate} 0 - 1</label> 216 </li> 217 <li> 218 <b>{'Background color'|translate}</b> 218 219 <label><input type="text" name="image_bg_color" value="{$crypto.image_bg_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> 219 <a class="random" title="{'random'| @translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a>220 </li> 221 <li> 222 <b>{'Text color'| @translate}</b>220 <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> 221 </li> 222 <li> 223 <b>{'Text color'|translate}</b> 223 224 <label><input type="text" name="text_color" value="{$crypto.text_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> 224 <a class="random" title="{'random'| @translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a>225 </li> 226 <li> 227 <b>{'Lines density'| @translate}</b>228 <label><input type="text" name="num_lines" value="{$crypto.num_lines}" class="istheme" size="6" maxlength="4"> {'range:'| @translate} 0 - 10</label>229 </li> 230 <li> 231 <b>{'Lines color'| @translate}</b>225 <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> 226 </li> 227 <li> 228 <b>{'Lines density'|translate}</b> 229 <label><input type="text" name="num_lines" value="{$crypto.num_lines}" class="istheme" size="6" maxlength="4"> {'range:'|translate} 0 - 10</label> 230 </li> 231 <li> 232 <b>{'Lines color'|translate}</b> 232 233 <label><input type="text" name="line_color" value="{$crypto.line_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> 233 <a class="random" title="{'random'| @translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a>234 </li> 235 <li> 236 <b>{'Noise level'| @translate}</b>237 <label><input type="text" name="noise_level" value="{$crypto.noise_level}" class="istheme" size="6" maxlength="4"> {'range:'| @translate} 0 - 10</label>238 </li> 239 <li> 240 <b>{'Noise color'| @translate}</b>234 <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> 235 </li> 236 <li> 237 <b>{'Noise level'|translate}</b> 238 <label><input type="text" name="noise_level" value="{$crypto.noise_level}" class="istheme" size="6" maxlength="4"> {'range:'|translate} 0 - 10</label> 239 </li> 240 <li> 241 <b>{'Noise color'|translate}</b> 241 242 <label><input type="text" name="noise_color" value="{$crypto.noise_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> 242 <a class="random" title="{'random'| @translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a>243 </li> 244 <li> 245 <b>{'Font'| @translate}</b>243 <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> 244 </li> 245 <li> 246 <b>{'Font'|translate}</b> 246 247 {foreach from=$fonts item=font} 247 248 <label style="font-family:{$font};" title="{$font}"><input type="radio" name="ttf_file" value="{$font}" {if $crypto.ttf_file == $font}checked="checked"{/if} class="istheme"> {$font}</label> … … 250 251 </ul> 251 252 252 {'Tip: type "random" on a color field to have a random color'| @translate}253 {'Tip: type "random" on a color field to have a random color'|translate} 253 254 </fieldset> 254 255 255 256 <ul style="margin-top:30px;"> 256 257 <li> 257 <b>{'Preview'| @translate}</b>258 <b>{'Preview'|translate}</b> 258 259 <img id="captcha" src="{$CRYPTO_PATH}securimage/securimage_show.php" alt="CAPTCHA Image"> 259 260 <a href="#" onClick="return false;"><img id="reload" src="{$CRYPTO_PATH}template/refresh_{$crypto.button_color}.png"></a> … … 263 264 </fieldset> 264 265 265 <p class="formButtons"><input class="submit" type="submit" value="{'Submit'| @translate}" name="submit"></p>266 <p class="formButtons"><input class="submit" type="submit" value="{'Submit'|translate}" name="submit"></p> 266 267 </form> 267 268 -
extensions/CryptograPHP/template/comment.tpl
r20189 r26041 1 <p><label>{if $CRYPTO.captcha_type=='string'}{'Enter code'| @translate}{else}{'Solve equation'|@translate}{/if} :</label></p>1 <p><label>{if $CRYPTO.captcha_type=='string'}{'Enter code'|translate}{else}{'Solve equation'|translate}{/if} :</label></p> 2 2 <p> 3 3 <img id="captcha" src="{$CRYPTO_PATH}securimage/securimage_show.php" alt="CAPTCHA Image"> -
extensions/CryptograPHP/template/contactform.tpl
r20189 r26041 2 2 <tr> 3 3 <td class="title"> 4 {if $CRYPTO.captcha_type=='string'}{'Enter code'| @translate}{else}{'Solve equation'|@translate}{/if}4 {if $CRYPTO.captcha_type=='string'}{'Enter code'|translate}{else}{'Solve equation'|translate}{/if} 5 5 </td> 6 6 <td> … … 13 13 {footer_script} 14 14 var captcha_code = new LiveValidation("captcha_code", {ldelim} onlyOnSubmit: true, insertAfterWhatNode: "captcha_refresh" }); 15 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'| @translate}" });15 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'|translate}" }); 16 16 {/footer_script} -
extensions/CryptograPHP/template/guestbook.tpl
r20189 r26041 3 3 <tr> 4 4 <td> 5 <label for="captcha">{if $CRYPTO.captcha_type=='string'}{'Enter code'| @translate}{else}{'Solve equation'|@translate}{/if}</label>5 <label for="captcha">{if $CRYPTO.captcha_type=='string'}{'Enter code'|translate}{else}{'Solve equation'|translate}{/if}</label> 6 6 <input type="text" name="captcha_code" id="captcha_code" style="width:{$CRYPTO.code_length}em" maxlength="{$CRYPTO.code_length}" /> 7 7 </td> … … 13 13 {footer_script} 14 14 var captcha_code = new LiveValidation("captcha_code", {ldelim} onlyOnSubmit: true }); 15 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'| @translate}" });15 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'|translate}" }); 16 16 {/footer_script} -
extensions/CryptograPHP/template/register.tpl
r20189 r26041 2 2 <li> 3 3 <span class="property"> 4 <label for="captcha_code">{if $CRYPTO.captcha_type=='string'}{'Enter code'| @translate}{else}{'Solve equation'|@translate}{/if} </label>4 <label for="captcha_code">{if $CRYPTO.captcha_type=='string'}{'Enter code'|translate}{else}{'Solve equation'|translate}{/if} </label> 5 5 </span> 6 6 <input type="text" id="captcha_code" name="captcha_code" style="width:{$CRYPTO.code_length}em;" maxlength="{$CRYPTO.code_length}" />
Note: See TracChangeset
for help on using the changeset viewer.