1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Register PunBB |
---|
4 | Version: 1.3a |
---|
5 | Description: Ce plugin permet d'enregistrer automatiquement un utilisateur de PWG dans un forum PunBB. Rendez-vous dans le panneau d'administration du plugin pour finaliser les paramètres - This plugin allows to automatically register a PWG user in a PunBB forum. Go to plugin administration panel to finalize the settings. Based on original Mod by Flipflip. |
---|
6 | Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=126 |
---|
7 | Author: Eric |
---|
8 | Author URI: http://www.infernoweb.net |
---|
9 | */ |
---|
10 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
11 | |
---|
12 | /* ******************* */ |
---|
13 | /* Class of the plugin */ |
---|
14 | /* ******************* */ |
---|
15 | class Register_PunBB |
---|
16 | { |
---|
17 | /* Set the administration panel of the plugin */ |
---|
18 | function plugin_admin_menu($menu) |
---|
19 | { |
---|
20 | array_push($menu, |
---|
21 | array( |
---|
22 | 'NAME' => 'Register PunBB', |
---|
23 | 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/reg_punbb_admin.php') |
---|
24 | ) |
---|
25 | ); |
---|
26 | return $menu; |
---|
27 | } |
---|
28 | |
---|
29 | /* User adding */ |
---|
30 | function PunBB_Adduser($register_user) |
---|
31 | { |
---|
32 | include_once (PHPWG_ROOT_PATH.'/include/constants.php'); |
---|
33 | include_once (dirname(__FILE__).'/include/constants.php'); |
---|
34 | global $conf; |
---|
35 | load_conf_from_db('param like \'punbb\\_%\''); |
---|
36 | if ($conf['punbb_status']) |
---|
37 | include (dirname(__FILE__).'/reg_punbb_adduser.php'); |
---|
38 | } |
---|
39 | |
---|
40 | /* User deletion */ |
---|
41 | function PunBB_Deluser($user_id) |
---|
42 | { |
---|
43 | include_once (PHPWG_ROOT_PATH.'/include/constants.php'); |
---|
44 | include_once (dirname(__FILE__).'/include/constants.php'); |
---|
45 | global $conf; |
---|
46 | load_conf_from_db('param like \'punbb\\_%\''); |
---|
47 | if ($conf['punbb_status']) |
---|
48 | include (dirname(__FILE__).'/reg_punbb_deluser.php'); |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | $obj = new Register_PunBB(); /* class loading */ |
---|
53 | |
---|
54 | add_event_handler( 'register_user', array(&$obj, 'PunBB_Adduser') ); |
---|
55 | add_event_handler( 'delete_user', array(&$obj, 'PunBB_Deluser') ); |
---|
56 | add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') ); |
---|
57 | set_plugin_data($plugin['id'], $obj); |
---|
58 | ?> |
---|