source: extensions/CryptograPHP/main.inc.php @ 12617

Last change on this file since 12617 was 12617, checked in by mistic100, 9 years ago

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

File size: 1.9 KB
Line 
1<?php
2/*
3Plugin Name: Crypto Captcha
4Version: auto
5Description: Add a captcha to register, comment and ContactForm pages (thanks to P@t)
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=535
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11## TODO : add customization of background image
12
13/*
14Author note :
15Le plugin était appellé à l'origine CryptograPHP et utilisait la librairie CryptograPHP
16Puis il a été renommé Crypto Captcha pour plus de clareté
17La version actuelle s'appelle toujours Crypto Captcha mais utilise la librairie Securimage
18*/
19
20if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
21define('CRYPTO_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
22
23add_event_handler('loc_end_section_init', 'crypto_init');
24
25function crypto_init()
26{
27  global $conf, $pwg_loaded_plugins, $page;
28 
29  $conf['cryptographp'] = unserialize($conf['cryptographp']);
30  load_language('plugin.lang', CRYPTO_PATH);
31 
32  if (script_basename() == 'register')
33  {
34    include(CRYPTO_PATH.'include/register.inc.php');
35  }
36  else if (script_basename() == 'picture' and $conf['cryptographp']['comments_action'] != 'inactive')
37  {
38    include(CRYPTO_PATH.'include/picture.inc.php');
39  }
40  else if (isset($_GET['/contact'])) 
41  {
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');
51  }
52}
53
54if (script_basename() == 'admin')
55{
56  add_event_handler('get_admin_plugin_menu_links', 'crypto_plugin_admin_menu');
57
58  function crypto_plugin_admin_menu($menu)
59  {
60    array_push($menu, array(
61      'NAME' => 'Crypto Captcha',
62      'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))
63      ));
64    return $menu;
65  }
66}
67
68?>
Note: See TracBrowser for help on using the repository browser.