Update of /cvsroot/mxbb/mx_bugsbt/bugsbt/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7691/bugsbt/admin Added Files: admin_auth_manage.php admin_cat_manage.php admin_custom_manage.php admin_settings.php admin_types_manage.php index.htm Log Message: Ok. here we go. This is the cool new mxBB Bugtracker ;) --- NEW FILE: admin_cat_manage.php --- <?php /** * * @package mxBB Portal Module - mx_bugsbt * @version $Id: admin_cat_manage.php,v 1.1 2007/02/15 12:43:44 jonohlsson Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson, Mohd Basri, wGEric, PHP Arena, pafileDB, CRLin] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } class mx_bugsbt_cat_manage extends mx_bugsbt_admin { function main( $action ) { global $db, $images, $template, $lang, $phpEx, $mx_bugsbt_functions, $mx_bugsbt_cache, $bugsbt_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // // Includes // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, ''); if ( empty($mode) ) { if ( $create ) { $mode = 'create'; } else if ( $edit ) { $mode = 'edit'; } else if ( $delete ) { $mode = 'delete'; } else { $mode = ''; } } $cat_auth_levels = array( 'ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN' ); $cat_auth_const = array( AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN ); $cat_auth_approval_levels = array( 'NONE', 'MOD', 'ADMIN' ); $cat_auth_approval_const = array( AUTH_ALL, AUTH_MOD, AUTH_ADMIN ); $global_auth = array( 'auth_view', 'auth_edit', 'auth_delete', 'auth_post', 'auth_view_comment', 'auth_post_comment', 'auth_edit_comment', 'auth_delete_comment' ); $global_approval_auth = array( 'auth_approval', 'auth_approval_edit' ); $auth_select = array(); $auth_select_approval = array(); switch ( $mode ) { case ( 'create' ): if ( !$_POST['submit'] ) { if (isset($_POST['new_product_name'])) { $new_name = stripslashes( $_POST['new_product_name'] ); } else if (isset($_POST['new_edition_name'])) { $new_name = stripslashes( $_POST['new_edition_name'] ); } else if (isset($_POST['new_build_name'])) { $new_name = stripslashes( $_POST['new_build_name'] ); } else if (isset($_POST['new_product_name'])) { $new_name = ''; } $checked_yes = isset($_POST['new_build_name']) ? ' checked' : ''; $checked_no = isset($_POST['new_build_name']) ? '' : ' checked'; $checked_id = intval(isset($_POST['new_build_name'])); // For hidden field // // Comments // $use_comments_yes = ""; $use_comments_no = ""; $use_comments_default = "checked=\"checked\""; $internal_comments_internal = ""; $internal_comments_phpbb = ""; $internal_comments_default = "checked=\"checked\""; $comments_forum_id = '-1'; $autogenerate_comments_yes = ""; $autogenerate_comments_no = ""; $autogenerate_comments_default = "checked=\"checked\""; // // Instructions // $pretext_show = ""; $pretext_hide = ""; $pretext_default = "checked=\"checked\""; // // Notification // $notify_none = ""; $notify_pm = ""; $notify_email = ""; $notify_default = "checked=\"checked\""; $notify_group_list = mx_get_groups('', 'notify_group'); // // Permissions // $cat_rowset['auth_view'] = 0; $cat_rowset['auth_post'] = 1; $cat_rowset['auth_edit'] = 1; $cat_rowset['auth_delete'] = 2; $cat_rowset['auth_approval'] = 0; $cat_rowset['auth_approval_edit'] = 0; $cat_rowset['auth_view_comment'] = 1; $cat_rowset['auth_post_comment'] = 1; $cat_rowset['auth_edit_comment'] = 1; $cat_rowset['auth_delete_comment'] = 5; // // For BugsBT // $parent_id = $_POST['parent']; foreach( $global_auth as $auth ) { $auth_select[$auth] = ' <select name="' . $auth . '">'; for( $k = 0; $k < count( $cat_auth_levels ); $k++ ) { $selected = ( $cat_rowset[$auth] == $cat_auth_const[$k] ) ? ' selected="selected"' : ''; $auth_select[$auth] .= '<option value="' . $cat_auth_const[$k] . '"' . $selected . '>' . $lang['Cat_' . $cat_auth_levels[$k]] . '</option>'; } $auth_select[$auth] .= '</select> '; } foreach( $global_approval_auth as $auth ) { $auth_select_approval[$auth] = ' <select name="' . $auth . '">'; for( $k = 0; $k < count( $cat_auth_approval_levels ); $k++ ) { $selected = ( $cat_rowset[$auth] == $cat_auth_approval_const[$k] ) ? ' selected="selected"' : ''; $auth_select_approval[$auth] .= '<option value="' . $cat_auth_approval_const[$k] . '"' . $selected . '>' . $lang['Cat_' . $cat_auth_approval_levels[$k]] . '</option>'; } $auth_select_approval[$auth] .= '</select> '; } // // Generate page // $template->set_filenames( array( 'body' => 'admin/bugsbt_cat_edit_body.tpl' ) ); $template->assign_block_vars( 'switch_cat', array() ); $template->assign_vars( array( 'S_ACTION' => append_sid( "admin_bugsbt.$phpEx?action=cat_manage&mode=create" ), 'L_EDIT_TITLE' => $lang['Create_cat'], 'L_EDIT_DESCRIPTION' => $lang['Create_description'], 'L_CATEGORY' => $lang['Category'], 'L_DESCRIPTION' => $lang['Category_description'], 'L_NUMBER_ITEMS' => $lang['Bugs'], 'L_CAT_SETTINGS' => $lang['Cat_settings'], 'L_CREATE' => $lang['Create'], 'L_PARENT' => $lang['Parent'], 'L_NONE' => $lang['None'], 'CHECKED_YES' => $checked_yes, 'CHECKED_NO' => $checked_no, 'CHECKED_ID' => $checked_id, 'L_CAT_ALLOWFILE' => $lang['Allow_file'], 'L_CAT_ALLOWFILE_INFO' => $lang['Allow_file_info'], //'PARENT_LIST' => $this->generate_jumpbox( '', 0, 0, 0, true ), 'PARENT_LIST' => $this->generate_jumpbox( 0, 0, array( $parent_id => 1 ) ), 'PARENT_ID' => $parent_id, 'CAT_NAME' => $new_name, 'DESC' => '', 'NUMBER_ITEMS' => '0', 'L_DEFAULT' => $lang['Use_default'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_NONE' => $lang['Acc_None'], // // Comments // 'L_COMMENTS_TITLE' => $lang['Comments_title'], 'L_USE_COMMENTS' => $lang['Use_comments'], 'L_USE_COMMENTS_EXPLAIN' => $lang['Use_comments_explain'], 'S_USE_COMMENTS_YES' => $use_comments_yes, 'S_USE_COMMENTS_NO' => $use_comments_no, 'S_USE_COMMENTS_DEFAULT' => $use_comments_default, 'L_INTERNAL_COMMENTS' => $lang['Internal_comments'], 'L_INTERNAL_COMMENTS_EXPLAIN' => $lang['Internal_comments_explain'], 'S_INTERNAL_COMMENTS_INTERNAL' => $internal_comments_internal, 'S_INTERNAL_COMMENTS_PHPBB' => $internal_comments_phpbb, 'S_INTERNAL_COMMENTS_DEFAULT' => $internal_comments_default, 'L_INTERNAL_COMMENTS_INTERNAL' => $lang['Internal_comments_internal'], 'L_INTERNAL_COMMENTS_PHPBB' => $lang['Internal_comments_phpBB'], 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], 'FORUM_LIST' => $this->get_forums( $comments_forum_id, true, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], 'L_AUTOGENERATE_COMMENTS_EXPLAIN' => $lang['Autogenerate_comments_explain'], 'S_AUTOGENERATE_COMMENTS_YES' => $autogenerate_comments_yes, 'S_AUTOGENERATE_COMMENTS_NO' => $autogenerate_comments_no, 'S_AUTOGENERATE_COMMENTS_DEFAULT' => $autogenerate_comments_default, // // Instructions // 'L_INSTRUCTIONS_TITLE' => $lang['Instructions_title'], 'L_PRE_TEXT_NAME' => $lang['Pre_text_name'], 'L_PRE_TEXT_EXPLAIN' => $lang['Pre_text_explain'], 'S_SHOW_PRETEXT' => $pretext_show, 'S_HIDE_PRETEXT' => $pretext_hide, 'S_DEFAULT_PRETEXT' => $pretext_default, 'L_SHOW' => $lang['Show'], 'L_HIDE' => $lang['Hide'], // // Notifications // 'L_NOTIFICATIONS_TITLE' => $lang['Notifications_title'], 'L_NOTIFY' => $lang['Notify'], 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], 'L_EMAIL' => $lang['Email'], 'L_PM' => $lang['PM'], 'S_NOTIFY_NONE' => $notify_none, 'S_NOTIFY_EMAIL' => $notify_email, 'S_NOTIFY_PM' => $notify_pm, 'S_NOTIFY_DEFAULT' => $notify_default, 'L_NOTIFY_GROUP' => $lang['Notify_group'], 'L_NOTIFY_GROUP_EXPLAIN' => $lang['Notify_group_explain'], 'NOTIFY_GROUP' => $notify_group_list, // // Category permissions // 'L_CAT_PERMISSIONS' => $lang['Category_Permissions'], 'L_VIEW_LEVEL' => $lang['View_level'], 'S_VIEW_LEVEL' => $auth_select['auth_view'], 'L_EDIT_LEVEL' => $lang['Edit_level'], 'S_EDIT_LEVEL' => $auth_select['auth_edit'], 'L_DELETE_LEVEL' => $lang['Delete_level'], 'S_DELETE_LEVEL' => $auth_select['auth_delete'], 'L_UPLOAD_LEVEL' => $lang['Upload_level'], 'S_UPLOAD_LEVEL' => $auth_select['auth_post'], 'L_APPROVAL_LEVEL' => $lang['Approval_level'], 'S_APPROVAL_LEVEL' => $auth_select_approval['auth_approval'], 'L_APPROVAL_EDIT_LEVEL' => $lang['Approval_edit_level'], 'S_APPROVAL_EDIT_LEVEL' => $auth_select_approval['auth_approval_edit'], 'L_VIEW_COMMENT_LEVEL' => $lang['View_Comment_level'], 'S_VIEW_COMMENT_LEVEL' => $auth_select['auth_view_comment'], 'L_POST_COMMENT_LEVEL' => $lang['Post_Comment_level'], 'S_POST_COMMENT_LEVEL' => $auth_select['auth_post_comment'], 'L_EDIT_COMMENT_LEVEL' => $lang['Edit_Comment_level'], 'S_EDIT_COMMENT_LEVEL' => $auth_select['auth_edit_comment'], 'L_DELETE_COMMENT_LEVEL' => $lang['Delete_Comment_level'], 'S_DELETE_COMMENT_LEVEL' => $auth_select['auth_delete_comment'], 'L_DISABLED' => $lang['Disabled'], )); } else if ( $_POST['submit'] ) { $cat_name = trim( $_POST['catname'] ); if ( !$cat_name ) { echo "Please put a category name in!"; } $cat_desc = $_POST['catdesc']; $parent = intval( $_POST['parent'] ); $cat_allow_file = intval( $_POST['cat_allow_file'] ); $cat_use_comments = ( isset( $_POST['cat_allow_comments'] ) ) ? intval( $_POST['cat_allow_comments'] ) : 0; $cat_internal_comments = ( isset( $_POST['internal_comments'] ) ) ? intval( $_POST['internal_comments'] ) : 0; $cat_autogenerate_comments = ( isset( $_POST['autogenerate_comments'] ) ) ? intval( $_POST['autogenerate_comments'] ) : 0; $comments_forum_id = intval( $_POST['comments_forum_id'] ); $cat_show_pretext = ( isset( $_POST['show_pretext'] ) ) ? intval( $_POST['show_pretext'] ) : 0; $cat_notify = ( isset( $_POST['notify'] ) ) ? intval( $_POST['notify'] ) : 0; $cat_notify_group = ( isset( $_POST['notify_group'] ) ) ? intval( $_POST['notify_group'] ) : 0; if ( $comments_forum_id == 0 ) { mx_message_die(GENERAL_MESSAGE , 'Select a Forum'); } $view_level = intval( $_POST['auth_view'] ); $edit_level = intval( $_POST['auth_edit'] ); $delete_level = intval( $_POST['auth_delete'] ); $post_level = intval( $_POST['auth_post'] ); $approval_level = intval( $_POST['auth_approval'] ); $approval_edit_level = intval( $_POST['auth_approval_edit'] ); $comment_view_level = intval( $_POST['auth_view_comment'] ); $comment_post_level = intval( $_POST['auth_post_comment'] ); $comment_edit_level = intval( $_POST['auth_edit_comment'] ); $comment_delete_level = intval( $_POST['auth_delete_comment'] ); $sql = "SELECT MAX(cat_order) AS cat_order FROM " . BUGSBT_PRODUCTS_TABLE . " WHERE parent = $parent"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not obtain next type id', '', __LINE__, __FILE__, $sql ); } if ( !( $id = $db->sql_fetchrow( $result ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not obtain next type id', '', __LINE__, __FILE__, $sql ); } $cat_order = $id['cat_order'] + 10; $sql = "INSERT INTO " . BUGSBT_PRODUCTS_TABLE . " ( category_name, category_details, number_bugs, cat_allow_file, parent, cat_order, auth_view, auth_post, auth_view_comment, auth_post_comment, auth_edit_comment, auth_delete_comment, auth_edit, auth_delete, auth_approval, auth_approval_edit, cat_allow_comments, internal_comments, autogenerate_comments, comments_forum_id, show_pretext, notify, notify_group )" . " VALUES ( '$cat_name', '$cat_desc', '0', '$cat_allow_file', '$parent', '$cat_order', '$view_level', '$post_level', '$comment_view_level', '$comment_post_level', '$comment_edit_level', '$comment_delete_level', '$edit_level', '$delete_level', '$approval_level', '$approval_edit_level', '$cat_use_comments', '$cat_internal_comments', '$cat_autogenerate_comments', '$comments_forum_id', '$cat_show_pretext', '$cat_notify', '$cat_notify_group')"; if ( !( $results = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not create category", '', __LINE__, __FILE__, $sql ); } $message = $lang['Cat_created'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_bugsbt.$phpEx?action=cat_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } break; case ( 'edit' ): if ( !$_POST['submit'] ) { $cat_id = intval( $_GET['cat'] ); $cat_name = $this->cat_rowset[$cat_id]['category_name']; $cat_desc = $this->cat_rowset[$cat_id]['category_details']; $checked_yes = ( $this->cat_rowset[$cat_id]['cat_allow_file'] ) ? ' checked' : ''; $checked_no = ( !$this->cat_rowset[$cat_id]['cat_allow_file'] ) ? ' checked' : ''; $checked_id = intval($this->cat_rowset[$cat_id]['cat_allow_file']); $number_bugs = $this->items_in_cat($cat_id); $parent = $this->cat_rowset[$cat_id]['parent']; // // Comments // $use_comments_yes = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == 1 ) ? "checked=\"checked\"" : ""; $use_comments_no = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == 0 ) ? "checked=\"checked\"" : ""; $use_comments_default = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == -1 ) ? "checked=\"checked\"" : ""; $internal_comments_internal = ( $this->cat_rowset[$cat_id]['internal_comments'] == 1 ) ? "checked=\"checked\"" : ""; $internal_comments_phpbb = ( $this->cat_rowset[$cat_id]['internal_comments'] == 0 ) ? "checked=\"checked\"" : ""; $internal_comments_default = ( $this->cat_rowset[$cat_id]['internal_comments'] == -1 ) ? "checked=\"checked\"" : ""; $comments_forum_id = $this->cat_rowset[$cat_id]['comments_forum_id']; $autogenerate_comments_yes = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == 1 ) ? "checked=\"checked\"" : ""; $autogenerate_comments_no = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == 0) ? "checked=\"checked\"" : ""; $autogenerate_comments_default = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == -1 ) ? "checked=\"checked\"" : ""; // // Instructions // $pretext_show = ( $this->cat_rowset[$cat_id]['show_pretext'] == 1) ? "checked=\"checked\"" : ""; $pretext_hide = ( $this->cat_rowset[$cat_id]['show_pretext'] == 0) ? "checked=\"checked\"" : ""; $pretext_default = ( $this->cat_rowset[$cat_id]['show_pretext'] == -1 ) ? "checked=\"checked\"" : ""; // // Notification // $notify_none = ( $this->cat_rowset[$cat_id]['notify'] == 0 ) ? "checked=\"checked\"" : ""; $notify_pm = ( $this->cat_rowset[$cat_id]['notify'] == 1 ) ? "checked=\"checked\"" : ""; $notify_email = ( $this->cat_rowset[$cat_id]['notify'] == 2 ) ? "checked=\"checked\"" : ""; $notify_default = ( $this->cat_rowset[$cat_id]['notify'] == -1 ) ? "checked=\"checked\"" : ""; $notify_group_list = mx_get_groups($this->cat_rowset[$cat_id]['notify_group'], 'notify_group'); // // Permissions // foreach( $global_auth as $auth ) { $auth_select[$auth] = ' <select name="' . $auth . '">'; for( $k = 0; $k < count( $cat_auth_levels ); $k++ ) { $selected = ( $this->cat_rowset[$cat_id][$auth] == $cat_auth_const[$k] ) ? ' selected="selected"' : ''; $auth_select[$auth] .= '<option value="' . $cat_auth_const[$k] . '"' . $selected . '>' . $lang['Cat_' . $cat_auth_levels[$k]] . '</option>'; } $auth_select[$auth] .= '</select> '; } foreach( $global_approval_auth as $auth ) { $auth_select_approval[$auth] = ' <select name="' . $auth . '">'; for( $k = 0; $k < count( $cat_auth_approval_levels ); $k++ ) { $selected = ( $this->cat_rowset[$cat_id][$auth] == $cat_auth_approval_const[$k] ) ? ' selected="selected"' : ''; $auth_select_approval[$auth] .= '<option value="' . $cat_auth_approval_const[$k] . '"' . $selected . '>' . $lang['Cat_' . $cat_auth_approval_levels[$k]] . '</option>'; } $auth_select_approval[$auth] .= '</select> '; } // // Generate page // $template->set_filenames( array( 'body' => 'admin/bugsbt_cat_edit_body.tpl' ) ); $template->assign_block_vars( 'switch_cat', array() ); $template->assign_block_vars( 'switch_cat.switch_edit_category', array() ); $template->assign_vars( array( 'L_EDIT_TITLE' => $lang['Edit_cat'], 'L_EDIT_DESCRIPTION' => $lang['Edit_description'], 'L_CATEGORY' => $lang['Category'], 'L_DESCRIPTION' => $lang['Category_desc'], 'L_NUMBER_ITEMS' => $lang['Bugs'], 'L_CAT_SETTINGS' => $lang['Cat_settings'], 'L_CREATE' => $lang['Edit'], 'L_PARENT' => $lang['Parent'], 'L_NONE' => $lang['None'], 'CHECKED_YES' => $checked_yes, 'CHECKED_NO' => $checked_no, 'CHECKED_ID' => $checked_id, 'L_CAT_ALLOWFILE' => $lang['Allow_file'], 'L_CAT_ALLOWFILE_INFO' => $lang['Allow_file_info'], //'PARENT_LIST' => $this->generate_jumpbox( '', $cat_id, $parent, true, true ), 'PARENT_LIST' => $this->generate_jumpbox( 0, 0, array( $parent => 1 )), 'PARENT_ID' => $parent, 'S_ACTION' => append_sid( "admin_bugsbt.$phpEx?action=cat_manage&mode=edit" ), 'CAT_NAME' => $cat_name, 'CAT_DESCRIPTION' => $cat_desc, 'NUMBER_ITEMS' => $number_bugs, 'L_DEFAULT' => $lang['Use_default'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_NONE' => $lang['Acc_None'], // // Comments // 'L_COMMENTS_TITLE' => $lang['Comments_title'], 'L_USE_COMMENTS' => $lang['Use_comments'], 'L_USE_COMMENTS_EXPLAIN' => $lang['Use_comments_explain'], 'S_USE_COMMENTS_YES' => $use_comments_yes, 'S_USE_COMMENTS_NO' => $use_comments_no, 'S_USE_COMMENTS_DEFAULT' => $use_comments_default, 'L_INTERNAL_COMMENTS' => $lang['Internal_comments'], 'L_INTERNAL_COMMENTS_EXPLAIN' => $lang['Internal_comments_explain'], 'S_INTERNAL_COMMENTS_INTERNAL' => $internal_comments_internal, 'S_INTERNAL_COMMENTS_PHPBB' => $internal_comments_phpbb, 'S_INTERNAL_COMMENTS_DEFAULT' => $internal_comments_default, 'L_INTERNAL_COMMENTS_INTERNAL' => $lang['Internal_comments_internal'], 'L_INTERNAL_COMMENTS_PHPBB' => $lang['Internal_comments_phpBB'], 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], 'FORUM_LIST' => $this->get_forums( $comments_forum_id, true, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], 'L_AUTOGENERATE_COMMENTS_EXPLAIN' => $lang['Autogenerate_comments_explain'], 'S_AUTOGENERATE_COMMENTS_YES' => $autogenerate_comments_yes, 'S_AUTOGENERATE_COMMENTS_NO' => $autogenerate_comments_no, 'S_AUTOGENERATE_COMMENTS_DEFAULT' => $autogenerate_comments_default, // // Instructions // 'L_INSTRUCTIONS_TITLE' => $lang['Instructions_title'], 'L_PRE_TEXT_NAME' => $lang['Pre_text_name'], 'L_PRE_TEXT_EXPLAIN' => $lang['Pre_text_explain'], 'S_SHOW_PRETEXT' => $pretext_show, 'S_HIDE_PRETEXT' => $pretext_hide, 'S_DEFAULT_PRETEXT' => $pretext_default, 'L_SHOW' => $lang['Show'], 'L_HIDE' => $lang['Hide'], // // Notifications // 'L_NOTIFICATIONS_TITLE' => $lang['Notifications_title'], 'L_NOTIFY' => $lang['Notify'], 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], 'L_EMAIL' => $lang['Email'], 'L_PM' => $lang['PM'], 'S_NOTIFY_NONE' => $notify_none, 'S_NOTIFY_EMAIL' => $notify_email, 'S_NOTIFY_PM' => $notify_pm, 'S_NOTIFY_DEFAULT' => $notify_default, 'L_NOTIFY_GROUP' => $lang['Notify_group'], 'L_NOTIFY_GROUP_EXPLAIN' => $lang['Notify_group_explain'], 'NOTIFY_GROUP' => $notify_group_list, // // Cat permissions // 'L_CAT_PERMISSIONS' => $lang['Category_Permissions'], 'L_VIEW_LEVEL' => $lang['View_level'], 'S_VIEW_LEVEL' => $auth_select['auth_view'], 'L_EDIT_LEVEL' => $lang['Edit_level'], 'S_EDIT_LEVEL' => $auth_select['auth_edit'], 'L_DELETE_LEVEL' => $lang['Delete_level'], 'S_DELETE_LEVEL' => $auth_select['auth_delete'], 'L_UPLOAD_LEVEL' => $lang['Upload_level'], 'S_UPLOAD_LEVEL' => $auth_select['auth_post'], 'L_APPROVAL_LEVEL' => $lang['Approval_level'], 'S_APPROVAL_LEVEL' => $auth_select_approval['auth_approval'], 'L_APPROVAL_EDIT_LEVEL' => $lang['Approval_edit_level'], 'S_APPROVAL_EDIT_LEVEL' => $auth_select_approval['auth_approval_edit'], 'L_VIEW_COMMENT_LEVEL' => $lang['View_Comment_level'], 'S_VIEW_COMMENT_LEVEL' => $auth_select['auth_view_comment'], 'L_POST_COMMENT_LEVEL' => $lang['Post_Comment_level'], 'S_POST_COMMENT_LEVEL' => $auth_select['auth_post_comment'], 'L_EDIT_COMMENT_LEVEL' => $lang['Edit_Comment_level'], 'S_EDIT_COMMENT_LEVEL' => $auth_select['auth_edit_comment'], 'L_DELETE_COMMENT_LEVEL' => $lang['Delete_Comment_level'], 'S_DELETE_COMMENT_LEVEL' => $auth_select['auth_delete_comment'], 'L_DISABLED' => $lang['Disabled'], 'S_HIDDEN' => '<input type="hidden" name="catid" value="' . $cat_id . '">' ) ); } else if ( $_POST['submit'] ) { $cat_id = intval( $_POST['catid'] ); $cat_name = trim( $_POST['catname'] ); $cat_desc = $_POST['catdesc']; $number_bugs = intval( $_POST['number_articles'] ); $parent = intval( $_POST['parent'] ); $cat_allow_file = intval( $_POST['cat_allow_file'] ); $cat_use_comments = ( isset( $_POST['cat_allow_comments'] ) ) ? intval( $_POST['cat_allow_comments'] ) : 0; $cat_internal_comments = ( isset( $_POST['internal_comments'] ) ) ? intval( $_POST['internal_comments'] ) : 0; $cat_autogenerate_comments = ( isset( $_POST['autogenerate_comments'] ) ) ? intval( $_POST['autogenerate_comments'] ) : 0; $comments_forum_id = intval( $_POST['comments_forum_id'] ); $cat_show_pretext = ( isset( $_POST['show_pretext'] ) ) ? intval( $_POST['show_pretext'] ) : 0; $cat_notify = ( isset( $_POST['notify'] ) ) ? intval( $_POST['notify'] ) : 0; $cat_notify_group = ( isset( $_POST['notify_group'] ) ) ? intval( $_POST['notify_group'] ) : 0; $view_level = intval( $_POST['auth_view'] ); $edit_level = intval( $_POST['auth_edit'] ); $delete_level = intval( $_POST['auth_delete'] ); $post_level = intval( $_POST['auth_post'] ); $approval_level = intval( $_POST['auth_approval'] ); $approval_edit_level = intval( $_POST['auth_approval_edit'] ); $comment_view_level = intval( $_POST['auth_view_comment'] ); $comment_post_level = intval( $_POST['auth_post_comment'] ); $comment_edit_level = intval( $_POST['auth_edit_comment'] ); $comment_delete_level = intval( $_POST['auth_delete_comment'] ); if ( !$cat_name ) { echo "Please put a category name in!"; } $sql = "UPDATE " . BUGSBT_PRODUCTS_TABLE . " SET category_name = '" . $cat_name . "', category_details = '" . $cat_desc . "', number_bugs = '" . $number_bugs . "', cat_allow_file = '" . $cat_allow_file . "', parent = '" . $parent . "', auth_view = '" . $view_level . "', auth_post = '" . $post_level . "', auth_view_comment = '" . $comment_view_level . "', auth_post_comment = '" . $comment_post_level . "', auth_edit_comment = '" . $comment_edit_level . "', auth_delete_comment = '" . $comment_delete_level . "', auth_edit = '" . $edit_level . "', auth_delete = '" . $delete_level . "', auth_approval = '" . $approval_level . "', auth_approval_edit = '" . $approval_edit_level . "', cat_allow_comments = '" . $cat_use_comments . "', internal_comments = '" . $cat_internal_comments . "', autogenerate_comments = '" . $cat_autogenerate_comments . "', notify = '" . $cat_notify . "', notify_group = '" . $cat_notify_group . "', show_pretext = '" . $cat_show_pretext . "', comments_forum_id = '" . $comments_forum_id . "' WHERE category_id = " . $cat_id; if ( !( $results = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update category", '', __LINE__, __FILE__, $sql ); } $message = $lang['Cat_edited'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_bugsbt.$phpEx?action=cat_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } break; case ( 'delete' ): if ( !$_POST['submit'] ) { $cat_id = $_GET['cat']; $sql = "SELECT * FROM " . BUGSBT_PRODUCTS_TABLE . " WHERE category_id = '" . $cat_id . "'"; if ( !( $cat_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql ); } if ( $category = $db->sql_fetchrow( $cat_result ) ) { $cat_name = $category['category_name']; } // // Generate page // $template->set_filenames( array( 'body' => 'admin/bugsbt_cat_del_body.tpl' ) ); $template->assign_vars( array( 'L_DELETE_TITLE' => $lang['Cat_delete_title'], 'L_DELETE_DESCRIPTION' => $lang['Cat_delete_desc'], 'L_CAT_DELETE' => $lang['Cat_delete_title'], 'L_DELETE_ITEMS' => $lang['Delete_all_articles'], 'L_CAT_NAME' => $lang['Article_category'], 'L_MOVE_CONTENTS' => $lang['Move_contents'], 'L_DELETE' => $lang['Move_and_Delete'], 'S_HIDDEN_FIELDS' => '<input type="hidden" name="catid" value="' . $cat_id . '">', //'S_SELECT_TO' => $this->generate_jumpbox( '', $cat_id, 0, true, true ), 'S_SELECT_TO' => $this->generate_jumpbox( 0, 0, array( $cat_id => 1 )), 'S_ACTION' => append_sid( "admin_bugsbt.$phpEx?action=cat_manage&mode=delete" ), 'CAT_NAME' => $cat_name ) ); } else if ( $_POST['submit'] ) { $new_category = $_POST['move_id']; $old_category = $_POST['catid']; if ( $new_category != '0' ) { $sql = "UPDATE " . BUGSBT_BUGS_TABLE . " SET bug_category_id = '$new_category' WHERE bug_category_id = '$old_category'"; if ( !( $move_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not move bugs", '', __LINE__, __FILE__, $sql ); } $sql = "SELECT * FROM " . BUGSBT_PRODUCTS_TABLE . " WHERE category_id = '$new_category'"; if ( !( $cat_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } if ( $new_cat = $db->sql_fetchrow( $cat_result ) ) { $new_bugs = $new_cat['number_bugs']; } $sql = "SELECT * FROM " . BUGSBT_PRODUCTS_TABLE . " WHERE category_id = '$old_category'"; if ( !( $oldcat_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } if ( $old_cat = $db->sql_fetchrow( $oldcat_result ) ) { $old_bugs = $old_cat['number_bugs']; } $number_bugs = $new_bugs + $old_bugs; $sql = "UPDATE " . BUGSBT_PRODUCTS_TABLE . " SET number_bugs = '" . $number_bugs . "' WHERE category_id = " . $new_category; if ( !( $number_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update bugs number", '', __LINE__, __FILE__, $sql ); } } else { $sql = "DELETE FROM " . BUGSBT_BUGS_TABLE . " WHERE bug_category_id = " . $old_category; if ( !( $delete__bugs = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not delete bugs", '', __LINE__, __FILE__, $sql ); } } $sql = "DELETE FROM " . BUGSBT_PRODUCTS_TABLE . " WHERE category_id = $old_category"; if ( !( $delete_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not delete category", '', __LINE__, __FILE__, $sql ); } $message = $lang['Cat_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_bugsbt.$phpEx?action=cat_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } break; default: if ( $mode == "up" ) { $cat_id = $_GET['cat']; $sql = "SELECT * FROM " . BUGSBT_PRODUCTS_TABLE . " WHERE category_id = $cat_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } if ( $category = $db->sql_fetchrow( $result ) ) { $parent = $category['parent']; $old_pos = $category['cat_order']; $new_pos = $old_pos-10; } $sql = "UPDATE " . BUGSBT_PRODUCTS_TABLE . " SET cat_order = '" . $old_pos . "' WHERE parent = " . $parent . " AND cat_order = " . $new_pos; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } $sql = "UPDATE " . BUGSBT_PRODUCTS_TABLE . " SET cat_order = '" . $new_pos . "' WHERE category_id = " . $cat_id; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } } if ( $mode == "down" ) { $cat_id = $_GET['cat']; $sql = "SELECT * FROM " . BUGSBT_PRODUCTS_TABLE . " WHERE category_id = $cat_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } if ( $category = $db->sql_fetchrow( $result ) ) { $parent = $category['parent']; $old_pos = $category['cat_order']; $new_pos = $old_pos + 10; } $sql = "UPDATE " . BUGSBT_PRODUCTS_TABLE . " SET cat_order = '" . $old_pos . "' WHERE parent = " . $parent . " AND cat_order = " . $new_pos; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } $sql = "UPDATE " . BUGSBT_PRODUCTS_TABLE . " SET cat_order = '" . $new_pos . "' WHERE category_id = " . $cat_id; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } } // Generate page $template->set_filenames( array( 'body' => 'admin/bugsbt_cat_admin_body.tpl' ) ); $template->assign_vars( array( 'L_CAT_TITLE' => $lang['Panel_cat_title'], 'L_CAT_EXPLAIN' => $lang['Panel_cat_explain'], 'L_CREATE_CAT' => $lang['Create_cat'], 'L_CREATE' => $lang['Create'], 'L_CATEGORY' => $lang['Bug_category'], 'L_ACTION' => $lang['Bug_action'], 'L_ITEMS' => $lang['Bugs'], 'L_ORDER' => $lang['Update_order'], 'S_ACTION' => append_sid( "admin_bugsbt.$phpEx?action=cat_manage&mode=create" ) ) ); $this->admin_cat_main( 0 ); break; } $template->pparse( 'body' ); } } ?> --- NEW FILE: admin_settings.php --- <?php /** * * @package mxBB Portal Module - mx_bugsbt * @version $Id: admin_settings.php,v 1.1 2007/02/15 12:43:44 jonohlsson Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson, Cezary Tomczak] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } class mx_bugsbt_settings extends mx_bugsbt_admin { function main( $action ) { global $db, $images, $template, $lang, $phpEx, $mx_bugsbt_functions, $mx_bugsbt_cache, $bugsbt_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // // Includes // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); // // Pull all config data // $sql = "SELECT * FROM " . BUGSBT_CONFIG_TABLE; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( CRITICAL_ERROR, "Could not query bugsbt configuration information", "", __LINE__, __FILE__, $sql ); } else { while ( $row = $db->sql_fetchrow( $result ) ) { $config_name = $row['config_name']; $config_value = $row['config_value']; $bugsbt_config[$config_name] = $config_value; $new[$config_name] = ( isset( $_POST[$config_name] ) ) ? $_POST[$config_name] : $bugsbt_config[$config_name]; if ( isset( $_POST['submit'] ) ) { $mx_bugsbt_functions->set_config( $config_name, $new[$config_name] ); } } if ( isset( $_POST['submit'] ) ) { $mx_bugsbt_cache->unload(); $message = $lang['bugsbt_config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_bugsbt_config'], "<a href=\"" . append_sid( "admin_bugsbt.$phpEx?action=settings&mode=config" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . "\">", "</a>" ); mx_message_die( GENERAL_MESSAGE, $message ); } } $template->set_filenames( array( "body" => "admin/bugsbt_config_body.tpl" ) ); // // General Settings // $module_name = $new['module_name']; $enable_module_yes = ( $new['enable_module'] ) ? "checked=\"checked\"" : ""; $enable_module_no = ( !$new['enable_module'] ) ? "checked=\"checked\"" : ""; $wysiwyg_path = $new['wysiwyg_path']; // // Article // $allow_wysiwyg_yes = ( $new['allow_wysiwyg'] ) ? "checked=\"checked\"" : ""; $allow_wysiwyg_no = ( !$new['allow_wysiwyg'] ) ? "checked=\"checked\"" : ""; $allow_html_yes = ( $new['allow_html'] ) ? "checked=\"checked\"" : ""; $allow_html_no = ( !$new['allow_html'] ) ? "checked=\"checked\"" : ""; $allowed_html_tags = $new['allowed_html_tags']; $allow_bbcode_yes = ( $new['allow_bbcode'] ) ? "checked=\"checked\"" : ""; $allow_bbcode_no = ( !$new['allow_bbcode'] ) ? "checked=\"checked\"" : ""; $allow_smilies_yes = ( $new['allow_smilies'] ) ? "checked=\"checked\"" : ""; $allow_smilies_no = ( !$new['allow_smilies'] ) ? "checked=\"checked\"" : ""; $allow_images_yes = ( $new['allow_images'] ) ? "checked=\"checked\"" : ""; $allow_images_no = ( !$new['allow_images'] ) ? "checked=\"checked\"" : ""; $allow_links_yes = ( $new['allow_links'] ) ? "checked=\"checked\"" : ""; $allow_links_no = ( !$new['allow_links'] ) ? "checked=\"checked\"" : ""; $no_image_message = $new['no_image_message']; $no_link_message = $new['no_link_message']; $max_chars = $new['max_chars']; $max_subject_chars = $new['max_subject_chars']; $max_desc_chars = $new['max_desc_chars']; $format_truncate_links_yes = ( $new['formatting_truncate_links'] ) ? "checked=\"checked\"" : ""; $format_truncate_links_no = ( !$new['formatting_truncate_links'] ) ? "checked=\"checked\"" : ""; $format_image_resize = $new['formatting_image_resize']; $format_wordwrap_yes = ( $new['formatting_wordwrap'] ) ? "checked=\"checked\"" : ""; $format_wordwrap_no = ( !$new['formatting_wordwrap'] ) ? "checked=\"checked\"" : ""; // // Appearance // $pagination = $new['pagination']; $sort_method_options = array(); $sort_method_options = array( "Alphabetic", "Latest", "Toprated", "Most_popular", "Userrank", "Id" ); $sort_method_list = '<select name="sort_method">'; for( $j = 0; $j < count( $sort_method_options ); $j++ ) { if ( $new['sort_method'] == $sort_method_options[$j] ) { $status = "selected"; } else { $status = ''; } $sort_method_list .= '<option value="' . $sort_method_options[$j] . '" ' . $status . '>' . $sort_method_options[$j] . '</option>'; } $sort_method_list .= '</select>'; $sort_order_options = array(); $sort_order_options = array( "DESC", "ASC" ); $sort_order_list = '<select name="sort_order">'; for( $j = 0; $j < count( $sort_order_options ); $j++ ) { if ( $new['sort_order'] == $sort_order_options[$j] ) { $status = "selected"; } else { $status = ''; } $sort_order_list .= '<option value="' . $sort_order_options[$j] . '" ' . $status . '>' . $sort_order_options[$j] . '</option>'; } $sort_order_list .= '</select>'; $header_banner_yes = ( $new['header_banner'] ) ? "checked=\"checked\"" : ""; $header_banner_no = ( !$new['header_banner'] ) ? "checked=\"checked\"" : ""; $stats_list_yes = ( $new['stats_list'] ) ? "checked=\"checked\"" : ""; $stats_list_no = ( !$new['stats_list'] ) ? "checked=\"checked\"" : ""; $settings_newdays = $new['settings_newdays']; $cat_col = $new['cat_col']; $use_simple_navigation_yes = ( $new['use_simple_navigation'] ) ? "checked=\"checked\"" : ""; $use_simple_navigation_no = ( !$new['use_simple_navigation'] ) ? "checked=\"checked\"" : ""; // // Instructions // $pretext_show = ( $new['show_pretext'] ) ? "checked=\"checked\"" : ""; $pretext_hide = ( !$new['show_pretext'] ) ? "checked=\"checked\"" : ""; $pt_header = $new['pt_header']; $pt_body = $new['pt_body']; // // Comments (default settings) // $use_comments_yes = ( $new['use_comments'] ) ? "checked=\"checked\"" : ""; $use_comments_no = ( !$new['use_comments'] ) ? "checked=\"checked\"" : ""; $internal_comments_internal = ( $new['internal_comments'] ) ? "checked=\"checked\"" : ""; $internal_comments_phpbb = ( !$new['internal_comments'] ) ? "checked=\"checked\"" : ""; $comments_forum_id = $new['comments_forum_id']; $del_topic_yes = ( $new['del_topic'] ) ? "checked=\"checked\"" : ""; $del_topic_no = ( !$new['del_topic'] ) ? "checked=\"checked\"" : ""; $autogenerate_comments_yes = ( $new['autogenerate_comments'] ) ? "checked=\"checked\"" : ""; $autogenerate_comments_no = ( !$new['autogenerate_comments'] ) ? "checked=\"checked\"" : ""; $allow_comment_wysiwyg_yes = ( $new['allow_comment_wysiwyg'] ) ? "checked=\"checked\"" : ""; $allow_comment_wysiwyg_no = ( !$new['allow_comment_wysiwyg'] ) ? "checked=\"checked\"" : ""; $allow_comment_html_yes = ( $new['allow_comment_html'] ) ? "checked=\"checked\"" : ""; $allow_comment_html_no = ( !$new['allow_comment_html'] ) ? "checked=\"checked\"" : ""; $allowed_comment_html_tags = $new['allowed_comment_html_tags']; $allow_comment_bbcode_yes = ( $new['allow_comment_bbcode'] ) ? "checked=\"checked\"" : ""; $allow_comment_bbcode_no = ( !$new['allow_comment_bbcode'] ) ? "checked=\"checked\"" : ""; $allow_comment_smilies_yes = ( $new['allow_comment_smilies'] ) ? "checked=\"checked\"" : ""; $allow_comment_smilies_no = ( !$new['allow_comment_smilies'] ) ? "checked=\"checked\"" : ""; $allow_comment_links_yes = ( $new['allow_comment_links'] ) ? "checked=\"checked\"" : ""; $allow_comment_links_no = ( !$new['allow_comment_links'] ) ? "checked=\"checked\"" : ""; $allow_comment_images_yes = ( $new['allow_comment_images'] ) ? "checked=\"checked\"" : ""; $allow_comment_images_no = ( !$new['allow_comment_images'] ) ? "checked=\"checked\"" : ""; $no_comment_link_message = $new['no_comment_link_message']; $no_comment_image_message = $new['no_comment_image_message']; $max_comment_chars = $new['max_comment_chars']; $max_comment_subject_chars = $new['max_comment_subject_chars']; $format_comment_truncate_links_yes = ( $new['formatting_comment_truncate_links'] ) ? "checked=\"checked\"" : ""; $format_comment_truncate_links_no = ( !$new['formatting_comment_truncate_links'] ) ? "checked=\"checked\"" : ""; $format_comment_image_resize = $new['formatting_comment_image_resize']; $format_comment_wordwrap_yes = ( $new['formatting_comment_wordwrap'] ) ? "checked=\"checked\"" : ""; $format_comment_wordwrap_no = ( !$new['formatting_comment_wordwrap'] ) ? "checked=\"checked\"" : ""; $comments_pag = $new['comments_pagination']; // // Notifications // $notify_none = ( $new['notify'] == 0 ) ? "checked=\"checked\"" : ""; $notify_pm = ( $new['notify'] == 1 ) ? "checked=\"checked\"" : ""; $notify_email = ( $new['notify'] == 2 ) ? "checked=\"checked\"" : ""; $notify_group_list = mx_get_groups($new['notify_group'], 'notify_group'); $template->assign_vars( array( 'S_ACTION' => append_sid( "admin_bugsbt.$phpEx?action=settings&mode=config" ), 'L_CONFIGURATION_TITLE' => $lang['Panel_config_title'], 'L_CONFIGURATION_EXPLAIN' => $lang['Panel_config_explain'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_NONE' => $lang['Acc_None'], // // General // 'L_GENERAL_TITLE' => $lang['General_title'], 'L_MODULE_NAME' => $lang['Module_name'], 'L_MODULE_NAME_EXPLAIN' => $lang['Module_name_explain'], 'MODULE_NAME' => $module_name, 'L_ENABLE_MODULE' => $lang['Enable_module'], 'L_ENABLE_MODULE_EXPLAIN' => $lang['Enable_module_explain'], 'S_ENABLE_MODULE_YES' => $enable_module_yes, 'S_ENABLE_MODULE_NO' => $enable_module_no, 'L_WYSIWYG_PATH' => $lang['Wysiwyg_path'], 'L_WYSIWYG_PATH_EXPLAIN' => $lang['Wysiwyg_path_explain'], 'WYSIWYG_PATH' => $wysiwyg_path, // // Article // 'L_ARTICLE_TITLE' => $lang['Bug_title'], 'L_ALLOW_WYSIWYG' => $lang['Allow_Wysiwyg'], 'L_ALLOW_WYSIWYG_EXPLAIN' => $lang['Allow_Wysiwyg_explain'], 'S_ALLOW_WYSIWYG_YES' => $allow_wysiwyg_yes, 'S_ALLOW_WYSIWYG_NO' => $allow_wysiwyg_no, 'L_ALLOW_HTML' => $lang['Allow_HTML'], 'L_ALLOW_HTML_EXPLAIN' => $lang['Allow_html_explain'], 'S_ALLOW_HTML_YES' => $allow_html_yes, 'S_ALLOW_HTML_NO' => $allow_html_no, 'L_ALLOW_BBCODE' => $lang['Allow_BBCode'], 'L_ALLOW_BBCODE_EXPLAIN' => $lang['Allow_bbcode_explain'], 'S_ALLOW_BBCODE_YES' => $allow_bbcode_yes, 'S_ALLOW_BBCODE_NO' => $allow_bbcode_no, 'L_ALLOW_SMILIES' => $lang['Allow_smilies'], 'L_ALLOW_SMILIES_EXPLAIN' => $lang['Allow_smilies_explain'], 'S_ALLOW_SMILIES_YES' => $allow_smilies_yes, 'S_ALLOW_SMILIES_NO' => $allow_smilies_no, 'L_ALLOWED_HTML_TAGS' => $lang['Allowed_tags'], 'L_ALLOWED_HTML_TAGS_EXPLAIN' => $lang['Allowed_tags_explain'], 'ALLOWED_HTML_TAGS' => $allowed_html_tags, 'L_ALLOW_IMAGES' => $lang['Allow_images'], 'L_ALLOW_IMAGES_EXPLAIN' => $lang['Allow_images_explain'], 'S_ALLOW_IMAGES_YES' => $allow_images_yes, 'S_ALLOW_IMAGES_NO' => $allow_images_no, 'L_ALLOW_LINKS' => $lang['Allow_links'], 'L_ALLOW_LINKS_EXPLAIN' => $lang['Allow_links_explain'], 'S_ALLOW_LINKS_YES' => $allow_links_yes, 'S_ALLOW_LINKS_NO' => $allow_links_no, 'L_LINKS_MESSAGE' => $lang['Allow_links_message'], 'L_LINKS_MESSAGE_EXPLAIN' => $lang['Allow_links_message_explain'], 'MESSAGE_LINK' => $no_link_message, 'L_IMAGES_MESSAGE' => $lang['Allow_images_message'], 'L_IMAGES_MESSAGE_EXPLAIN' => $lang['Allow_images_message_explain'], 'MESSAGE_IMAGE' => $no_image_message, 'L_MAX_SUBJECT_CHAR' => $lang['Max_subject_char'], 'L_MAX_SUBJECT_CHAR_EXPLAIN' => $lang['Max_subject_char_explain'], 'MAX_SUBJECT_CHAR' => $max_subject_chars, 'L_MAX_DESC_CHAR' => $lang['Max_desc_char'], 'L_MAX_DESC_CHAR_EXPLAIN' => $lang['Max_desc_char_explain'], 'MAX_DESC_CHAR' => $max_desc_chars, 'L_MAX_CHAR' => $lang['Max_char'], 'L_MAX_CHAR_EXPLAIN' => $lang['Max_char_explain'], 'MAX_CHAR' => $max_chars, 'L_FORMAT_WORDWRAP' => $lang['Format_wordwrap'], 'L_FORMAT_WORDWRAP_EXPLAIN' => $lang['Format_wordwrap_explain'], 'S_FORMAT_WORDWRAP_YES' => $format_wordwrap_yes, 'S_FORMAT_WORDWRAP_NO' => $format_wordwrap_no, 'L_FORMAT_IMAGE_RESIZE' => $lang['Format_image_resize'], 'L_FORMAT_IMAGE_RESIZE_EXPLAIN' => $lang['Format_image_resize_explain'], 'FORMAT_IMAGE_RESIZE' => $format_image_resize, 'L_FORMAT_TRUNCATE_LINKS' => $lang['Format_truncate_links'], 'L_FORMAT_TRUNCATE_LINKS_EXPLAIN' => $lang['Format_truncate_links_explain'], 'S_FORMAT_TRUNCATE_LINKS_YES' => $format_truncate_links_yes, 'S_FORMAT_TRUNCATE_LINKS_NO' => $format_truncate_links_no, // // Appearance // 'L_APPEARANCE_TITLE' => $lang['Appearance_title'], 'L_PAGINATION' => $lang['Bug_pag'], 'L_PAGINATION_EXPLAIN' => $lang['Bug_pag_explain'], 'PAGINATION' => $pagination, 'L_SORT_METHOD' => $lang['Sort_method'], 'L_SORT_METHOD_EXPLAIN' => $lang['Sort_method_explain'], 'SORT_METHOD' => $sort_method_list, 'L_SORT_ORDER' => $lang['Sort_order'], 'L_SORT_ORDER_EXPLAIN' => $lang['Sort_order_explain'], 'SORT_ORDER' => $sort_order_list, 'L_STATS_LIST' => $lang['Stats_list'], 'L_STATS_LIST_EXPLAIN' => $lang['Stats_list_explain'], 'S_STATS_LIST_YES' => $stats_list_yes, 'S_STATS_LIST_NO' => $stats_list_no, 'L_HEADER_BANNER' => $lang['Header_banner'], 'L_HEADER_BANNER_EXPLAIN' => $lang['Header_banner_explain'], 'S_HEADER_BANNER_YES' => $header_banner_yes, 'S_HEADER_BANNER_NO' => $header_banner_no, 'CAT_COL' => $cat_col, 'L_CAT_COL' => $lang['Cat_col'], 'S_USE_SIMPLE_NAVIGATION_YES' => $use_simple_navigation_yes, 'S_USE_SIMPLE_NAVIGATION_NO' => $use_simple_navigation_no, 'L_USE_SIMPLE_NAVIGATION' => $lang['Use_simple_navigation'], 'L_USE_SIMPLE_NAVIGATION_EXPLAIN' => $lang['Use_simple_navigation_explain'], 'L_NFDAYS' => $lang['Nfdays'], 'L_NFDAYSINFO' => $lang['Nfdaysinfo'], 'SETTINGS_NEWDAYS' => $settings_newdays, // // Comments // 'L_COMMENTS_TITLE' => $lang['Comments_title'], 'L_COMMENTS_TITLE_EXPLAIN' => $lang['Comments_title_explain'], 'L_USE_COMMENTS' => $lang['Use_comments'], 'L_USE_COMMENTS_EXPLAIN' => $lang['Use_comments_explain'], 'S_USE_COMMENTS_YES' => $use_comments_yes, 'S_USE_COMMENTS_NO' => $use_comments_no, 'L_INTERNAL_COMMENTS' => $lang['Internal_comments'], 'L_INTERNAL_COMMENTS_EXPLAIN' => $lang['Internal_comments_explain'], 'S_INTERNAL_COMMENTS_INTERNAL' => $internal_comments_internal, 'S_INTERNAL_COMMENTS_PHPBB' => $internal_comments_phpbb, 'L_INTERNAL_COMMENTS_INTERNAL' => $lang['Internal_comments_internal'], 'L_INTERNAL_COMMENTS_PHPBB' => $lang['Internal_comments_phpBB'], 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], 'FORUM_LIST' => $this->get_forums( $comments_forum_id, false, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], 'L_AUTOGENERATE_COMMENTS_EXPLAIN' => $lang['Autogenerate_comments_explain'], 'S_AUTOGENERATE_COMMENTS_YES' => $autogenerate_comments_yes, 'S_AUTOGENERATE_COMMENTS_NO' => $autogenerate_comments_no, 'L_ALLOW_COMMENT_WYSIWYG' => $lang['Allow_Wysiwyg'], 'L_ALLOW_COMMENT_WYSIWYG_EXPLAIN' => $lang['Allow_Wysiwyg_explain'], 'S_ALLOW_COMMENT_WYSIWYG_YES' => $allow_comment_wysiwyg_yes, 'S_ALLOW_COMMENT_WYSIWYG_NO' => $allow_comment_wysiwyg_no, 'L_ALLOW_COMMENT_HTML' => $lang['Allow_HTML'], 'L_ALLOW_COMMENT_HTML_EXPLAIN' => $lang['Allow_html_explain'], 'S_ALLOW_COMMENT_HTML_YES' => $allow_comment_html_yes, 'S_ALLOW_COMMENT_HTML_NO' => $allow_comment_html_no, 'L_ALLOW_COMMENT_BBCODE' => $lang['Allow_BBCode'], 'L_ALLOW_COMMENT_BBCODE_EXPLAIN' => $lang['Allow_bbcode_explain'], 'S_ALLOW_COMMENT_BBCODE_YES' => $allow_comment_bbcode_yes, 'S_ALLOW_COMMENT_BBCODE_NO' => $allow_comment_bbcode_no, 'L_ALLOW_COMMENT_SMILIES' => $lang['Allow_smilies'], 'L_ALLOW_COMMENT_SMILIES_EXPLAIN' => $lang['Allow_smilies_explain'], 'S_ALLOW_COMMENT_SMILIES_YES' => $allow_comment_smilies_yes, 'S_ALLOW_COMMENT_SMILIES_NO' => $allow_comment_smilies_no, 'L_ALLOWED_COMMENT_HTML_TAGS' => $lang['Allowed_tags'], 'L_ALLOWED_COMMENT_HTML_TAGS_EXPLAIN' => $lang['Allowed_tags_explain'], 'ALLOWED_COMMENT_HTML_TAGS' => $allowed_comment_html_tags, 'L_ALLOW_COMMENT_IMAGES' => $lang['Allow_images'], 'L_ALLOW_COMMENT_IMAGES_EXPLAIN' => $lang['Allow_images_explain'], 'S_ALLOW_COMMENT_IMAGES_YES' => $allow_comment_images_yes, 'S_ALLOW_COMMENT_IMAGES_NO' => $allow_comment_images_no, 'L_ALLOW_COMMENT_LINKS' => $lang['Allow_links'], 'L_ALLOW_COMMENT_LINKS_EXPLAIN' => $lang['Allow_links_explain'], 'S_ALLOW_COMMENT_LINKS_YES' => $allow_comment_links_yes, 'S_ALLOW_COMMENT_LINKS_NO' => $allow_comment_links_no, 'L_COMMENT_LINKS_MESSAGE' => $lang['Allow_links_message'], 'L_COMMENT_LINKS_MESSAGE_EXPLAIN' => $lang['Allow_links_message_explain'], 'COMMENT_MESSAGE_LINK' => $no_comment_link_message, 'L_COMMENT_IMAGES_MESSAGE' => $lang['Allow_images_message'], 'L_COMMENT_IMAGES_MESSAGE_EXPLAIN' => $lang['Allow_images_message_explain'], 'COMMENT_MESSAGE_IMAGE' => $no_comment_image_message, 'L_COMMENT_MAX_SUBJECT_CHAR' => $lang['Max_subject_char'], 'L_COMMENT_MAX_SUBJECT_CHAR_EXPLAIN' => $lang['Max_subject_char_explain'], 'COMMENT_MAX_SUBJECT_CHAR' => $max_comment_subject_chars, 'L_COMMENT_MAX_CHAR' => $lang['Max_char'], 'L_COMMENT_MAX_CHAR_EXPLAIN' => $lang['Max_char_explain'], 'COMMENT_MAX_CHAR' => $max_comment_chars, 'L_COMMENT_FORMAT_WORDWRAP' => $lang['Format_wordwrap'], 'L_COMMENT_FORMAT_WORDWRAP_EXPLAIN' => $lang['Format_wordwrap_explain'], 'S_COMMENT_FORMAT_WORDWRAP_YES' => $format_comment_wordwrap_yes, 'S_COMMENT_FORMAT_WORDWRAP_NO' => $format_comment_wordwrap_no, 'L_COMMENT_FORMAT_IMAGE_RESIZE' => $lang['Format_image_resize'], 'L_COMMENT_FORMAT_IMAGE_RESIZE_EXPLAIN' => $lang['Format_image_resize_explain'], 'COMMENT_FORMAT_IMAGE_RESIZE' => $format_comment_image_resize, 'L_COMMENT_FORMAT_TRUNCATE_LINKS' => $lang['Format_truncate_links'], 'L_COMMENT_FORMAT_TRUNCATE_LINKS_EXPLAIN' => $lang['Format_truncate_links_explain'], 'S_COMMENT_FORMAT_TRUNCATE_LINKS_YES' => $format_comment_truncate_links_yes, 'S_COMMENT_FORMAT_TRUNCATE_LINKS_NO' => $format_comment_truncate_links_no, 'L_COMMENTS_PAG' => $lang['Comments_pag'], 'L_COMMENTS_PAG_EXPLAIN' => $lang['Comments_pag_explain'], 'COMMENTS_PAG' => $comments_pag, 'L_DEL_TOPIC' => $lang['Del_topic'], 'L_DEL_TOPIC_EXPLAIN' => $lang['Del_topic_explain'], 'S_DEL_TOPIC_YES' => $del_topic_yes, 'S_DEL_TOPIC_NO' => $del_topic_no, // // Instructions // 'L_INSTRUCTIONS_TITLE' => $lang['Instructions_title'], 'L_PRE_TEXT_NAME' => $lang['Pre_text_name'], 'L_PRE_TEXT_EXPLAIN' => $lang['Pre_text_explain'], 'S_SHOW_PRETEXT' => $pretext_show, 'S_HIDE_PRETEXT' => $pretext_hide, 'S_DEFAULT_PRETEXT' => $pretext_default, 'L_SHOW' => $lang['Show'], 'L_HIDE' => $lang['Hide'], 'L_PRE_TEXT_HEADER' => $lang['Pre_text_header'], 'L_PT_HEADER' => $pt_header, 'L_PRE_TEXT_BODY' => $lang['Pre_text_body'], 'L_PT_BODY' => $pt_body, // // Notifications // 'L_NOTIFICATIONS_TITLE' => $lang['Notifications_title'], 'L_NOTIFY' => $lang['Notify'], 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], 'L_EMAIL' => $lang['Email'], 'L_PM' => $lang['PM'], 'S_NOTIFY_NONE' => $notify_none, 'S_NOTIFY_EMAIL' => $notify_email, 'S_NOTIFY_PM' => $notify_pm, 'L_NOTIFY_GROUP' => $lang['Notify_group'], 'L_NOTIFY_GROUP_EXPLAIN' => $lang['Notify_group_explain'], 'NOTIFY_GROUP' => $notify_group_list, )); $template->pparse( 'body' ); } } ?> --- NEW FILE: admin_auth_manage.php --- <?php /** * * @package mxBB Portal Module - mx_bugsbt * @version $Id: admin_auth_manage.php,v 1.1 2007/02/15 12:43:44 jonohlsson Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson, Mohd Basri, wGEric, PHP Arena, pafileDB, CRLin] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } class mx_bugsbt_auth_manage extends mx_bugsbt_admin { function main( $action ) { global $db, $images, $template, $lang, $phpEx, $mx_bugsbt_functions, $mx_bugsbt_cache, $bugsbt_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // // Includes // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); // // Start adminCP // if ( !isset( $_POST['submit'] ) ) { //$s_bugsbt_cat_list = $this->generate_jumpbox( '', 0, 0, 0, true ); $s_bugsbt_cat_list = $this->generate_jumpbox( ); $template->set_filenames( array( 'body' => 'admin/bugsbt_cat_select_body.tpl' ) ); $template->assign_vars( array( 'L_AUTH_TITLE' => $lang['bugsbt_Auth_Title'], 'L_AUTH_EXPLAIN' => $lang['bugsbt_Auth_Explain'], 'L_SELECT_CAT' => $lang['Select_a_Category'], 'S_ACTION' => append_sid( "admin_bugsbt.$phpEx?action=auth_manage" ), 'L_LOOK_UP_CAT' => $lang['Look_up_Category'], 'CAT_SELECT_TITLE' => $s_bugsbt_cat_list )); $template->pparse( 'body' ); } else { if ( !isset( $_GET['cat_id'] ) ) { $cat_id = $mx_request_vars->request('cat_id', MX_TYPE_INT, ''); $template->set_filenames( array( 'body' => 'admin/bugsbt_cat_auth_body.tpl' ) ); $template->assign_vars( array( 'L_AUTH_TITLE' => $lang['bugsbt_Auth_Title'], 'L_AUTH_EXPLAIN' => $lang['bugsbt_Auth_Explain'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_GROUPS' => $lang['Usergroups'], 'L_VIEW' => $lang['View'], 'L_EDIT' => $lang['Edit'], 'L_DELETE' => $lang['Delete'], 'L_UPLOAD' => $lang['Upload'], 'L_RATE' => $lang['Rate'], 'L_VIEW_COMMENT' => $lang['View_Comment_level'], 'L_POST_COMMENT' => $lang['Post_Comment_level'], 'L_EDIT_COMMENT' => $lang['Edit_Comment_level'], 'L_DELETE_COMMENT' => $lang['Delete_Comment_level'], 'L_IS_MODERATOR' => $lang['Is_Moderator'], 'S_ALBUM_ACTION' => append_sid( "admin_bugsbt.$phpEx?action=auth_manage&cat_id=$cat_id" ), )); // // Get the list of phpBB usergroups // $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " WHERE group_single_user <> " . true . " ORDER BY group_name ASC"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql ); } while ( $bugsbt_row = $db->sql_fetchrow( $result ) ) { $groupdata[] = $bugsbt_row; } // // Get info of this cat // $sql = "SELECT * FROM " . BUGSBT_PRODUCTS_TABLE . " WHERE category_id = '$cat_id'"; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not get Category information', '', __LINE__, __FILE__, $sql ); } $thiscat = $db->sql_fetchrow( $result ); $view_groups = @explode( ',', $thiscat['auth_view_groups'] ); $edit_groups = @explode( ',', $thiscat['auth_edit_groups'] ); $delete_groups = @explode( ',', $thiscat['auth_delete_groups'] ); $post_groups = @explode( ',', $thiscat['auth_post_groups'] ); $rate_groups = @explode( ',', $thiscat['auth_rate_groups'] ); $comment_view_groups = @explode( ',', $thiscat['auth_view_comment_groups'] ); $comment_post_groups = @explode( ',', $thiscat['auth_post_comment_groups'] ); $comment_edit_groups = @explode( ',', $thiscat['auth_edit_comment_groups'] ); $comment_delete_groups = @explode( ',', $thiscat['auth_delete_comment_groups'] ); $moderator_groups = @explode( ',', $thiscat['auth_moderator_groups'] ); for ( $i = 0; $i < count( $groupdata ); $i++ ) { $template->assign_block_vars( 'grouprow', array( 'GROUP_ID' => $groupdata[$i]['group_id'], 'GROUP_NAME' => $groupdata[$i]['group_name'], 'VIEW_CHECKED' => $thiscat['auth_view'] != AUTH_ACL ? 'disabled' : (( in_array( $groupdata[$i]['group_id'], $view_groups ) ) ? 'checked="checked"' : ''), 'EDIT_CHECKED' => $thiscat['auth_edit'] != AUTH_ACL ? 'disabled' : (( in_array( $groupdata[$i]['group_id'], $edit_groups ) ) ? 'checked="checked"' : ''), 'DELETE_CHECKED' => $thiscat['auth_delete'] != AUTH_ACL ? 'disabled' : (( in_array( $groupdata[$i]['group_id'], $delete_groups ) ) ? 'checked="checked"' : ''), 'POST_CHECKED' => $thiscat['auth_post'] != AUTH_ACL ? 'disabled' : (( in_array( $groupdata[$i]['group_id'], $post_groups ) ) ? 'checked="checked"' : ''), 'RATE_CHECKED' => $thiscat['auth_rate'] != AUTH_ACL ? 'disabled' : (( in_array( $groupdata[$i]['group_id'], $rate_groups ) ) ? 'checked="checked"' : ''), 'COMMENT_VIEW_CHECKED' => $thiscat['auth_view_comment'] != AUTH_ACL ? 'disabled' : (( in_array( $groupdata[$i]['group_id'], $comment_view_groups ) ) ? 'checked="checked"' : ''), 'COMMENT_POST_CHECKED' => $thiscat['auth_post_comment'] != AUTH_ACL ? 'disabled' : (( in_array( $groupdata[$i]['group_id'], $comment_post_groups ) ) ? 'checked="checked"' : ''), 'COMMENT_EDIT_CHECKED' => $thiscat['auth_edit_comment'] != AUTH_ACL ? 'disabled' : (( in_array( $groupdata[$i]['group_id'], $comment_edit_groups ) ) ? 'checked="checked"' : ''), 'COMMENT_DELETE_CHECKED' => $thiscat['auth_delete_comment'] != AUTH_ACL ? 'disabled' : (( in_array( $groupdata[$i]['group_id'], $comment_delete_groups ) ) ? 'checked="checked"' : ''), 'MODERATOR_CHECKED' => (( in_array( $groupdata[$i]['group_id'], $moderator_groups ) ) ? 'checked="checked"' : '') )); } $template->pparse( 'body' ); } else { $cat_id = $mx_request_vars->request('cat_id', MX_TYPE_INT, ''); $view_groups = @implode( ',', $_POST['view'] ); $edit_groups = @implode( ',', $_POST['edit'] ); $delete_groups = @implode( ',', $_POST['delete'] ); $post_groups = @implode( ',', $_POST['post'] ); $rate_groups = @implode( ',', $_POST['rate'] ); $comment_view_groups = @implode( ',', $_POST['view_comment'] ); $comment_post_groups = @implode( ',', $_POST['post_comment'] ); $comment_edit_groups = @implode( ',', $_POST['edit_comment'] ); $comment_delete_groups = @implode( ',', $_POST['delete_comment'] ); $moderator_groups = @implode( ',', $_POST['moderator'] ); $sql = "UPDATE " . BUGSBT_PRODUCTS_TABLE . " SET auth_view_groups = '$view_groups', auth_post_groups = '$post_groups', auth_view_comment_groups = '$comment_view_groups', auth_post_comment_groups = '$comment_post_groups', auth_edit_comment_groups = '$comment_edit_groups', auth_delete_comment_groups = '$comment_delete_groups', auth_edit_groups = '$edit_groups', auth_delete_groups = '$delete_groups', auth_approval_groups = '$approval_groups', auth_approval_edit_groups = '$approval_edit_groups', auth_moderator_groups = '$moderator_groups' WHERE category_id = '$cat_id'"; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not update bugsbt config table', '', __LINE__, __FILE__, $sql ); } $message = $lang['bugsbt_Auth_successfully'] . '<br /><br />' . sprintf( $lang['Click_r... [truncated message content] |