source: extensions/Register_PunBB/main.inc.php @ 27153

Last change on this file since 27153 was 7809, checked in by Eric, 13 years ago

Commit of latest plugin version (1.3a) as a startup base for further developpements

  • Property svn:eol-style set to LF
File size: 1.9 KB
Line 
1<?php
2/*
3Plugin Name: Register PunBB
4Version: 1.3a
5Description: 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.
6Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=126
7Author: Eric
8Author URI: http://www.infernoweb.net
9*/
10if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
11
12/* ******************* */
13/* Class of the plugin */
14/* ******************* */
15class 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
54add_event_handler( 'register_user', array(&$obj, 'PunBB_Adduser') );
55add_event_handler( 'delete_user', array(&$obj, 'PunBB_Deluser') );
56add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') );
57set_plugin_data($plugin['id'], $obj);
58?>
Note: See TracBrowser for help on using the repository browser.