source: extensions/Register_FluxBB/main.inc.php @ 22204

Revision 22204, 2.4 KB checked in by Eric, 7 years ago (diff)

Version 2.5.9:
Bug fixed : Adding accounts from FluxBB to Piwigo was not working
Rewrite plugin admin panel URL

  • Property svn:eol-style set to LF
Line 
1<?php
2/*
3Plugin Name: Register FluxBB
4Version: auto
5Description: Link user registration from Piwigo to FluxBB forum (registration, password changing, deletion)
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=252
7Author: Eric
8Author URI: http://www.infernoweb.net
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13// +-----------------------------------------------------------------------+
14// | Define plugin constants                                               |
15// +-----------------------------------------------------------------------+
16
17defined('REGFLUXBB_ID') or define('REGFLUXBB_ID', basename(dirname(__FILE__)));
18define('REGFLUXBB_PATH' ,   PHPWG_PLUGINS_PATH . REGFLUXBB_ID . '/');
19define('REGFLUXBB_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . REGFLUXBB_ID);
20
21include_once (REGFLUXBB_PATH.'include/constants.php');
22include_once (REGFLUXBB_PATH.'include/functions.inc.php');
23
24load_language('plugin.lang', REGFLUXBB_PATH);
25
26// admin plugins menu link
27add_event_handler('get_admin_plugin_menu_links', 'Register_FluxBB_admin_menu');
28
29/**
30 * admin plugins menu link
31 */
32function 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 */
47if (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', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
50}
51
52
53// Check users registration
54if (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 */
61add_event_handler('delete_user', 'Register_FluxBB_Deluser');
62
63// Redirection to profile page
64// ---------------------------
65add_event_handler('login_success', 'Register_FluxBB_Login');
66
67/* Profile management */
68if (script_basename() == 'profile')
69{
70  add_event_handler('loc_begin_profile', 'Register_FluxBB_InitProfile', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
71}
72
73/* Password forget */
74add_event_handler('loc_begin_password', 'Register_FluxBB_PasswReset');
75
76/* Access validation in FluxBB when validated in Piwigo through UAM plugin */
77add_event_handler('login_success', 'UAM_Bridge', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
78
79?>
Note: See TracBrowser for help on using the repository browser.