[17457] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Register FluxBB |
---|
[18490] | 4 | Version: auto |
---|
[17457] | 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 | |
---|
[22204] | 13 | // +-----------------------------------------------------------------------+ |
---|
| 14 | // | Define plugin constants | |
---|
| 15 | // +-----------------------------------------------------------------------+ |
---|
[17457] | 16 | |
---|
[22204] | 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 | |
---|
[17457] | 21 | include_once (REGFLUXBB_PATH.'include/constants.php'); |
---|
| 22 | include_once (REGFLUXBB_PATH.'include/functions.inc.php'); |
---|
| 23 | |
---|
[22091] | 24 | load_language('plugin.lang', REGFLUXBB_PATH); |
---|
[17457] | 25 | |
---|
[22205] | 26 | /* plugin administration */ |
---|
[17457] | 27 | add_event_handler('get_admin_plugin_menu_links', 'Register_FluxBB_admin_menu'); |
---|
| 28 | |
---|
[22204] | 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 | ); |
---|
[17457] | 41 | |
---|
[22204] | 42 | return $menu; |
---|
| 43 | } |
---|
[17457] | 44 | |
---|
| 45 | |
---|
[22204] | 46 | /* user creation */ |
---|
| 47 | if (strpos(@$_GET['page'],'Register_FluxBB') === false) // Exclude user creation from plugin panel to make FluxBB2Piwigo synch available |
---|
| 48 | { |
---|
[22205] | 49 | add_event_handler('register_user', 'Register_FluxBB_Adduser'); |
---|
[22204] | 50 | } |
---|
| 51 | |
---|
| 52 | |
---|
[17457] | 53 | // Check users registration |
---|
[22204] | 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 | } |
---|
[17457] | 58 | |
---|
| 59 | |
---|
| 60 | /* user deletion */ |
---|
| 61 | add_event_handler('delete_user', 'Register_FluxBB_Deluser'); |
---|
| 62 | |
---|
[22091] | 63 | // Redirection to profile page |
---|
| 64 | // --------------------------- |
---|
[23905] | 65 | add_event_handler('login_success', 'Register_FluxBB_Login', EVENT_HANDLER_PRIORITY_NEUTRAL, 10); |
---|
[17457] | 66 | |
---|
| 67 | /* Profile management */ |
---|
| 68 | if (script_basename() == 'profile') |
---|
| 69 | { |
---|
[22091] | 70 | add_event_handler('loc_begin_profile', 'Register_FluxBB_InitProfile', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
[17457] | 71 | } |
---|
| 72 | |
---|
[22039] | 73 | /* Password forget */ |
---|
| 74 | add_event_handler('loc_begin_password', 'Register_FluxBB_PasswReset'); |
---|
[17457] | 75 | |
---|
| 76 | /* Access validation in FluxBB when validated in Piwigo through UAM plugin */ |
---|
[23905] | 77 | add_event_handler('login_success', 'UAM_Bridge', EVENT_HANDLER_PRIORITY_NEUTRAL, 20); |
---|
[17457] | 78 | |
---|
| 79 | ?> |
---|