Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26925/admin Modified Files: admin_mx_block.php admin_mx_block_auth.php admin_mx_chkobjs.php admin_mx_gen_cache.php admin_mx_menu.php admin_mx_meta.php admin_mx_module.php admin_mx_page.php admin_mx_page_auth.php admin_mx_page_setting.php admin_mx_page_template_setting.php admin_mx_phpinfo.php admin_mx_portal.php index.php page_footer_admin.php page_header_admin.php pagestart.php Log Message: Normalize initialization in ACP scripts, more code cleanup and a couple bugs. Index: admin_mx_phpinfo.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_phpinfo.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_mx_phpinfo.php 20 Mar 2005 22:59:55 -0000 1.4 --- admin_mx_phpinfo.php 28 Apr 2005 04:13:50 -0000 1.5 *************** *** 19,36 **** */ ! if ( !empty($setmodules) ) { ! $file = basename(__FILE__); ! $module['Portal - System']['phpInfo'] = 'admin/' . $file; return; } - define('IN_PORTAL', 1); - $mx_root_path = '../'; - // ! // Security and page header // ! require('./pagestart.php'); // --- 19,36 ---- */ ! if( !empty($setmodules) ) { ! $module['Portal - System']['phpInfo'] = 'admin/' . basename(__FILE__); return; } // ! // Security and Page header // ! define('IN_PORTAL', 1); ! $mx_root_path = './../'; ! require($mx_root_path . 'extension.inc'); ! require('./pagestart.' . $phpEx); ! // Index: admin_mx_page_auth.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_page_auth.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin_mx_page_auth.php 6 Mar 2005 01:10:13 -0000 1.2 --- admin_mx_page_auth.php 28 Apr 2005 04:13:50 -0000 1.3 *************** *** 19,42 **** */ ! define( 'IN_PORTAL', 1 ); ! ! if ( !empty( $setmodules ) ) { ! $filename = basename( __FILE__ ); ! $module['Portal - Pages']['Private Permissions'] = 'admin/' . $filename; return; } ! define( 'IN_PORTAL', 1 ); ! $mx_root_path = '../'; ! require( $mx_root_path . 'admin/pagestart.php' ); // HERE ! // Mode setting ! ! if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) { ! $mode = ( isset( $HTTP_POST_VARS['mode'] ) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars( $mode ); } else --- 19,43 ---- */ ! if( !empty($setmodules) ) { ! $module['Portal - Pages']['Private Permissions'] = 'admin/' . basename( __FILE__ ); return; } + // + // Security and Page header + // + define('IN_PORTAL', 1); + $mx_root_path = './../'; + require($mx_root_path . 'extension.inc'); + require('./pagestart.' . $phpEx); ! // // Mode setting ! // ! if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) { ! $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars($mode); } else *************** *** 47,158 **** $album_user_id = ALBUM_PUBLIC_GALLERY; ! if ( !isset( $HTTP_POST_VARS['submit'] ) ) { ! $s_page_list = get_list_formatted( 'page_list', $page_id, 'cat_id' ); ! $template->set_filenames( array( 'body' => 'admin/mx_auth_select_body.tpl' ) ! ); ! $template->assign_vars( array( 'L_AUTH_TITLE' => $lang['Mx_Page_Auth_Title'], ! 'L_AUTH_EXPLAIN' => $lang['Mx_Page_Auth_Explain'], ! 'L_SELECT_AUTH' => $lang['Auth_Page'], ! 'S_AUTH_ACTION' => append_sid( "admin_mx_page_auth.$phpEx" ), ! 'L_LOOK_UP_AUTH' => $lang['Change'], ! 'AUTH_SELECT_TITLE' => $s_page_list ) ! ); ! $template->pparse( 'body' ); ! include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } else { ! if ( !isset( $HTTP_GET_VARS['cat_id'] ) ) { ! $cat_id = intval( $HTTP_POST_VARS['cat_id'] ); ! $template->set_filenames( array( 'body' => 'admin/mx_page_auth_body.tpl' ) ! ); ! $template->assign_vars( array( 'L_AUTH_TITLE' => $lang['Mx_Page_Auth_Title'], ! 'L_AUTH_EXPLAIN' => $lang['Mx_Page_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_IS_MODERATOR' => $lang['Is_Moderator'], - 'S_AUTH_ACTION' => append_sid( "admin_mx_page_auth.$phpEx?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 ( $row = $db->sql_fetchrow( $result ) ) { $groupdata[] = $row; ! } // Get info of this cat $sql = "SELECT page_id, page_name, auth_view_group, auth_moderator_group ! FROM " . PAGE_TABLE . " ! WHERE page_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_group'] ); ! $moderator_groups = @explode( ',', $thiscat['auth_moderator_group'] ); ! 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' => ( in_array( $groupdata[$i]['group_id'], $view_groups ) ) ? 'checked="checked"' : '', ! ! 'MODERATOR_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $moderator_groups ) ) ? 'checked="checked"' : '' ) ! ); } ! $template->pparse( 'body' ); ! ! include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } else { $cat_id = intval( $HTTP_GET_VARS['cat_id'] ); ! ! $view_groups = @implode( ',', $HTTP_POST_VARS['view'] ); ! ! $moderator_groups = @implode( ',', $HTTP_POST_VARS['moderator'] ); $sql = "UPDATE " . PAGE_TABLE . " ! SET auth_view_group = '$view_groups', auth_moderator_group = '$moderator_groups' ! WHERE page_id = '$cat_id'"; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not update Page config table', '', __LINE__, __FILE__, $sql ); } ! $message = $lang['Page_Auth_successfully'] . '<br /><br />' . sprintf( $lang['Click_return_page_auth'], '<a href="' . append_sid( "admin_mx_page_auth.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); // Update cache ! update_session_cache( $block_id ); ! ! mx_message_die( GENERAL_MESSAGE, $message ); } } --- 48,160 ---- $album_user_id = ALBUM_PUBLIC_GALLERY; ! if( !isset($HTTP_POST_VARS['submit']) ) { + $s_page_list = get_list_formatted('page_list', $page_id, 'cat_id'); ! $template->set_filenames(array( ! 'body' => 'admin/mx_auth_select_body.tpl') ! ); ! $template->assign_vars(array( ! 'L_AUTH_TITLE' => $lang['Mx_Page_Auth_Title'], ! 'L_AUTH_EXPLAIN' => $lang['Mx_Page_Auth_Explain'], ! 'L_SELECT_AUTH' => $lang['Auth_Page'], ! 'S_AUTH_ACTION' => append_sid("admin_mx_page_auth.$phpEx"), ! 'L_LOOK_UP_AUTH' => $lang['Change'], ! 'AUTH_SELECT_TITLE' => $s_page_list) ! ); ! $template->pparse('body'); ! include($mx_root_path . 'admin/page_footer_admin.' . $phpEx); } else { ! if( !isset($HTTP_GET_VARS['cat_id']) ) { ! $cat_id = intval($HTTP_POST_VARS['cat_id']); ! $template->set_filenames(array( ! 'body' => 'admin/mx_page_auth_body.tpl') ! ); ! $template->assign_vars(array( ! 'L_AUTH_TITLE' => $lang['Mx_Page_Auth_Title'], ! 'L_AUTH_EXPLAIN' => $lang['Mx_Page_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_IS_MODERATOR' => $lang['Is_Moderator'], ! 'S_AUTH_ACTION' => append_sid("admin_mx_page_auth.$phpEx?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( $row = $db->sql_fetchrow($result) ) { $groupdata[] = $row; ! } ! // Get info of this cat $sql = "SELECT page_id, page_name, auth_view_group, auth_moderator_group ! FROM " . PAGE_TABLE . " ! WHERE page_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_group']); ! $moderator_groups = @explode(',', $thiscat['auth_moderator_group']); ! 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' => ( in_array($groupdata[$i]['group_id'], $view_groups) ) ? 'checked="checked"' : '', ! 'MODERATOR_CHECKED' => ( in_array($groupdata[$i]['group_id'], $moderator_groups) ) ? 'checked="checked"' : '') ! ); } ! $template->pparse('body'); ! include($mx_root_path . 'admin/page_footer_admin.' . $phpEx); } else { $cat_id = intval( $HTTP_GET_VARS['cat_id'] ); ! $view_groups = @implode(',', $HTTP_POST_VARS['view']); ! $moderator_groups = @implode(',', $HTTP_POST_VARS['moderator']); $sql = "UPDATE " . PAGE_TABLE . " ! SET auth_view_group = '$view_groups', auth_moderator_group = '$moderator_groups' ! WHERE page_id = '$cat_id'"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not update Page config table', '', __LINE__, __FILE__, $sql); } ! $message = $lang['Page_Auth_successfully'] . '<br /><br />' . sprintf($lang['Click_return_page_auth'], '<a href="' . append_sid("admin_mx_page_auth.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid($mx_root_path . "admin/index.$phpEx?pane=right") . '">', '</a>'); // Update cache ! update_session_cache($block_id); ! ! mx_message_die(GENERAL_MESSAGE, $message); } } Index: admin_mx_chkobjs.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_chkobjs.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** admin_mx_chkobjs.php 26 Apr 2005 22:51:44 -0000 1.9 --- admin_mx_chkobjs.php 28 Apr 2005 04:13:49 -0000 1.10 *************** *** 24,42 **** // ====================================================== - $no_page_header = TRUE; - if( !empty($setmodules) ) { ! $module['Portal - System']['Objects_Integrity_Check'] = 'admin/' . basename(__FILE__); return; } - define('IN_PORTAL', 1); - $mx_root_path = '../'; - // ! // Security and page header // ! require('./pagestart.php'); --- 24,41 ---- // ====================================================== if( !empty($setmodules) ) { ! $module['Portal - System']['Integrity_Checker'] = 'admin/' . basename(__FILE__); return; } // ! // Security and Page header // ! define('IN_PORTAL', 1); ! $mx_root_path = './../'; ! require($mx_root_path . 'extension.inc'); ! $no_page_header = TRUE; ! require('./pagestart.' . $phpEx); Index: admin_mx_gen_cache.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_gen_cache.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** admin_mx_gen_cache.php 25 Apr 2005 12:18:44 -0000 1.15 --- admin_mx_gen_cache.php 28 Apr 2005 04:13:49 -0000 1.16 *************** *** 19,25 **** */ ! $no_page_header = true; ! ! if ( !empty($setmodules) ) { $module['Portal - System']['Generate cache'] = 'admin/' . basename(__FILE__); --- 19,23 ---- */ ! if( !empty($setmodules) ) { $module['Portal - System']['Generate cache'] = 'admin/' . basename(__FILE__); *************** *** 27,51 **** } define('IN_PORTAL', 1); ! $mx_root_path = '../'; ! ! // Security and page header - require('./pagestart.php'); // Getting mode of operation ! $generate = ( $mx_request_vars->request('generate', MX_TYPE_INT, 0) == 1 ? true : false ); ! // Load default template for install ! $template->set_filenames(array( 'body' => 'admin/admin_message_body.tpl') ); // Main procedure ! ! if ( !$generate ) { $message = $lang['Cache_explain'] . '<br /> <br /> <br />'; --- 25,54 ---- } + // + // Security and Page header + // define('IN_PORTAL', 1); ! $mx_root_path = './../'; ! require($mx_root_path . 'extension.inc'); ! $no_page_header = TRUE; ! require('./pagestart.' . $phpEx); + // // Getting mode of operation ! // $generate = ( $mx_request_vars->request('generate', MX_TYPE_INT, 0) == 1 ? true : false ); ! // // Load default template for install ! // $template->set_filenames(array( 'body' => 'admin/admin_message_body.tpl') ); + // // Main procedure ! // ! if( !$generate ) { $message = $lang['Cache_explain'] . '<br /> <br /> <br />'; *************** *** 63,71 **** @chmod($cache_dir, 0777); ! if ( !is_writable($cache_dir) ) { $message = $lang['Cache_dir_write_protect']; ! mx_message_die(GENERAL_MESSAGE, $message, ''); ! exit; } --- 66,73 ---- @chmod($cache_dir, 0777); ! if( !is_writable($cache_dir) ) { $message = $lang['Cache_dir_write_protect']; ! mx_message_die(GENERAL_MESSAGE, $message); } *************** *** 125,129 **** --- 127,133 ---- */ + // // Update cache + // update_session_cache($block_id); Index: admin_mx_page_template_setting.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_page_template_setting.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_mx_page_template_setting.php 1 Feb 2005 20:40:43 -0000 1.4 --- admin_mx_page_template_setting.php 28 Apr 2005 04:13:50 -0000 1.5 *************** *** 19,44 **** */ ! $no_page_header = true; ! ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); ! $module['Portal - Pages']['Page_Templates'] = 'admin/' . $file; return; } ! define( 'IN_PORTAL', 1 ); ! $mx_root_path = '../'; ! ! // Security and page header ! ! require( './pagestart.php' ); // Mode setting ! ! if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) { ! $mode = ( isset( $HTTP_POST_VARS['mode'] ) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars( $mode ); } else --- 19,44 ---- */ ! if( !empty($setmodules) ) { ! $module['Portal - Pages']['Page_Templates'] = 'admin/' . basename(__FILE__); return; } ! // ! // Security and Page header ! // ! define('IN_PORTAL', 1); ! $mx_root_path = './../'; ! require($mx_root_path . 'extension.inc'); ! $no_page_header = TRUE; ! require('./pagestart.' . $phpEx); + // // Mode setting ! // ! if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) { ! $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars($mode); } else *************** *** 47,80 **** } ! if ( isset( $HTTP_POST_VARS['page_template_id'] ) || isset( $HTTP_GET_VARS['page_template_id'] ) ) { ! $page_template_id = ( isset( $HTTP_POST_VARS['page_template_id'] ) ) ? $HTTP_POST_VARS['page_template_id'] : $HTTP_GET_VARS['page_template_id']; ! $page_template_id = htmlspecialchars( $page_template_id ); } else { ! $page_template_id = 2; // select 2 columns left by default -> we don't want to edit NONE (page_template_id = 1) } ! if ( isset( $HTTP_POST_VARS['addcolumn'] ) ) { ! $mode = "addcolumn"; } ! if ( isset( $HTTP_POST_VARS['addtemplate'] ) ) { ! $mode = "addtemplate"; } ! if ( isset( $HTTP_POST_VARS['insertcolumn'] ) ) { ! $mode = "insertcolumn"; } ! function templates_renumber_order( $mode, $column = 0, $page_template_id ) { global $db; ! switch ( $mode ) { case 'column': --- 47,80 ---- } ! if( isset($HTTP_POST_VARS['page_template_id']) || isset($HTTP_GET_VARS['page_template_id']) ) { ! $page_template_id = ( isset($HTTP_POST_VARS['page_template_id']) ) ? $HTTP_POST_VARS['page_template_id'] : $HTTP_GET_VARS['page_template_id']; ! $page_template_id = htmlspecialchars($page_template_id); } else { ! $page_template_id = 2; // select 2 columns left by default -> we don't want to edit NONE (page_template_id = 1) } ! if( isset($HTTP_POST_VARS['addcolumn']) ) { ! $mode = 'addcolumn'; } ! if( isset($HTTP_POST_VARS['addtemplate']) ) { ! $mode = 'addtemplate'; } ! if( isset($HTTP_POST_VARS['insertcolumn']) ) { ! $mode = 'insertcolumn'; } ! function templates_renumber_order($mode, $column = 0, $page_template_id) { global $db; ! switch( $mode ) { case 'column': *************** *** 86,90 **** default: ! mx_message_die( GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__ ); break; } --- 86,90 ---- default: ! mx_message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); break; } *************** *** 92,98 **** $sql = "SELECT * FROM $table WHERE page_template_id = $page_template_id ORDER BY $orderfield ASC"; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't get list of Columns", "", __LINE__, __FILE__, $sql ); } --- 92,98 ---- $sql = "SELECT * FROM $table WHERE page_template_id = $page_template_id ORDER BY $orderfield ASC"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't get list of Columns", "", __LINE__, __FILE__, $sql); } *************** *** 100,177 **** $inc = 10; ! while ( $row = $db->sql_fetchrow( $result ) ) { $sql = "UPDATE $table SET $orderfield = $i WHERE $idfield = " . $row[$idfield]; ! if ( !$db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't update order fields", "", __LINE__, __FILE__, $sql ); } $i += 10; } } ! // End function block // ------------------ // Begin program proper ! ! if ( !empty( $mode ) ) { ! switch ( $mode ) { case 'addtemplate': $template_name = $HTTP_POST_VARS['templatename']; ! $sql = "INSERT INTO " . PAGE_TEMPLATES . " ( template_name ) ! VALUES ( '$template_name' )"; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't add new template", "", __LINE__, __FILE__, $sql ); } ! $message = $lang['Template_Config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_page_admin'], "<a href=\"" . append_sid( "admin_mx_page_template_setting.php?template_id=$template_id" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . append_sid( "index.php?pane=right" ) . "\">", "</a>" ); ! ! mx_message_die( GENERAL_MESSAGE, $message ); ! break; ! case 'column_order': ! // Change order of column in the DB ! ! $column_id = intval( $HTTP_GET_VARS[column_id] ); ! $move = intval( $HTTP_GET_VARS['move'] ); $sql = "UPDATE " . COLUMN_TEMPLATES . " ! SET column_order = column_order + $move ! WHERE column_id = $column_id"; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't change column order", "", __LINE__, __FILE__, $sql ); } ! renumber_order( 'column', 0, $template_id ); $show_index = true; - break; case 'addcolumn': ! case 'editcolumn': ! // Show form to edit a column ! ! $column_template_id = intval( $HTTP_GET_VARS[column_template_id] ); $s_hidden_fields = '<input type="hidden" name="column_id" value="' . $column_template_id . '" />'; ! if ( $column_template_id == 0 ) { $buttonvalue = $lang['Submit']; $newmode = 'insertcolumn'; $column_title = $HTTP_POST_VARS['columnname']; ! $column_size = "100%"; } else --- 100,174 ---- $inc = 10; ! while( $row = $db->sql_fetchrow($result) ) { $sql = "UPDATE $table SET $orderfield = $i WHERE $idfield = " . $row[$idfield]; ! if( !($db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't update order fields", "", __LINE__, __FILE__, $sql); } $i += 10; } } ! // // End function block // ------------------ + // // Begin program proper ! // ! if( !empty($mode) ) { ! switch( $mode ) { case 'addtemplate': $template_name = $HTTP_POST_VARS['templatename']; ! $sql = "INSERT INTO " . PAGE_TEMPLATES . " ( template_name ) VALUES ( '$template_name' )"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't add new template", "", __LINE__, __FILE__, $sql); } ! $message = $lang['Template_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_page_admin'], "<a href=\"" . append_sid("admin_mx_page_template_setting.php?template_id=$template_id") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>"); ! mx_message_die(GENERAL_MESSAGE, $message); break; ! case 'column_order': ! // // Change order of column in the DB ! // ! $column_id = intval($HTTP_GET_VARS[column_id]); ! $move = intval($HTTP_GET_VARS['move']); $sql = "UPDATE " . COLUMN_TEMPLATES . " ! SET column_order = column_order + $move ! WHERE column_id = $column_id"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't change column order", "", __LINE__, __FILE__, $sql); } ! renumber_order('column', 0, $template_id); $show_index = true; break; case 'addcolumn': ! case 'editcolumn': ! // // Show form to edit a column ! // ! $column_template_id = intval($HTTP_GET_VARS['column_template_id']); $s_hidden_fields = '<input type="hidden" name="column_id" value="' . $column_template_id . '" />'; ! if( $column_template_id == 0 ) { $buttonvalue = $lang['Submit']; $newmode = 'insertcolumn'; $column_title = $HTTP_POST_VARS['columnname']; ! $column_size = '100%'; } else *************** *** 179,359 **** $buttonvalue = $lang['Update']; $newmode = 'modcolumn'; ! $row = get_info( COLUMN_TEMPLATES, 'column_template_id', $column_template_id ); ! $column_title = $row['column_title'] ; ! $column_size = $row['column_size'] ; } ! $template->set_filenames( array( "edit_column" => "admin/mx_page_admin_column_template.tpl" ) ! ); $s_hidden_fields = '<input type="hidden" name="mode" value="' . $newmode . '" /><input type="hidden" name="column_template_id" value="' . $column_template_id . '" />'; ! $template->assign_vars( array( 'COLUMN_TITLE' => $column_title, ! 'L_EDIT_COLUMN' => $lang['Edit_Column'], ! 'L_EDIT_COLUMN_EXPLAIN' => $lang['Edit_Column_explain'], ! 'L_COLUMN' => $lang['Column'], ! 'L_COLUMN_SIZE' => $lang['Column_Size'] , ! 'COLUMN_SIZE' => $column_size, ! 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_SUBMIT_VALUE' => $buttonvalue ! ) ); ! define( 'IN_ADMIN', 1 ); ! include_once( './page_header_admin.' . $phpEx ); ! $template->pparse( "edit_column" ); break; ! case 'insertcolumn': // Create a column in the DB ! $sql = "SELECT MAX(column_order) AS max_order ! FROM " . COLUMN_TEMPLATES; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't get order number from column template table", "", __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $result ); $max_order = $row['max_order']; $next_order = $max_order + 10; ! // There is no problem having duplicate page names so we won't check for it. ! $sql = "INSERT INTO " . COLUMN_TEMPLATES . " (column_title, column_order, column_size, page_template_id) ! VALUES ('" . $HTTP_POST_VARS['column_title'] . "', $next_order, '" . $HTTP_POST_VARS['column_size'] . "', $page_template_id)"; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't insert row in column table", "", __LINE__, __FILE__, $sql ); } ! $message = $lang['Page_Config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_page_admin'], "<a href=\"" . append_sid( "admin_mx_page_template_setting.php?page_template_id=$page_template_id" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . append_sid( "index.php?pane=right" ) . "\">", "</a>" ); ! ! mx_message_die( GENERAL_MESSAGE, $message ); ! break; ! case 'modcolumn': // Modify a column in the DB $sql = "UPDATE " . COLUMN_TEMPLATES . " ! SET column_title = '" . str_replace( "\'", "''", $HTTP_POST_VARS['column_title'] ) . "' ! , column_size = '" . str_replace( "\'", "''", $HTTP_POST_VARS['column_size'] ) . "' ! WHERE column_template_id = " . intval( $HTTP_POST_VARS['column_template_id'] ); ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't update block information", "", __LINE__, __FILE__, $sql ); } ! $message = $lang['Page_Config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_page_admin'], "<a href=\"" . append_sid( "admin_mx_page_template_setting.php?page_template_id=$page_template_id" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . append_sid( "index.php?pane=right" ) . "\">", "</a>" ); ! mx_message_die( GENERAL_MESSAGE, $message ); ! break; ! case 'deletetemplate': // Delete a template from the DB ! $sql = "DELETE FROM " . PAGE_TEMPLATES . " WHERE page_template_id = " . intval( $HTTP_GET_VARS['page_template_id'] ) ; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't delete page template information", "", __LINE__, __FILE__, $sql ); } ! $sql = "DELETE FROM " . COLUMN_TEMPLATES . " WHERE page_template_id = " . intval( $HTTP_GET_VARS[page_template_id] ) ; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't delete column information", "", __LINE__, __FILE__, $sql ); } ! $message = $lang['Page_Config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_page_admin'], "<a href=\"" . append_sid( "admin_mx_page_template_setting.php" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . append_sid( "index.php?pane=right" ) . "\">", "</a>" ); ! mx_message_die( GENERAL_MESSAGE, $message ); ! break; ! case 'deletecolumn' : // Delete a column in the DB ! $sql = "DELETE FROM " . COLUMN_TEMPLATES . " WHERE column_template_id = " . intval( $HTTP_GET_VARS[column_template_id] ) ; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't delete column information", "", __LINE__, __FILE__, $sql ); } - $message = $lang['Page_Config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_page_admin'], "<a href=\"" . append_sid( "admin_mx_page_template_setting.php?page_template_id=$page_template_id" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . append_sid( "index.php?pane=right" ) . "\">", "</a>" ); - mx_message_die( GENERAL_MESSAGE, $message ); break; default: ! print( $mode ); ! mx_message_die( GENERAL_MESSAGE, $lang['No_mode'] ); break; } ! if ( $show_index != true ) { ! include_once( './page_footer_admin.' . $phpEx ); exit; } } // Start page proper ! ! $template->set_filenames( array( "admin_page_template" => "admin/mx_page_template_admin_body.tpl" ) ! ); $sql = "SELECT * FROM " . PAGE_TEMPLATES . " WHERE page_template_id <> 1 ORDER BY page_template_id"; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Couldn't get list of Column/blocks", "", __LINE__, __FILE__, $sql ); } $templatelist = '<select name="page_template_id">'; ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $s = ""; ! if ( $row['page_template_id'] == $page_template_id ) ! { ! $s = " selected=\"selected\""; ! } ! $templatelist .= "<option value=\"$row[page_template_id]\"$s>" . $row['template_name'] . "</option>\n"; } $templatelist .= "</select>"; ! $template->assign_vars( array( 'S_ACTION' => append_sid( "admin_mx_page_template_setting.$phpEx?mode=addblock&page_template_id=$page_template_id" ), ! 'S_PAGE_ACTION' => append_sid( "admin_mx_page_template_setting.$phpEx" ), ! 'L_TITLE' => $lang['Page_templates_admin'], ! 'L_EXPLAIN' => $lang['Page_templates_admin_explain'], ! 'L_TEMPLATE_DELETE' => $lang['Page_template_delete'], ! 'U_TEMPLATE_DELETE' => append_sid( "admin_mx_page_template_setting.$phpEx?mode=deletetemplate&page_template_id=$page_template_id" ), ! 'U_PHPBB_ROOT_PATH' => PHPBB_URL, ! 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, ! 'TEMPLATELIST' => $templatelist, ! 'L_CREATE_TEMPLATE' => $lang['Add_Template'], ! 'L_TEMPLATE' => $lang['Template'] , ! 'L_CREATE_COLUMN' => $lang['Create_column'], ! 'L_EDIT' => $lang['Edit'], ! 'L_DELETE' => $lang['Delete'], ! 'L_SETTING' => $lang['Settings'], ! 'L_MOVE_UP' => $lang['Move_up'], ! 'L_MOVE_DOWN' => $lang['Move_down'], ! 'L_CHANGE_NOW' => $lang['Change'] ! ) ); $sql = "SELECT column_template_id, column_title, column_order ! FROM " . COLUMN_TEMPLATES . " ! WHERE page_template_id = $page_template_id ! ORDER BY page_template_id, column_order"; ! if ( !$q_column = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Could not query column list", "", __LINE__, __FILE__, $sql ); } ! if ( $total_column = $db->sql_numrows( $q_column ) ) { ! $column_rows = $db->sql_fetchrowset( $q_column ); ! // Okay, let's build the index ! for( $i = 0; $i < $total_column; $i++ ) { --- 176,362 ---- $buttonvalue = $lang['Update']; $newmode = 'modcolumn'; ! $row = get_info(COLUMN_TEMPLATES, 'column_template_id', $column_template_id); ! $column_title = $row['column_title']; ! $column_size = $row['column_size']; } ! ! $template->set_filenames(array( ! 'edit_column' => 'admin/mx_page_admin_column_template.tpl') ! ); $s_hidden_fields = '<input type="hidden" name="mode" value="' . $newmode . '" /><input type="hidden" name="column_template_id" value="' . $column_template_id . '" />'; ! $template->assign_vars(array( ! 'COLUMN_TITLE' => $column_title, ! 'L_EDIT_COLUMN' => $lang['Edit_Column'], ! 'L_EDIT_COLUMN_EXPLAIN' => $lang['Edit_Column_explain'], ! 'L_COLUMN' => $lang['Column'], ! 'L_COLUMN_SIZE' => $lang['Column_Size'], ! 'COLUMN_SIZE' => $column_size, ! 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_SUBMIT_VALUE' => $buttonvalue ! )); ! define('IN_ADMIN', 1); ! include_once('./page_header_admin.' . $phpEx); ! $template->pparse('edit_column'); break; ! case 'insertcolumn': ! // // Create a column in the DB ! // ! $sql = "SELECT MAX(column_order) AS max_order FROM " . COLUMN_TEMPLATES; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't get order number from column template table", "", __LINE__, __FILE__, $sql); } ! $row = $db->sql_fetchrow($result); $max_order = $row['max_order']; $next_order = $max_order + 10; ! ! // // There is no problem having duplicate page names so we won't check for it. ! // $sql = "INSERT INTO " . COLUMN_TEMPLATES . " (column_title, column_order, column_size, page_template_id) ! VALUES ('" . $HTTP_POST_VARS['column_title'] . "', $next_order, '" . $HTTP_POST_VARS['column_size'] . "', $page_template_id)"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't insert row in column table", "", __LINE__, __FILE__, $sql); } ! $message = $lang['Page_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_page_admin'], "<a href=\"" . append_sid("admin_mx_page_template_setting.php?page_template_id=$page_template_id") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>"); ! mx_message_die(GENERAL_MESSAGE, $message); break; ! case 'modcolumn': ! // // Modify a column in the DB + // $sql = "UPDATE " . COLUMN_TEMPLATES . " ! SET column_title = '" . str_replace("\'", "''", $HTTP_POST_VARS['column_title']) . "', ! column_size = '" . str_replace("\'", "''", $HTTP_POST_VARS['column_size']) . "' ! WHERE column_template_id = " . intval($HTTP_POST_VARS['column_template_id']); ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't update block information", "", __LINE__, __FILE__, $sql); } ! $message = $lang['Page_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_page_admin'], "<a href=\"" . append_sid("admin_mx_page_template_setting.php?page_template_id=$page_template_id") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>"); ! mx_message_die(GENERAL_MESSAGE, $message); break; ! case 'deletetemplate': ! // // Delete a template from the DB ! // ! $sql = "DELETE FROM " . PAGE_TEMPLATES . " WHERE page_template_id = " . intval($HTTP_GET_VARS['page_template_id']); ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't delete page template information", "", __LINE__, __FILE__, $sql); } ! $sql = "DELETE FROM " . COLUMN_TEMPLATES . " WHERE page_template_id = " . intval($HTTP_GET_VARS['page_template_id']); ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't delete column information", "", __LINE__, __FILE__, $sql); } ! $message = $lang['Page_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_page_admin'], "<a href=\"" . append_sid("admin_mx_page_template_setting.php") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>"); ! mx_message_die(GENERAL_MESSAGE, $message); break; ! case 'deletecolumn': ! // // Delete a column in the DB ! // ! $sql = "DELETE FROM " . COLUMN_TEMPLATES . " WHERE column_template_id = " . intval($HTTP_GET_VARS['column_template_id']); ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't delete column information", "", __LINE__, __FILE__, $sql); } + $message = $lang['Page_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_page_admin'], "<a href=\"" . append_sid("admin_mx_page_template_setting.php?page_template_id=$page_template_id") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>"); + mx_message_die(GENERAL_MESSAGE, $message); break; default: ! mx_message_die(GENERAL_MESSAGE, $lang['No_mode']); break; } ! if( $show_index != true ) { ! include_once('./page_footer_admin.' . $phpEx); exit; } } + // // Start page proper ! // ! $template->set_filenames(array( ! 'admin_page_template' => 'admin/mx_page_template_admin_body.tpl') ! ); $sql = "SELECT * FROM " . PAGE_TEMPLATES . " WHERE page_template_id <> 1 ORDER BY page_template_id"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't get list of Column/blocks", "", __LINE__, __FILE__, $sql); } $templatelist = '<select name="page_template_id">'; ! while( $row = $db->sql_fetchrow($result) ) { ! $selected = ( $row['page_template_id'] == $page_template_id ) ? ' selected="selected"' : ''; ! $templatelist .= "<option value=\"$row[page_template_id]\"$selected>" . $row['template_name'] . "</option>\n"; } $templatelist .= "</select>"; ! $template->assign_vars(array( ! 'S_ACTION' => append_sid("admin_mx_page_template_setting.$phpEx?mode=addblock&page_template_id=$page_template_id"), ! 'S_PAGE_ACTION' => append_sid("admin_mx_page_template_setting.$phpEx"), ! 'L_TITLE' => $lang['Page_templates_admin'], ! 'L_EXPLAIN' => $lang['Page_templates_admin_explain'], ! 'L_TEMPLATE_DELETE' => $lang['Page_template_delete'], ! 'U_TEMPLATE_DELETE' => append_sid("admin_mx_page_template_setting.$phpEx?mode=deletetemplate&page_template_id=$page_template_id"), ! 'U_PHPBB_ROOT_PATH' => PHPBB_URL, ! 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, ! 'TEMPLATELIST' => $templatelist, ! 'L_CREATE_TEMPLATE' => $lang['Add_Template'], ! 'L_TEMPLATE' => $lang['Template'], ! 'L_CREATE_COLUMN' => $lang['Create_column'], ! 'L_EDIT' => $lang['Edit'], ! 'L_DELETE' => $lang['Delete'], ! 'L_SETTING' => $lang['Settings'], ! 'L_MOVE_UP' => $lang['Move_up'], ! 'L_MOVE_DOWN' => $lang['Move_down'], ! 'L_CHANGE_NOW' => $lang['Change'] ! )); $sql = "SELECT column_template_id, column_title, column_order ! FROM " . COLUMN_TEMPLATES . " ! WHERE page_template_id = $page_template_id ! ORDER BY page_template_id, column_order"; ! if( !($q_column = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Could not query column list", "", __LINE__, __FILE__, $sql); } ! if( $total_column = $db->sql_numrows($q_column) ) { ! $column_rows = $db->sql_fetchrowset($q_column); ! ! // // Okay, let's build the index ! // for( $i = 0; $i < $total_column; $i++ ) { *************** *** 362,382 **** $s_hidden_fields = '<input type="hidden" name="column_template_id[$column_template_id]" value="' . $column_template_id . '" />'; ! $template->assign_block_vars( "columnrow", array( 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'COLUMN_ID' => $column_template_id, ! 'COLUMN_DESC' => $column_rows[$i]['column_title'], ! 'S_ADD_BLOCK_SUBMIT' => "addblock[$column_id]", ! 'LIST_BLOCK' => $blocklist, ! 'U_COLUMN_EDIT' => append_sid( "admin_mx_page_template_setting.$phpEx?mode=editcolumn&column_template_id=$column_template_id&page_template_id=$page_template_id" ), ! 'U_COLUMN_DELETE' => append_sid( "admin_mx_page_template_setting.$phpEx?mode=deletecolumn&column_template_id=$column_template_id&page_template_id=$page_template_id" ), ! 'U_COLUMN_MOVE_UP' => append_sid( "admin_mx_page_template_setting.$phpEx?mode=column_order&move=-15&column_template_id=$column_template_id&page_template_id=$page_template_id" ), ! 'U_COLUMN_MOVE_DOWN' => append_sid( "admin_mx_page_template_setting.$phpEx?mode=column_order&move=15&column_template_id=$column_template_id&page_template_id=$page_template_id" ) ! ) ); } // for ... column } // if ... total_categories - include_once( './page_header_admin.' . $phpEx ); ! $template->pparse( "admin_page_template" ); ! ! include_once( './page_footer_admin.' . $phpEx ); ! ?> --- 365,385 ---- $s_hidden_fields = '<input type="hidden" name="column_template_id[$column_template_id]" value="' . $column_template_id . '" />'; ! $template->assign_block_vars('columnrow', array( ! 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'COLUMN_ID' => $column_template_id, ! 'COLUMN_DESC' => $column_rows[$i]['column_title'], ! 'S_ADD_BLOCK_SUBMIT' => "addblock[$column_id]", ! 'LIST_BLOCK' => $blocklist, ! 'U_COLUMN_EDIT' => append_sid("admin_mx_page_template_setting.$phpEx?mode=editcolumn&column_template_id=$column_template_id&page_template_id=$page_template_id"), ! 'U_COLUMN_DELETE' => append_sid("admin_mx_page_template_setting.$phpEx?mode=deletecolumn&column_template_id=$column_template_id&page_template_id=$page_template_id"), ! 'U_COLUMN_MOVE_UP' => append_sid("admin_mx_page_template_setting.$phpEx?mode=column_order&move=-15&column_template_id=$column_template_id&page_template_id=$page_template_id"), ! 'U_COLUMN_MOVE_DOWN' => append_sid("admin_mx_page_template_setting.$phpEx?mode=column_order&move=15&column_template_id=$column_template_id&page_template_id=$page_template_id") ! )); } // for ... column } // if ... total_categories ! include_once('./page_header_admin.' . $phpEx); ! $template->pparse('admin_page_template'); ! include_once('./page_footer_admin.' . $phpEx); ! ?> \ No newline at end of file Index: admin_mx_block_auth.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_block_auth.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** admin_mx_block_auth.php 14 Mar 2005 21:09:34 -0000 1.3 --- admin_mx_block_auth.php 28 Apr 2005 04:13:49 -0000 1.4 *************** *** 19,41 **** */ ! define('IN_PORTAL', 1); ! ! if ( !empty( $setmodules ) ) { ! $filename = basename( __FILE__ ); $module['Portal - Blocks']['Private Permissions'] = 'admin/' . $filename; return; } ! $mx_root_path = '../'; ! require( $mx_root_path . 'admin/pagestart.php' ); // HERE ! // Mode setting ! ! if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) { ! $mode = ( isset( $HTTP_POST_VARS['mode'] ) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars( $mode ); } else --- 19,44 ---- */ ! if( !empty($setmodules) ) { ! $filename = basename(__FILE__); $module['Portal - Blocks']['Private Permissions'] = 'admin/' . $filename; return; } + // + // Security and Page header + // + define('IN_PORTAL', 1); + $mx_root_path = './../'; + require($mx_root_path . 'extension.inc'); + require('./pagestart.' . $phpEx); ! // // Mode setting ! // ! if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) { ! $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars($mode); } else *************** *** 44,164 **** } ! if ( !isset( $HTTP_POST_VARS['submit'] ) ) { ! $s_block_list = get_list_formatted( 'block_list', $function_id, 'cat_id' ); ! $template->set_filenames( array( 'body' => 'admin/mx_auth_select_body.tpl' ) ! ); ! ! $template->assign_vars( array( 'L_AUTH_TITLE' => $lang['Mx_Block_Auth_Title'], ! 'L_AUTH_EXPLAIN' => $lang['Mx_Block_Auth_Explain'], ! 'L_SELECT_AUTH' => $lang['Auth_Block'], ! 'S_AUTH_ACTION' => append_sid( "admin_mx_block_auth.$phpEx" ), ! 'L_LOOK_UP_AUTH' => $lang['Change'], ! 'AUTH_SELECT_TITLE' => $s_block_list ) ! ); ! $template->pparse( 'body' ); ! include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } else { ! if ( !isset( $HTTP_GET_VARS['cat_id'] ) ) { ! $cat_id = intval( $HTTP_POST_VARS['cat_id'] ); ! ! $template->set_filenames( array( 'body' => 'admin/mx_block_auth_body.tpl' ) ! ); ! ! $template->assign_vars( array( 'L_AUTH_TITLE' => $lang['Mx_Block_Auth_Title'], ! 'L_AUTH_EXPLAIN' => $lang['Mx_Block_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_IS_MODERATOR' => $lang['Is_Moderator'], ! 'S_AUTH_ACTION' => append_sid( "admin_mx_block_auth.$phpEx?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 ( $row = $db->sql_fetchrow( $result ) ) { $groupdata[] = $row; ! } // Get info of this cat $sql = "SELECT block_id, block_title, auth_view_group, auth_edit_group, auth_delete_group, auth_moderator_group ! FROM " . BLOCK_TABLE . " ! WHERE block_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_group'] ); ! $edit_groups = @explode( ',', $thiscat['auth_edit_group'] ); ! $delete_groups = @explode( ',', $thiscat['auth_delete_group'] ); ! $moderator_groups = @explode( ',', $thiscat['auth_moderator_group'] ); ! 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' => ( in_array( $groupdata[$i]['group_id'], $view_groups ) ) ? 'checked="checked"' : '', ! ! 'EDIT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $edit_groups ) ) ? 'checked="checked"' : '', ! ! 'DELETE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $delete_groups ) ) ? 'checked="checked"' : '', ! ! 'MODERATOR_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $moderator_groups ) ) ? 'checked="checked"' : '' ) ! ); } ! $template->pparse( 'body' ); ! include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } else { ! $cat_id = intval( $HTTP_GET_VARS['cat_id'] ); ! ! $view_groups = @implode( ',', $HTTP_POST_VARS['view'] ); ! $edit_groups = @implode( ',', $HTTP_POST_VARS['edit'] ); ! $delete_groups = @implode( ',', $HTTP_POST_VARS['delete'] ); ! ! $moderator_groups = @implode( ',', $HTTP_POST_VARS['moderator'] ); $sql = "UPDATE " . BLOCK_TABLE . " ! SET auth_view_group = '$view_groups', auth_edit_group = '$edit_groups', auth_delete_group = '$delete_groups', auth_moderator_group = '$moderator_groups' ! WHERE block_id = '$cat_id'"; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not update Block config table', '', __LINE__, __FILE__, $sql ); } ! // Update cache ! update_session_cache( $block_id ); ! $message = $lang['Block_Auth_successfully'] . '<br /><br />' . sprintf( $lang['Click_return_block_auth'], '<a href="' . append_sid( "admin_mx_block_auth.$phpEx" ) . '">', '</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 ); } } --- 47,170 ---- } ! if( !isset($HTTP_POST_VARS['submit']) ) { + $s_block_list = get_list_formatted('block_list', $function_id, 'cat_id'); + $template->set_filenames(array( + 'body' => 'admin/mx_auth_select_body.tpl') + ); ! $template->assign_vars(array( ! 'L_AUTH_TITLE' => $lang['Mx_Block_Auth_Title'], ! 'L_AUTH_EXPLAIN' => $lang['Mx_Block_Auth_Explain'], ! 'L_SELECT_AUTH' => $lang['Auth_Block'], ! 'S_AUTH_ACTION' => append_sid("admin_mx_block_auth.$phpEx"), ! 'L_LOOK_UP_AUTH' => $lang['Change'], ! 'AUTH_SELECT_TITLE' => $s_block_list) ! ); ! $template->pparse('body'); ! include($mx_root_path . 'admin/page_footer_admin.' . $phpEx); } else { ! if( !isset($HTTP_GET_VARS['cat_id']) ) { ! $cat_id = intval($HTTP_POST_VARS['cat_id']); ! $template->set_filenames(array( ! 'body' => 'admin/mx_block_auth_body.tpl') ! ); ! $template->assign_vars(array( ! 'L_AUTH_TITLE' => $lang['Mx_Block_Auth_Title'], ! 'L_AUTH_EXPLAIN' => $lang['Mx_Block_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_IS_MODERATOR' => $lang['Is_Moderator'], ! 'S_AUTH_ACTION' => append_sid("admin_mx_block_auth.$phpEx?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( $row = $db->sql_fetchrow($result) ) { $groupdata[] = $row; ! } ! ! // // Get info of this cat + // $sql = "SELECT block_id, block_title, auth_view_group, auth_edit_group, auth_delete_group, auth_moderator_group ! FROM " . BLOCK_TABLE . " ! WHERE block_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_group']); ! $edit_groups = @explode(',', $thiscat['auth_edit_group']); ! $delete_groups = @explode(',', $thiscat['auth_delete_group']); ! $moderator_groups = @explode(',', $thiscat['auth_moderator_group']); ! 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' => ( in_array($groupdata[$i]['group_id'], $view_groups) ) ? 'checked="checked"' : '', ! 'EDIT_CHECKED' => ( in_array($groupdata[$i]['group_id'], $edit_groups) ) ? 'checked="checked"' : '', ! 'DELETE_CHECKED' => ( in_array($groupdata[$i]['group_id'], $delete_groups) ) ? 'checked="checked"' : '', ! 'MODERATOR_CHECKED' => ( in_array($groupdata[$i]['group_id'], $moderator_groups) ) ? 'checked="checked"' : '') ! ); } ! $template->pparse('body'); ! include($mx_root_path . 'admin/page_footer_admin.' . $phpEx); } else { ! $cat_id = intval($HTTP_GET_VARS['cat_id']); ! $view_groups = @implode(',', $HTTP_POST_VARS['view']); ! $edit_groups = @implode(',', $HTTP_POST_VARS['edit']); ! $delete_groups = @implode(',', $HTTP_POST_VARS['delete']); ! $moderator_groups = @implode(',', $HTTP_POST_VARS['moderator']); $sql = "UPDATE " . BLOCK_TABLE . " ! SET auth_view_group = '$view_groups', ! auth_edit_group = '$edit_groups', ! auth_delete_group = '$delete_groups', ! auth_moderator_group = '$moderator_groups' ! WHERE block_id = '$cat_id'"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not update Block config table', '', __LINE__, __FILE__, $sql); } ! ! // // Update cache ! // ! update_session_cache($block_id); ! $message = $lang['Block_Auth_successfully'] . '<br /><br />' . sprintf($lang['Click_return_block_auth'], '<a href="' . append_sid("admin_mx_block_auth.$phpEx" ) . '">', '</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); } } Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.php 25 Apr 2005 12:10:43 -0000 1.5 --- index.php 28 Apr 2005 04:13:50 -0000 1.6 *************** *** 25,38 **** */ - define('IN_PORTAL', 1); - // ! // Load default header // ! $no_page_header = TRUE; $mx_root_path = './../'; require($mx_root_path . 'extension.inc'); require('./pagestart.' . $phpEx); // --------------- // Begin functions --- 25,45 ---- */ // ! // Security and Page header // ! define('IN_PORTAL', 1); $mx_root_path = './../'; require($mx_root_path . 'extension.inc'); + $no_page_header = TRUE; require('./pagestart.' . $phpEx); + + // ------------------------------ + // DEBUG ONLY ;-) + // + error_reporting(E_ALL); + // ------------------------------ + + // --------------- // Begin functions *************** *** 143,147 **** // Include PHPBB Administration // ------------------------------------------------------------------------------- ! $module_phpbb = array_merge($module, read_admin($phpbb_root_path . 'admin/')); $template->assign_block_vars('module_phpbb', array( 'L_PHPBB' => $lang['Phpbb'] --- 150,154 ---- // Include PHPBB Administration // ------------------------------------------------------------------------------- ! $module_phpbb = read_admin($phpbb_root_path . 'admin/'); $template->assign_block_vars('module_phpbb', array( 'L_PHPBB' => $lang['Phpbb'] Index: page_header_admin.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/page_header_admin.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** page_header_admin.php 25 Apr 2005 20:50:04 -0000 1.8 --- page_header_admin.php 28 Apr 2005 04:13:50 -0000 1.9 *************** *** 86,90 **** $template->assign_vars(array( 'SITENAME' => $board_config['sitename'], ! 'PAGE_TITLE' => $page_title, 'L_ADMIN' => $lang['Admin'], --- 86,90 ---- $template->assign_vars(array( 'SITENAME' => $board_config['sitename'], ! // 'PAGE_TITLE' => $page_title, 'L_ADMIN' => $lang['Admin'], Index: admin_mx_block.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_block.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** admin_mx_block.php 16 Apr 2005 01:54:57 -0000 1.25 --- admin_mx_block.php 28 Apr 2005 04:13:49 -0000 1.26 *************** *** 19,40 **** */ ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); $module['Portal - Blocks']['Block_admin'] = 'admin/' . $file; return; } ! define( 'IN_PORTAL', 1 ); [...1637 lines suppressed...] { ! mx_message_die(GENERAL_ERROR, "Could not update block title information.", "", __LINE__, __FILE__, $sql); } ! ! // // Update cache ! // ! update_session_cache($block_id); ! if( !empty($portalpage) ) { ! $message = $lang['Portal_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_portal_config'], '<a href="' . append_sid(PORTAL_URL . "index.$phpEx?page=$portalpage") . '">', '</a>') . "<br /><br />" . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.php?pane=right" ) . '">', '</a>'); } else { ! $message = $lang['Portal_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_portal_config'], '<a href="' . append_sid("admin_mx_block.$phpEx") . '">', '</a>') . "<br /><br />" . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.php?pane=right") . '">', '</a>'); } ! mx_message_die(GENERAL_MESSAGE, $message); } Index: admin_mx_module.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_module.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** admin_mx_module.php 26 Apr 2005 22:51:44 -0000 1.29 --- admin_mx_module.php 28 Apr 2005 04:13:49 -0000 1.30 *************** *** 12,16 **** */ ! /** * 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 --- 12,16 ---- */ ! /** * This program is free software; you can redistribute it and/or modify [...3532 lines suppressed...] ! return $output_message; } ! ?> \ No newline at end of file --- 1911,1922 ---- $output_message .= '<font color=#00ff00>[db...ok]</font>'; } ! $output_message .= ' ' . $parameter_row[1] . '-' . $resultset_param[$p]['parameter_id'] . ','; ! } ! ! $output_message .= '<br /> ... ok<br />'; ! return $output_message; } ! ?> \ No newline at end of file Index: admin_mx_page_setting.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_page_setting.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** admin_mx_page_setting.php 26 Apr 2005 22:51:45 -0000 1.14 --- admin_mx_page_setting.php 28 Apr 2005 04:13:50 -0000 1.15 *************** *** 19,44 **** */ ! $no_page_header = true; ! ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); ! $module['Portal - Pages']['Page_Setting'] = 'admin/' . $file; return; } [...969 lines suppressed...] ! 'ROW_COLOR' => $row_color, ! 'U_BLOCK_EDIT' => append_sid("admin_mx_block.php?mode=edit_block&block_id=$block_id"), ! 'U_BLOCK_SETTING' => $u_setting, ! 'U_BLOCK_DELETE' => append_sid("admin_mx_page_setting.$phpEx?mode=deleteblock&block_id=$block_id&column_id=$column_id&block_order=$block_order&page_id=$page_id"), ! 'U_BLOCK_MOVE_UP' => append_sid("admin_mx_page_setting.$phpEx?mode=block_order&move=-15&block_id=$block_id&column_id=$column_id&block_order=$block_order&page_id=$page_id"), ! 'U_BLOCK_MOVE_DOWN' => append_sid("admin_mx_page_setting.$phpEx?mode=block_order&move=15&block_id=$block_id&column_id=$column_id&block_order=$block_order&page_id=$page_id"), ! 'U_BLOCK_RESYNC' => append_sid("admin_mx_page_setting.$phpEx?mode=block_sync&block_id=$block_id&column_id=$column_id&page_id=$page_id") ! )); } // if ... column_id == column_id } // for ... blocks } // for ... column } // if ... total_categories ! include_once('./page_header_admin.' . $phpEx); ! $template->pparse('admin_page'); ! include_once('./page_footer_admin.' . $phpEx); ?> \ No newline at end of file Index: admin_mx_page.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_page.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** admin_mx_page.php 3 Apr 2005 15:12:50 -0000 1.21 --- admin_mx_page.php 28 Apr 2005 04:13:50 -0000 1.22 *************** *** 19,25 **** */ ! $no_page_header = true; ! ! if ( !empty($setmodules) ) { $module['Portal - Pages']['Page_admin'] = 'admin/' . basename(__FILE__); --- 19,23 ---- */ ! if( !empty($setmodules) ) { $module['Portal - Pages']['Page_admin'] = 'admin/' . basename(__FILE__); *************** *** 27,36 **** } define('IN_PORTAL', 1); ! $mx_root_path = '../'; ! ! // Security and page header - require('./pagestart.php'); // --- 25,37 ---- } + // + // Security and Page header + // define('IN_PORTAL', 1); ! $mx_root_path = './../'; ! require($mx_root_path . 'extension.inc'); ! $no_page_header = TRUE; ! require('./pagestart.' . $phpEx); // *************** *** 41,45 **** ! if ( !empty($mode) ) { switch( $mode ) --- 42,46 ---- ! if( !empty($mode) ) { switch( $mode ) *************** *** 49,62 **** --- 50,67 ---- page_edit($mode, $page_id); break; + case 'create': case 'modify': page_modify($mode, $page_id); break; + case 'delete': page_delete($mode, $page_id); break; + case 'delpage': page_delete($mode, $page_i... [truncated message content] |