|
From: Jon O. <jon...@us...> - 2005-10-22 10:51:30
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14247/admin Modified Files: admin_mx_block_cp.php admin_mx_module.php admin_mx_module_cp.php admin_mx_page_cp.php Log Message: massive update, for mxBB 2.8.1 rc1 - most "easy to solve" bugs reported are fixed - optimized adminCP - mod_rewrite - Page IP filter - optimized blockCP - removed old files Index: admin_mx_module_cp.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_module_cp.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin_mx_module_cp.php 1 Oct 2005 14:10:44 -0000 1.6 --- admin_mx_module_cp.php 22 Oct 2005 10:51:02 -0000 1.7 *************** *** 43,48 **** // Instatiate the $mx_dynamic_select class (dynamic block select javascript) // ! $mx_dynamic_select = new mx_dynamic_select(); ! $mx_dynamic_select->generate(); // --- 43,48 ---- // Instatiate the $mx_dynamic_select class (dynamic block select javascript) // ! //$mx_dynamic_select = new mx_dynamic_select(); ! //$mx_dynamic_select->generate(); // *************** *** 76,84 **** --- 76,95 ---- // $result_message = $mx_admin->do_it($mode, $action, $id); + + // + // If new page, load new page settings panel + // + if (is_array($result_message)) + { + $new_id = $result_message['new_id']; + $result_message = $result_message['text']; + } $result_message = $lang['AdminCP_status'] . '<hr>' . $result_message; } // if .. !empty($mode) + // // Load states + // $cookie_tmp = $board_config['cookie_name'].'_admincp_blockstates'; $cookie_states = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? explode(",", $HTTP_COOKIE_VARS[$cookie_tmp]) : array(); *************** *** 86,89 **** --- 97,139 ---- $sort_cookie = !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_pagesort']) ? explode(",", $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_pagesort']) : array(); + if ( isset( $HTTP_POST_VARS['include_block_quickedit'] ) ) + { + switch ( $HTTP_POST_VARS['include_block_quickedit'] ) + { + case '0': + $mx_modulecp_include_block_quickedit = false; + break; + case '1': + $mx_modulecp_include_block_quickedit = true; + break; + default: + $mx_modulecp_include_block_quickedit = !empty($sort_cookie[3]) ? $sort_cookie[3] == '1' : false; + } + } + else + { + $mx_modulecp_include_block_quickedit = !empty($sort_cookie[3]) ? $sort_cookie[3] == '1' : false; + } + + if ( isset( $HTTP_POST_VARS['include_block_private'] ) ) + { + switch ( $HTTP_POST_VARS['include_block_private'] ) + { + case '0': + $mx_modulecp_include_block_private = false; + break; + case '1': + $mx_modulecp_include_block_private = true; + break; + default: + $mx_modulecp_include_block_private = !empty($sort_cookie[4]) ? $sort_cookie[4] == '1' : false; + } + } + else + { + $mx_modulecp_include_block_private = !empty($sort_cookie[4]) ? $sort_cookie[4] == '1' : false; + } + + /* if ( isset( $HTTP_POST_VARS['include_all'] ) ) { *************** *** 97,113 **** break; default: ! $include_all = isset($sort_cookie[3]) ? $sort_cookie[3] : '0'; } } else { ! $include_all = isset($sort_cookie[3]) ? $sort_cookie[3] : '0'; } ! $sort_cookie = array(isset($sort_cookie[0]) ? $sort_cookie[0] : '', isset($sort_cookie[1]) ? $sort_cookie[1] : '', isset($sort_cookie[2]) ? $sort_cookie[2] : $include_all, $include_all); setcookie($board_config['cookie_name'] . '_pagesort', implode(',', $sort_cookie), time() + 10000000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); - // -------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------- --- 147,165 ---- break; default: ! $include_all = isset($sort_cookie[5]) ? $sort_cookie[5] : '0'; } } else { ! $include_all = isset($sort_cookie[5]) ? $sort_cookie[5] : '0'; ! } + */ + $include_all = 0; ! $sort_cookie = array(isset($sort_cookie[0]) ? $sort_cookie[0] : '', isset($sort_cookie[1]) ? $sort_cookie[1] : '', isset($sort_cookie[2]) ? $sort_cookie[2] : intval($include_all), intval($mx_modulecp_include_block_quickedit), intval($mx_modulecp_include_block_private), intval($include_all)); setcookie($board_config['cookie_name'] . '_pagesort', implode(',', $sort_cookie), time() + 10000000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); // -------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------- *************** *** 151,158 **** // - // Hidden vars - // - - // // Send to template // --- 203,206 ---- *************** *** 185,190 **** 'L_RESYNC' => $lang['Resync'], ! 'L_QUICK_NAV' => $lang['Quick_nav_modules'], 'L_INCLUDE_ALL' => $lang['Include_all_modules'], --- 233,240 ---- 'L_RESYNC' => $lang['Resync'], ! 'L_QUICK_NAV' => $lang['Quick_nav'], 'L_INCLUDE_ALL' => $lang['Include_all_modules'], + 'L_INCLUDE_BLOCK_QUICKEDIT' => $lang['Include_block_quickedit'], + 'L_INCLUDE_BLOCK_PRIVATE' => $lang['Include_block_private'], *************** *** 265,269 **** 'S_INCLUDE_ALL_YES' => ( $include_all == '1' ) ? 'checked="checked"' : '', ! 'S_INCLUDE_ALL_NO' => ( $include_all == '0' ) ? 'checked="checked"' : '' )); --- 315,325 ---- 'S_INCLUDE_ALL_YES' => ( $include_all == '1' ) ? 'checked="checked"' : '', ! 'S_INCLUDE_ALL_NO' => ( $include_all == '0' ) ? 'checked="checked"' : '', ! ! 'S_INCLUDE_BLOCK_QUICKEDIT_YES' => ( $mx_modulecp_include_block_quickedit == '1' ) ? 'checked="checked"' : '', ! 'S_INCLUDE_BLOCK_QUICKEDIT_NO' => ( $mx_modulecp_include_block_quickedit == '0' ) ? 'checked="checked"' : '', ! ! 'S_INCLUDE_BLOCK_PRIVATE_YES' => ( $mx_modulecp_include_block_private == '1' ) ? 'checked="checked"' : '', ! 'S_INCLUDE_BLOCK_PRIVATE_NO' => ( $mx_modulecp_include_block_private == '0' ) ? 'checked="checked"' : '' )); *************** *** 273,290 **** // ! ! // 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; } --- 329,350 ---- // ! if ($mx_modulecp_include_block_private) { ! // ! // 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; ! } } *************** *** 419,424 **** $type_row['Separator'] = !empty($lang['ParType_Separator']) ? $lang['ParType_Separator'] : "-Separator-"; - //$type_row['Values'] = !empty($lang['ParType_Values']) ? $lang['ParType_Values'] : "Values"; - // // Module subpanel - edit --- 479,482 ---- *************** *** 622,626 **** } - //$functionlist = get_list('function_id', FUNCTION_TABLE, 'function_id', 'function_name', $function_id, true); // // Parameter loop --- 680,683 ---- *************** *** 754,758 **** )); } ! // // Block loop --- 811,815 ---- )); } ! // // Block loop *************** *** 872,876 **** 'E_BLOCK_TITLE' => $block_title, 'E_BLOCK_DESC' => $block_desc, - //'S_FUNCTION_LIST' => $functionlist, 'S_SHOW_BLOCK_YES' => $show_block_yes, --- 929,932 ---- *************** *** 892,975 **** )); ! // ! // Auth ! // ! for( $l = 0; $l < count($block_auth_fields); $l++ ) { ! $custom_auth[$l] = ' <select name="' . $block_auth_fields[$l] . '">'; ! ! for( $k = 0; $k < count($block_auth_levels); $k++ ) { ! $selected = ( $block_rows[$block_count][$block_auth_fields[$l]] == $block_auth_const[$k] ) ? ' selected="selected"' : ''; ! $custom_auth[$l] .= '<option value="' . $block_auth_const[$k] . '"' . $selected . '>' . $lang['AUTH_' . $block_auth_levels[$k]] . "</option>\n"; } - $custom_auth[$l] .= '</select> '; - - $cell_title = $field_names[$block_auth_fields[$l]]; - - $template->assign_block_vars('module.function.block.block_auth_titles', array( - 'CELL_TITLE' => $cell_title - )); - $template->assign_block_vars('module.function.block.block_auth_data', array( - 'S_AUTH_LEVELS_SELECT' => $custom_auth[$l] - )); - - $s_column_span++; } ! // ! // PRIVATE auth ! // ! $view_groups = @explode(',', $block_rows[$block_count]['auth_view_group']); ! $edit_groups = @explode(',', $block_rows[$block_count]['auth_edit_group']); ! $moderator_groups = @explode(',', $block_rows[$block_count]['auth_moderator_group']); ! ! $row_private = ''; ! for( $i = 0; $i < count($groupdata); $i++ ) { ! $row_color = ( !( $i % 2 ) ) ? 'row1' : 'row2'; ! $row_private .= '<tr>' . "\n"; ! $row_private .= '<td width="40%" class="'.$row_color.'" align="center"><span class="gen">'.$groupdata[$i]['group_name'].'</span></td>'; ! $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; ! ! if ( $block_rows[$block_count]['auth_view'] == AUTH_ACL ) ! { ! $view_checked = in_array($groupdata[$i]['group_id'], $view_groups) ? 'checked="checked"' : ''; ! $row_private .= '<input name="view[]" type="checkbox" ' . $view_checked . 'value="'.$groupdata[$i]['group_id'].'" />'; ! } ! else { ! $row_private .= '-'; ! } ! $row_private .= '</td>'; ! $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; ! ! if ( $block_rows[$block_count]['auth_edit'] == AUTH_ACL ) ! { ! $edit_checked = in_array($groupdata[$i]['group_id'], $edit_groups) ? 'checked="checked"' : ''; ! $row_private .= '<input name="edit[]" type="checkbox" ' . $edit_checked . 'value="'.$groupdata[$i]['group_id'].'" />'; ! } ! else ! { ! $row_private .= '-'; } ! ! $row_private .= '</td>'; ! ! $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; ! $row_private .= '<input name="moderator[]" type="checkbox" '. (( in_array($groupdata[$i]['group_id'], $moderator_groups) ) ? 'checked="checked"' : '') . ' value="'.$groupdata[$i]['group_id'].'" />'; ! $row_private .= '</td>'; ! $row_private .= '</tr>'. "\n"; } - $template->assign_block_vars('module.function.block.grouprows', array( - 'GROUP_ROWS' => $row_private - )); - if (!$new_block) { $template->assign_block_vars('module.function.block.is_block', array()); ! } --- 948,1047 ---- )); ! if ($mx_modulecp_include_block_quickedit) { ! // ! // Auth ! // ! for( $l = 0; $l < count($block_auth_fields); $l++ ) { ! $custom_auth[$l] = ' <select name="' . $block_auth_fields[$l] . '">'; ! ! for( $k = 0; $k < count($block_auth_levels); $k++ ) ! { ! $selected = ( $block_rows[$block_count][$block_auth_fields[$l]] == $block_auth_const[$k] ) ? ' selected="selected"' : ''; ! $custom_auth[$l] .= '<option value="' . $block_auth_const[$k] . '"' . $selected . '>' . $lang['AUTH_' . $block_auth_levels[$k]] . "</option>\n"; ! } ! $custom_auth[$l] .= '</select> '; ! ! $cell_title = $field_names[$block_auth_fields[$l]]; ! ! $template->assign_block_vars('module.function.block.block_auth_titles', array( ! 'CELL_TITLE' => $cell_title ! )); ! $template->assign_block_vars('module.function.block.block_auth_data', array( ! 'S_AUTH_LEVELS_SELECT' => $custom_auth[$l] ! )); ! ! $s_column_span++; } } ! if ($mx_modulecp_include_block_private) { ! // ! // PRIVATE auth ! // ! $view_groups = @explode(',', $block_rows[$block_count]['auth_view_group']); ! $edit_groups = @explode(',', $block_rows[$block_count]['auth_edit_group']); ! $moderator_groups = @explode(',', $block_rows[$block_count]['auth_moderator_group']); ! ! $row_private = ''; ! for( $i = 0; $i < count($groupdata); $i++ ) { ! $row_color = ( !( $i % 2 ) ) ? 'row1' : 'row2'; ! $row_private .= '<tr>' . "\n"; ! $row_private .= '<td width="40%" class="'.$row_color.'" align="center"><span class="gen">'.$groupdata[$i]['group_name'].'</span></td>'; ! $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; ! ! if ( $block_rows[$block_count]['auth_view'] == AUTH_ACL ) ! { ! $view_checked = in_array($groupdata[$i]['group_id'], $view_groups) ? 'checked="checked"' : ''; ! $row_private .= '<input name="view[]" type="checkbox" ' . $view_checked . 'value="'.$groupdata[$i]['group_id'].'" />'; ! } ! else ! { ! $row_private .= '-'; ! } ! ! $row_private .= '</td>'; ! $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; ! ! if ( $block_rows[$block_count]['auth_edit'] == AUTH_ACL ) ! { ! $edit_checked = in_array($groupdata[$i]['group_id'], $edit_groups) ? 'checked="checked"' : ''; ! $row_private .= '<input name="edit[]" type="checkbox" ' . $edit_checked . 'value="'.$groupdata[$i]['group_id'].'" />'; ! } ! else ! { ! $row_private .= '-'; ! } ! ! $row_private .= '</td>'; ! $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; ! $row_private .= '<input name="moderator[]" type="checkbox" '. (( in_array($groupdata[$i]['group_id'], $moderator_groups) ) ? 'checked="checked"' : '') . ' value="'.$groupdata[$i]['group_id'].'" />'; ! $row_private .= '</td>'; ! $row_private .= '</tr>'. "\n"; } ! ! $template->assign_block_vars('module.function.block.grouprows', array( ! 'GROUP_ROWS' => $row_private ! )); } if (!$new_block) { $template->assign_block_vars('module.function.block.is_block', array()); ! } ! ! if ( $mx_modulecp_include_block_private ) ! { ! $template->assign_block_vars('module.function.block.is_block.include_block_private', array()); ! } ! ! if ( $mx_modulecp_include_block_quickedit ) ! { ! $template->assign_block_vars('module.function.block.is_block.include_block_edit', array()); ! } *************** *** 981,985 **** // Create quick nav box // - $module_select_box = get_list_static('module_id', $module_rows_select, $nav_module_id, false); --- 1053,1056 ---- Index: admin_mx_page_cp.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_page_cp.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** admin_mx_page_cp.php 12 Oct 2005 15:37:32 -0000 1.7 --- admin_mx_page_cp.php 22 Oct 2005 10:51:02 -0000 1.8 *************** *** 61,64 **** --- 61,66 ---- } + setcookie($board_config['cookie_name'] . '_adminPage_page_id', $nav_page_id, time() + 10000000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); + if( !empty($mode) && !empty($action) ) { *************** *** 139,142 **** --- 141,145 ---- } + /* if ( isset( $HTTP_POST_VARS['include_all'] ) ) { *************** *** 157,162 **** $include_all = isset($sort_cookie[2]) ? $sort_cookie[2] : '0'; } ! $sort_cookie = array($sort_method, $sort_order, $include_all, isset($sort_cookie[3]) ? $sort_cookie[3] : $include_all); setcookie($board_config['cookie_name'] . '_pagesort', implode(',', $sort_cookie), time() + 10000000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); --- 160,167 ---- $include_all = isset($sort_cookie[2]) ? $sort_cookie[2] : '0'; } + */ + $include_all = 0; ! $sort_cookie = array($sort_method, $sort_order, $include_all, isset($sort_cookie[3]) ? $sort_cookie[3] : intval($include_all), isset($sort_cookie[4]) ? $sort_cookie[4] : '', isset($sort_cookie[5]) ? $sort_cookie[5] : $include_all); setcookie($board_config['cookie_name'] . '_pagesort', implode(',', $sort_cookie), time() + 10000000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); *************** *** 233,237 **** 'L_CREATE_PAGE' => $lang['Add_Page'], ! 'L_QUICK_NAV' => $lang['Quick_nav_pages'], 'L_INCLUDE_ALL' => $lang['Include_all_pages'], --- 238,242 ---- 'L_CREATE_PAGE' => $lang['Add_Page'], ! 'L_QUICK_NAV' => $lang['Quick_nav'], 'L_INCLUDE_ALL' => $lang['Include_all_pages'], Index: admin_mx_block_cp.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_block_cp.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** admin_mx_block_cp.php 2 Oct 2005 21:24:29 -0000 1.5 --- admin_mx_block_cp.php 22 Oct 2005 10:51:01 -0000 1.6 *************** *** 95,99 **** // SUBMIT? // ! if( ($submit || $submit_pars) && !empty($mode) && !empty($action) ) { // --- 95,99 ---- // SUBMIT? // ! if( !empty($mode) && !empty($action) ) { // *************** *** 101,112 **** // //$portalpage = $mx_request_vars->request('portalpage', MX_TYPE_INT, 1); ! $block_id = $mx_request_vars->request('id', MX_TYPE_INT, ''); ! if( $submit ) { // // Send to adminCP // ! $result_message = $mx_admin->do_it($mode, $action, $block_id); } --- 101,131 ---- // //$portalpage = $mx_request_vars->request('portalpage', MX_TYPE_INT, 1); ! $id = $mx_request_vars->request('id', MX_TYPE_INT, ''); ! if( !$submit_pars ) { + $module_id = $mx_request_vars->request('module_id', MX_TYPE_INT, ''); + $function_id = $mx_request_vars->request('function_id', MX_TYPE_INT, ''); + // // Send to adminCP // ! $result_message = $mx_admin->do_it($mode, $action, $id); ! ! // ! // If new block, load new block settings panel ! // ! if (is_array($result_message)) ! { ! $block_id = $result_message['new_id']; ! $result_message = $result_message['text']; ! } ! ! if ($action == MX_DO_DELETE) ! { ! $block_id = ''; ! $message = $lang['BlockCP_Config_updated'] . '<br /><br />' . sprintf($lang['Click_return_blockCP_admin'], '<a href="' . append_sid(PORTAL_URL ."admin/admin_mx_block_cp.$phpEx?block_id=$block_id&module_id=$module_id&function_id=$function_id&portalpage=$portalpage$has_dyn_block_id&sid=".$userdata['session_id']) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_portalpage_admin'], '<a href="' . append_sid(PORTAL_URL . "index.$phpEx?page=$portalpage$has_dyn_block_id") . '">', '</a>'); ! mx_message_die(GENERAL_MESSAGE, $message); ! } } *************** *** 116,120 **** // Send to BlockCP // ! $result_message = $mx_blockcp->submit_parameters($block_id); } --- 135,139 ---- // Send to BlockCP // ! $result_message = $mx_blockcp->submit_parameters($id); } *************** *** 199,202 **** --- 218,222 ---- )); + $mx_blockcp->blockcp_mode = 'admin_mx_block_cp'; $mx_blockcp->generate_cp($block_id, $new_block); Index: admin_mx_module.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_module.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** admin_mx_module.php 19 Oct 2005 16:02:13 -0000 1.37 --- admin_mx_module.php 22 Oct 2005 10:51:01 -0000 1.38 *************** *** 167,172 **** 'L_UPGRADE_PACK' => $lang['upgrade_module_pack'], 'L_EXPORT_PACK' => $lang['export_module_pack'], ! ! 'L_QUICK_NAV' => $lang['Quick_nav_modules'], 'IMG_URL_CONTRACT' => $admin_icon['contract'], --- 167,171 ---- 'L_UPGRADE_PACK' => $lang['upgrade_module_pack'], 'L_EXPORT_PACK' => $lang['export_module_pack'], ! 'L_QUICK_NAV' => $lang['Quick_nav'], 'IMG_URL_CONTRACT' => $admin_icon['contract'], |