Changeset 26041


Ignore:
Timestamp:
Dec 19, 2013, 3:24:59 PM (10 years ago)
Author:
mistic100
Message:

update for 2.6

Location:
extensions/CryptograPHP
Files:
1 deleted
35 edited

Legend:

Unmodified
Added
Removed
  • extensions/CryptograPHP/admin.php

    r23209 r26041  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('CRYPTO_ID') or die('Hacking attempt!');
    33
    44global $pwg_loaded_plugins;
     
    77  'category' => isset($pwg_loaded_plugins['Comments_on_Albums']),
    88  'guestbook' => isset($pwg_loaded_plugins['GuestBook']),
     9  'easycaptcha' => isset($pwg_loaded_plugins['EasyCaptcha']),
    910  );
    1011
    11 
    12 load_language('plugin.lang', CRYPTO_PATH);
    13 
     12if ($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}
    1416
    1517if ( isset($_POST['submit']))
    16 
     18{
     19  if (!isset($_POST['activate_on'])) $_POST['activate_on'] = array();
     20 
    1721  $conf['cryptographp'] = array(
    1822    'activate_on'     => array(
    19           'picture'     => in_array('picture', $_POST['activate_on']),
    20           'category'    => in_array('category', $_POST['activate_on']) || !$loaded['category'],
    21           'register'    => in_array('register', $_POST['activate_on']),
    22           'contactform' => in_array('contactform', $_POST['activate_on']) || !$loaded['contactform'],
    23           'guestbook'   => in_array('guestbook', $_POST['activate_on']) || !$loaded['guestbook'],
    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      ),
    2529    'comments_action' => $_POST['comments_action'],
    2630    'theme'           => $_POST['theme'],
     
    4246 
    4347  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');
    4549}
    4650
     
    7882$template->set_filename('plugin_admin_content', dirname(__FILE__).'/template/admin.tpl');
    7983$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    80 
    81 ?>
  • extensions/CryptograPHP/include/category.inc.php

    r19428 r26041  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('CRYPTO_ID') or die('Hacking attempt!');
    33
    44include(CRYPTO_PATH.'include/common.inc.php');
     
    2929  if ($securimage->check($_POST['captcha_code']) == false)
    3030  {
    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');
    3232    return ($action != 'reject') ? $conf['cryptographp']['comments_action'] : 'reject';
    3333  }
     
    3535  return $action;
    3636}
    37 
    38 ?>
  • extensions/CryptograPHP/include/common.inc.php

    r20189 r26041  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('CRYPTO_ID') or die('Hacking attempt!');
    33
    44global $template;
     
    1818$template->set_filename('cryptographp', realpath(CRYPTO_PATH.'template/'.$conf['cryptographp']['template'].'.tpl'));
    1919$template->assign_var_from_handle('CRYPTOGRAPHP', 'cryptographp');
    20 
    21 ?>
  • extensions/CryptograPHP/include/contactform.inc.php

    r19428 r26041  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('CRYPTO_ID') or die('Hacking attempt!');
    33
    44include(CRYPTO_PATH.'include/common.inc.php');
     
    2929  if ($securimage->check($_POST['captcha_code']) == false)
    3030  {
    31     array_push($page['errors'], l10n('Invalid Captcha'));
     31    $page['errors'][] = l10n('Invalid Captcha');
    3232    return 'reject';
    3333  }
     
    3535  return $action;
    3636}
    37 
    38 ?>
  • extensions/CryptograPHP/include/guestbook.inc.php

    r20189 r26041  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('CRYPTO_ID') or die('Hacking attempt!');
    33
    44include(CRYPTO_PATH.'include/common.inc.php');
     
    2929  if ($securimage->check($_POST['captcha_code']) == false)
    3030  {
    31     array_push($page['errors'], l10n('Invalid Captcha'));
     31    $page['errors'][] = l10n('Invalid Captcha');
    3232    return 'reject';
    3333  }
     
    3535  return $action;
    3636}
    37 
    38 ?>
  • extensions/CryptograPHP/include/picture.inc.php

    r19428 r26041  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('CRYPTO_ID') or die('Hacking attempt!');
    33
    44include(CRYPTO_PATH.'include/common.inc.php');
     
    2929  if ($securimage->check($_POST['captcha_code']) == false)
    3030  {
    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');
    3232    return ($action != 'reject') ? $conf['cryptographp']['comments_action'] : 'reject';
    3333  }
     
    3535  return $action;
    3636}
    37 
    38 ?>
  • extensions/CryptograPHP/include/register.inc.php

    r19428 r26041  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('CRYPTO_ID') or die('Hacking attempt!');
    33
    44include(CRYPTO_PATH.'include/common.inc.php');
     
    2626  if ($securimage->check($_POST['captcha_code']) == false)
    2727  {
    28     array_push($errors, l10n('Invalid Captcha'));
     28    $errors[] = l10n('Invalid Captcha');
    2929  }
    3030
    3131  return $errors;
    3232}
    33 
    34 ?>
  • extensions/CryptograPHP/language/cs_CZ/plugin.lang.php

    r20889 r26041  
    3333$lang['Register form'] = 'Registrační formulář';
    3434$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
    3537?>
  • extensions/CryptograPHP/language/da_DK/plugin.lang.php

    r19430 r26041  
    5252$lang['Picture comments'] = 'Billedkommentarer';
    5353$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
    5456?>
  • extensions/CryptograPHP/language/de_DE/plugin.lang.php

    r24143 r26041  
    5252$lang['Register form'] = 'Registrierungs-Formular ';
    5353$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
    5456?>
  • extensions/CryptograPHP/language/el_GR/plugin.lang.php

    r24143 r26041  
    3333$lang['Register form'] = 'Φόρμα Εγγραφής';
    3434$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
    3537?>
  • extensions/CryptograPHP/language/en_UK/plugin.lang.php

    r20428 r26041  
    3434$lang['Preview'] = 'Preview';
    3535$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.';
    3637
    3738?>
  • extensions/CryptograPHP/language/es_ES/plugin.lang.php

    r19505 r26041  
    3333$lang['Register form'] = 'Formulario de registro';
    3434$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
    3537?>
  • extensions/CryptograPHP/language/fr_FR/plugin.lang.php

    r19428 r26041  
    3434$lang['Preview'] = 'Prévisualisation';
    3535$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.';
    3637
    3738?>
  • extensions/CryptograPHP/language/it_IT/plugin.lang.php

    r19445 r26041  
    3333$lang['Register form'] = 'Modulo registrazione';
    3434$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
    3537?>
  • extensions/CryptograPHP/language/lv_LV/plugin.lang.php

    r19853 r26041  
    3333$lang['Register form'] = 'Reģistra forma';
    3434$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
    3537?>
  • extensions/CryptograPHP/language/nl_NL/plugin.lang.php

    r20006 r26041  
    5252$lang['Invalid Captcha'] = 'Ongeldige Captcha';
    5353$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
    5456?>
  • extensions/CryptograPHP/language/pl_PL/plugin.lang.php

    r20694 r26041  
    3333$lang['Register form'] = 'Formularz rejestracyjny';
    3434$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
    3537?>
  • extensions/CryptograPHP/language/pt_BR/plugin.lang.php

    r24143 r26041  
    5252$lang['Noise level'] = 'Nível barulhento';
    5353$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
    5456?>
  • extensions/CryptograPHP/language/pt_PT/plugin.lang.php

    r24143 r26041  
    5151$lang['Noise color'] = 'Cor do ruído ';
    5252$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
    5556?>
  • extensions/CryptograPHP/language/ru_RU/plugin.lang.php

    r19529 r26041  
    5252$lang['Register form'] = 'Форма регистрации';
    5353$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
    5456?>
  • extensions/CryptograPHP/language/sk_SK/plugin.lang.php

    r20527 r26041  
    5252$lang['range:'] = 'rozsah:';
    5353$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
    5456?>
  • extensions/CryptograPHP/language/sv_SE/plugin.lang.php

    r24033 r26041  
    5252$lang['Lines density'] = 'Rad-densitet';
    5353$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
    5456?>
  • extensions/CryptograPHP/language/tr_TR/plugin.lang.php

    r19453 r26041  
    5252$lang['Picture comments'] = 'Resim yorumları';
    5353$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
    5456?>
  • extensions/CryptograPHP/language/uk_UA/plugin.lang.php

    r19971 r26041  
    5252$lang['Register form'] = 'Зареєстровано з';
    5353$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
    5456?>
  • extensions/CryptograPHP/language/zh_CN/description.txt

    r20426 r26041  
    1 'Crypto Captcha'(原'CryptograPHP')通过在注册、评论界面和'ContactForm'插件中加入验证码的方式限制您相册中的垃圾信息。
     1'Crypto Captcha'通过在注册、评论界面和'ContactForm'插件中加入验证码的方式限制您相册中的垃圾信息。
    22其工作原理与 P@t 的插件'Captcha'一样,但它采用的是 Securimage generator (www.phpcaptcha.org) 而非 reCAPTCHA (www.google.com/recaptcha)。
    33与'Comments on Albums'、'GuestBook'和'Contact Form'插件兼容。
  • extensions/CryptograPHP/language/zh_CN/plugin.lang.php

    r20426 r26041  
    5252$lang['Noise level'] = '噪点密度';
    5353$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
    5456?>
  • extensions/CryptograPHP/main.inc.php

    r24143 r26041  
    2323}
    2424
    25 defined('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');
     25define('CRYPTO_ID',      basename(dirname(__FILE__)));
     26define('CRYPTO_PATH' ,    PHPWG_PLUGINS_PATH . CRYPTO_ID . '/');
     27define('CRYPTO_ADMIN',    get_root_url() . 'admin.php?page=plugin-' . CRYPTO_ID);
     28define('CRYPTO_VERSION',  'auto');
    2929
    3030
     
    3737else
    3838{
    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);
    4140}
    4241
     
    4544function crypto_init()
    4645{
    47   global $conf, $pwg_loaded_plugins;
     46  global $conf;
    4847 
    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');
    7451 
     52  load_language('plugin.lang', CRYPTO_PATH);
    7553  $conf['cryptographp'] = unserialize($conf['cryptographp']);
    7654}
    7755
    7856
    79 // modules : picture comment & register
     57// modules
    8058function crypto_document_init()
    8159{
    8260  global $conf, $user;
    8361 
    84   if (!is_a_guest()) return;
     62  if (!is_a_guest())
     63  {
     64    return;
     65  }
    8566 
    86   if ( script_basename() == 'register' and $conf['cryptographp']['activate_on']['register'] )
     67  if (script_basename() == 'register' and $conf['cryptographp']['activate_on']['register'])
    8768  {
    8869    $conf['cryptographp']['template'] = 'register';
    89     include(CRYPTO_PATH.'include/register.inc.php');
     70    include(CRYPTO_PATH . 'include/register.inc.php');
    9071  }
    91   else if ( script_basename() == 'picture' and $conf['cryptographp']['activate_on']['picture'] )
     72  else if (script_basename() == 'picture' and $conf['cryptographp']['activate_on']['picture'])
    9273  {
    9374    $conf['cryptographp']['template'] = 'comment';
    94     include(CRYPTO_PATH.'include/picture.inc.php');
     75    include(CRYPTO_PATH . 'include/picture.inc.php');
    9576  }
    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']))
    11178  {
    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    }
    12499  }
    125100}
     
    129104function crypto_plugin_admin_menu($menu)
    130105{
    131   array_push($menu, array(
     106  $menu[] = array(
    132107    'NAME' => 'Crypto Captcha',
    133108    'URL' => CRYPTO_ADMIN,
    134     ));
     109    );
    135110  return $menu;
    136111}
    137 
    138 ?>
  • extensions/CryptograPHP/maintain.inc.php

    r20189 r26041  
    22defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    33
    4 defined('CRYPTO_ID') or define('CRYPTO_ID', basename(dirname(__FILE__)));
    5 include_once(PHPWG_PLUGINS_PATH . CRYPTO_ID . '/include/install.inc.php');
     4class CryptograPHP_maintain extends PluginMaintain
     5{
     6  private $installed = false;
    67
    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    }
    1268
    13 function plugin_activate()
    14 {
    15   if (!defined('crypto_installed'))
     69    $this->installed = true;
     70  }
     71
     72  function activate($plugin_version, &$errors=array())
    1673  {
    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');
    1887  }
    1988}
    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  
    77include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
    88
    9 if (!is_admin()) die('Hacking attempt!');
     9is_admin() or die('Hacking attempt!');
    1010
    1111
  • 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'}
    77{combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'}
    88
    99
    10 {footer_script}{literal}
     10{footer_script}
    1111// colorpicker
    1212$('.colorpicker-input')
     
    2626    }
    2727  })
    28   .bind('keyup', function(){
     28  .bind('keyup', function() {
    2929    $(this).ColorPickerSetColor(this.value);
    3030    changeColor(this, $(this).val());
     
    3939  $(this).addClass('selected');
    4040  $('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');
    4242});
    4343
     
    5353  }
    5454 
    55   $('.colorpicker-input').each(function() { changeColor(this, $(this).val()); });
     55  $('.colorpicker-input').each(function() {
     56    changeColor(this, $(this).val());
     57  });
    5658  $('input[name="theme"]').val($(this).attr('title'));
    5759  changePreview();
     
    8688// multiselect
    8789$("select").css({
    88   "width":"700px"
     90  width: 300
    8991}).chosen({
    9092  disable_search:true,
     
    9698}
    9799
    98 function changePreview()
    99 {
     100function changePreview() {
    100101  options = new Array();
    101102  str = '';
     
    108109    str+= '&' + x + '=' + options[x];
    109110  }
    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);
    111112}
    112113
     
    115116  if (parseInt(color, 16) > 16777215/2) {
    116117    $(target).css('color', '#222');
    117   } else {
     118  }
     119  else {
    118120    $(target).css('color', '#ddd');
    119121  }
    120122  $(target).css('background', '#'+color)
    121123}
    122 {/literal}
    123 
    124 var presets = {ldelim}
     124
     125var presets = {
    125126{foreach from=$PRESETS key=name item=params}
    126   "{$name}" : {ldelim}
     127  "{$name}" : {
    127128  {foreach from=$params key=key item=value}
    128129    "{$key}" : "{$value}",
     
    136137{html_style}
    137138{foreach from=$fonts item=font}
    138 @font-face {ldelim} 
    139   font-family: {$font}
     139@font-face { 
     140  font-family: '{$font}'
    140141  src: url({$CRYPTO_PATH}securimage/fonts/{$font}.ttf) format("truetype"); 
    141142}
     
    150151<form method="post" class="properties">
    151152<fieldset>
    152   <legend>{'Configuration'|@translate}</legend>
     153  <legend>{'Configuration'|translate}</legend>
    153154 
    154155  <ul>
    155156    <li>
    156       <b>{'Activate on'|@translate}</b>
     157      <b>{'Activate on'|translate}</b>
    157158      <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}
    163164      </select>
    164165    </li>
    165166    <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>
    174175    </li>
    175176    <!--<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>
    179180    </li>-->
    180181    <li>
    181       <b>{'Code lenght'|@translate}</b>
     182      <b>{'Code lenght'|translate}</b>
    182183      <label><input type="text" name="code_length" class="preview" value="{$crypto.code_length}" size="6" maxlength="2"></label>
    183184    </li>
    184185    <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&times;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&times;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&times;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&times;12</label>
     192    </li>
     193    <li>
     194      <b>{'Button color'|translate}</b>
    194195      <a class="button {if $crypto.button_color == 'dark'}selected{/if}" title="dark"><img src="{$CRYPTO_PATH}template/refresh_dark.png" alt="dark"></a>
    195196      <a class="button {if $crypto.button_color == 'light'}selected{/if}" title="light"><img src="{$CRYPTO_PATH}template/refresh_light.png" alt="light"></a>
     
    197198    </li>
    198199    <li>
    199       <b>{'Captcha theme'|@translate}</b>
     200      <b>{'Captcha theme'|translate}</b>
    200201      {foreach from=$PRESETS key=preset item=params}
    201202      <a class="preset {if $crypto.theme == $preset}selected{/if}" title="{$preset}"><img src="{$CRYPTO_PATH}template/presets/{$preset}.png" alt="{$preset}"></a>
    202203      {/foreach}
    203204      <input type="hidden" name="theme" value="{$crypto.theme}">
    204       <a class="customize">{'Customize'|@translate}</a>
     205      <a class="customize">{'Customize'|translate}</a>
    205206    </li>
    206207  </ul>
    207208 
    208209  <fieldset {if $crypto.theme != 'custom'}style="display:none;"{/if} id="theming">
    209     <legend>{'Customize'|@translate}</legend>
     210    <legend>{'Customize'|translate}</legend>
    210211   
    211212    <ul>
    212213      <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>
    218219        <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>
    223224        <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>
    232233        <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>
    241242        <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>
    246247        {foreach from=$fonts item=font}
    247248        <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>
     
    250251    </ul>
    251252   
    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}
    253254  </fieldset>
    254255 
    255256  <ul style="margin-top:30px;">
    256257    <li>
    257       <b>{'Preview'|@translate}</b>
     258      <b>{'Preview'|translate}</b>
    258259      <img id="captcha" src="{$CRYPTO_PATH}securimage/securimage_show.php" alt="CAPTCHA Image">
    259260      <a href="#" onClick="return false;"><img id="reload" src="{$CRYPTO_PATH}template/refresh_{$crypto.button_color}.png"></a>
     
    263264</fieldset>
    264265
    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>
    266267</form>
    267268
  • 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>
    22<p>
    33  <img id="captcha" src="{$CRYPTO_PATH}securimage/securimage_show.php" alt="CAPTCHA Image">
  • extensions/CryptograPHP/template/contactform.tpl

    r20189 r26041  
    22<tr>
    33  <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}
    55  </td>
    66  <td>
     
    1313{footer_script}
    1414var captcha_code = new LiveValidation("captcha_code", {ldelim} onlyOnSubmit: true, insertAfterWhatNode: "captcha_refresh" });
    15 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'|@translate}" });
     15captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'|translate}" });
    1616{/footer_script}
  • extensions/CryptograPHP/template/guestbook.tpl

    r20189 r26041  
    33<tr>
    44  <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>
    66    <input type="text" name="captcha_code" id="captcha_code" style="width:{$CRYPTO.code_length}em" maxlength="{$CRYPTO.code_length}" />
    77  </td>
     
    1313{footer_script}
    1414var captcha_code = new LiveValidation("captcha_code", {ldelim} onlyOnSubmit: true });
    15 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'|@translate}" });
     15captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'|translate}" });
    1616{/footer_script}
  • extensions/CryptograPHP/template/register.tpl

    r20189 r26041  
    22<li>
    33  <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>
    55  </span>
    66  <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.