| // | Plugin description : | // | Ce plugin permet l'enregistrement d'un utilisateur directement dans | // | PunBB (http://www.punbb.org) - This plugin allows to automatically | // | register a PWG user in a PunBB forum (http://www.punbb.org) | // +-----------------------------------------------------------------------+ // | This program is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published by | // | the Free Software Foundation | // | | // | This program is distributed in the hope that it will be useful, but | // | WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | // | General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ // *************************************** // ** Plugin Administration panel setup ** // *************************************** if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); /* ****************************************************** */ /* Plugin template initialisation for admin panel display */ /* ****************************************************** */ $me = get_plugin_data($plugin_id); global $template; // Setup plugin Language $RPlang = ( isset($user['language']) ) ? $user['language'] : $conf['default_language']; // en_UK.iso-8859-1 $my_path = dirname(__FILE__).'/../'; $rp = array(); if ( !@file_exists($my_path."language/$RPlang/lang.admin.regpunbb.php") ) { $SIElang = 'en_UK.iso-8859-1'; } // Include language @include_once( $my_path."language/$RPlang/lang.admin.regpunbb.php" ); // Load configuration settings from database load_conf_from_db('param like \'punbb\\_%\''); // Update configuration settings in database if ( isset($_POST['submit']) ) { $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_status'].'" WHERE param="punbb_status" LIMIT 1'; pwg_query($query); $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_prefix'].'" WHERE param="punbb_prefix" LIMIT 1'; pwg_query($query); $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_id_default_group'].'" WHERE param="punbb_id_default_group" LIMIT 1'; pwg_query($query); $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_admin'].'" WHERE param="punbb_admin" LIMIT 1'; pwg_query($query); $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_email_setting'].'" WHERE param="punbb_email_setting" LIMIT 1'; pwg_query($query); $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_save_pass'].'" WHERE param="punbb_save_pass" LIMIT 1'; pwg_query($query); $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_notify_with_post'].'" WHERE param="punbb_notify_with_post" LIMIT 1'; pwg_query($query); $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_timezone'].'" WHERE param="punbb_timezone" LIMIT 1'; pwg_query($query); $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_language'].'" WHERE param="punbb_language" LIMIT 1'; pwg_query($query); $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_style'].'" WHERE param="punbb_style" LIMIT 1'; pwg_query($query); $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.$_POST['punbb_del_pt'].'" WHERE param="punbb_del_pt" LIMIT 1'; pwg_query($query); // Reload settings for correct display after update load_conf_from_db('param like \'punbb\\_%\''); } // Users migration from PWG to PunBB //TODO: How to insert migration results in pwg template or a new blank window ? if ( isset($_POST['Migration']) ) { include_once (PHPWG_ROOT_PATH.'plugins/Register_Punbb/include/constants.php'); include (PHPWG_ROOT_PATH.'plugins/Register_Punbb/reg_punbb_migration.php'); } // Users table synchronization //TODO: How to insert synchronization results in pwg template or a new blank window ? if ( isset($_POST['Synchro']) ) { include_once (PHPWG_ROOT_PATH.'plugins/Register_Punbb/include/constants.php'); include (PHPWG_ROOT_PATH.'plugins/Register_Punbb/reg_punbb_synchro.php'); } /* Template settings */ $template->assign_vars( array( 'PUNBB_STATUS' => $conf['punbb_status'], 'PUNBB_PREFIX' => $conf['punbb_prefix'], 'PUNBB_ID_DEFAULT_GROUP' => $conf['punbb_id_default_group'], 'PUNBB_ADMIN' => $conf['punbb_admin'], 'PUNBB_EMAIL_SETTING' => $conf['punbb_email_setting'], 'PUNBB_SAVE_PASS' => $conf['punbb_save_pass'], 'PUNBB_NOTIFY_WITH_POST' => $conf['punbb_notify_with_post'], 'PUNBB_TIMEZONE' => $conf['punbb_timezone'], 'PUNBB_LANGUAGE' => $conf['punbb_language'], 'PUNBB_STYLE' => $conf['punbb_style'], 'PUNBB_DEL_PT' => $conf['punbb_del_pt'], ) ); $template->set_filenames( array('plugin_admin_content' => dirname(__FILE__).'/reg_punbb_admin.tpl') ); $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); ?>