1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Register FluxBB |
---|
4 | Version: auto |
---|
5 | Description: Link user registration from Piwigo to FluxBB forum (registration, password changing, deletion) |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=252 |
---|
7 | Author: Eric |
---|
8 | Author URI: http://www.infernoweb.net |
---|
9 | */ |
---|
10 | |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | |
---|
13 | // +-----------------------------------------------------------------------+ |
---|
14 | // | Define plugin constants | |
---|
15 | // +-----------------------------------------------------------------------+ |
---|
16 | |
---|
17 | defined('REGFLUXBB_ID') or define('REGFLUXBB_ID', basename(dirname(__FILE__))); |
---|
18 | define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH . REGFLUXBB_ID . '/'); |
---|
19 | define('REGFLUXBB_ADMIN', get_root_url() . 'admin.php?page=plugin-' . REGFLUXBB_ID); |
---|
20 | |
---|
21 | include_once (REGFLUXBB_PATH.'include/constants.php'); |
---|
22 | include_once (REGFLUXBB_PATH.'include/functions.inc.php'); |
---|
23 | |
---|
24 | load_language('plugin.lang', REGFLUXBB_PATH); |
---|
25 | |
---|
26 | /* plugin administration */ |
---|
27 | add_event_handler('get_admin_plugin_menu_links', 'Register_FluxBB_admin_menu'); |
---|
28 | |
---|
29 | /** |
---|
30 | * admin plugins menu link |
---|
31 | */ |
---|
32 | function Register_FluxBB_admin_menu($menu) |
---|
33 | { |
---|
34 | array_push( |
---|
35 | $menu, |
---|
36 | array( |
---|
37 | 'NAME' => 'Register FluxBB', |
---|
38 | 'URL' => REGFLUXBB_ADMIN, |
---|
39 | ) |
---|
40 | ); |
---|
41 | |
---|
42 | return $menu; |
---|
43 | } |
---|
44 | |
---|
45 | |
---|
46 | /* user creation */ |
---|
47 | if (strpos(@$_GET['page'],'Register_FluxBB') === false) // Exclude user creation from plugin panel to make FluxBB2Piwigo synch available |
---|
48 | { |
---|
49 | add_event_handler('register_user', 'Register_FluxBB_Adduser'); |
---|
50 | } |
---|
51 | |
---|
52 | |
---|
53 | // Check users registration |
---|
54 | if (strpos(@$_GET['page'],'Register_FluxBB') === false) // Exclude user creation from plugin panel to make FluxBB2Piwigo synch available |
---|
55 | { |
---|
56 | add_event_handler('register_user_check', 'Register_FluxBB_RegistrationCheck', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
57 | } |
---|
58 | |
---|
59 | |
---|
60 | /* user deletion */ |
---|
61 | add_event_handler('delete_user', 'Register_FluxBB_Deluser'); |
---|
62 | |
---|
63 | // Redirection to profile page |
---|
64 | // --------------------------- |
---|
65 | add_event_handler('login_success', 'Register_FluxBB_Login'); |
---|
66 | |
---|
67 | /* Profile management */ |
---|
68 | if (script_basename() == 'profile') |
---|
69 | { |
---|
70 | add_event_handler('loc_begin_profile', 'Register_FluxBB_InitProfile', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
71 | } |
---|
72 | |
---|
73 | /* Password forget */ |
---|
74 | add_event_handler('loc_begin_password', 'Register_FluxBB_PasswReset'); |
---|
75 | |
---|
76 | /* Access validation in FluxBB when validated in Piwigo through UAM plugin */ |
---|
77 | add_event_handler('login_success', 'UAM_Bridge', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
78 | |
---|
79 | ?> |
---|