|
From: Jon O. <jon...@us...> - 2005-10-22 12:41:10
|
Update of /cvsroot/mxbb/mx_errordocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4406 Added Files: db_install.php db_uninstall.php errordocs.pak errordocs.php readme.txt version_history.txt Log Message: adding this module --- NEW FILE: errordocs.php --- <?php /*************************************************************************** * errordocs.php * ------------- * begin : September, 2003 * copyright : (c) 2003 Marc Ferran * email : phpmix at pobox.com * module : ErrorDocs * file contents : ErrorDocs block/standalone * more information : * * RFC2616 - Hypertext Transfer Protocol -- HTTP/1.1 * http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10 * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if( function_exists('read_block_config') ) { // // Running as a Block... // $generate_headers = FALSE; } else { // // Running Standalone... // define('IN_PORTAL', 1); $mx_root_path = '../../'; include_once($mx_root_path . 'extension.inc'); include_once($mx_root_path . 'common.'.$phpEx); $userdata = session_pagestart($user_ip, PAGE_INDEX); mx_init_userprefs($userdata); $block_id = ( !empty($HTTP_GET_VARS['block_id']) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; if( empty($block_id) ) { $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'ErrorDocs' LIMIT 1"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not query ErrorDocs module information", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $block_id = $row['block_id']; } $generate_headers = TRUE; } // // Include common module stuff... // include_once($module_root_path . 'includes/common.' . $phpEx); // // Read block Configuration // $block_config = read_block_config($block_id); $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); $block_enable_log = $block_config[$block_id]['ErrorDocs_Enable_Log']['parameter_value']; $block_include_codes = $block_config[$block_id]['ErrorDocs_Include_Codes']['parameter_value']; $block_exclude_fiext = $block_config[$block_id]['ErrorDocs_Exclude_Extensions']['parameter_value']; $block_max_records = $block_config[$block_id]['ErrorDocs_Max_Records']['parameter_value']; if( $block_enable_log == '' || $block_enable_log == 'TRUE' ) { $block_enable_log = TRUE; } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // // Get arguments... // global $HTTP_GET_VARS; $errdoc_code = ( isset($HTTP_GET_VARS['errno']) ) ? intval($HTTP_GET_VARS['errno']) : 0; $errdoc_log = ( isset($HTTP_GET_VARS['errlog']) && $HTTP_GET_VARS['errlog'] == 'yes' && $block_enable_log ) ? TRUE : FALSE; // // ErrorDocs procedure (behind the class)... // $errdoc = new clsErrorDocs($block_max_records); $errdoc->set_include_codes($block_include_codes); $errdoc->set_exclude_fiext($block_exclude_fiext); $errdoc->capture_error_info($errdoc_code); // // Generate header if running standalone... // if( $generate_headers ) { $page_title = $block_title; include($mx_root_path . 'includes/page_header.'.$phpEx); } // // This is the template used to render this block. // $template->set_filenames(array( 'body' => 'errordocs_body.tpl') ); // // Setup common template vars and display the block. // if( $errdoc_log && $errdoc->is_write_log_allowed() ) { // // Ok, try to log the HTTP Error record... // if( $errdoc->write_log() ) { $template->assign_vars(array('L_ERROR_LOGGED' => $lang['ErrorDocs_Logged'].' IP: '.decode_ip($errdoc->user_ip))); } } $template->assign_vars(array( 'L_ERROR_CODE' => $errdoc->code, 'L_ERROR_SHORT' => $errdoc->short_info, 'L_ERROR_LONG' => $errdoc->long_info, 'U_REQUEST_URI' => $errdoc->request_uri, 'L_REFERER_INFO' => $errdoc->referer_info, 'L_MORE_INFO' => $lang['ErrorDocs_MoreInfo'], 'L_SERVER_NAME' => $errdoc->server_name, 'U_MODULE_IMAGES' => PORTAL_URL . $module_root_path . 'templates/images/', 'BLOCK_SIZE' => $block_size, 'L_TITLE' => $errdoc->title) ); $template->pparse('body'); // // Generate footer if running standalone... // if( $generate_headers ) { include_once($mx_root_path . 'includes/page_tail.'.$phpEx); } ?> --- NEW FILE: errordocs.pak --- module=+:55=+:ErrorDocs=+:modules/mx_errordocs/=+:mx_errordocs version 1.0.0=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:55=+:98=+:ErrorDocss=+:=+:errordocs.php=+: parameter=+:98=+:319=+:ErrorDocs_Enable_Log=+:Boolean=+:TRUE=+: parameter=+:98=+:321=+:ErrorDocs_Exclude_Extensions=+:Text=+:ico=+: parameter=+:98=+:320=+:ErrorDocs_Include_Codes=+:Text=+:=+: parameter=+:98=+:322=+:ErrorDocs_Max_Records=+:Number=+:100=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - ErrorDocss=+:Demo block=+:98=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- NEW FILE: db_uninstall.php --- <?php /** * * ------------------------------------------------------------------------ * subject : mxBB-Portal - CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 mxBB-Portal * email : jon...@ho... * project site : www.mx-system.com * * ------------------------------------------------------------------------- * * $Id: db_uninstall.php,v 1.1 2005/10/22 12:40:53 jonohlsson Exp $ */ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } // // Read module constants... // $module_root_path = dirname(__FILE__) . '/'; include_once($module_root_path . 'includes/common.'.$phpEx); if( !defined('ERRORDOCS_LOG_TABLE') ) { message_die(GENERAL_ERROR, "Couldn't load file includes/common.$phpEx", "", __LINE__, __FILE__); } // // SQL statements to drop module tables... // $sql = array( "DROP TABLE ".ERRORDOCS_LOG_TABLE ); echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . mx_do_install_upgrade( $sql ) . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: version_history.txt --- ################################################################# ## ## mx_errordocs module v.1.0.0 for MX-System Portal 2.7+ ## ## mx_errordocs Author: ## - markus_petrux (http://www.phpmix.com) ## ## Editor TabSize = 4 ## v.1.0.0 - 2003/09/22 (markus_petrux) - First time released. ## ## /Markus ## ################################################################# --- NEW FILE: db_install.php --- <?php /** * * ------------------------------------------------------------------------ * subject : mxBB-Portal - CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 mxBB-Portal * email : jon...@ho... * project site : www.mx-system.com * * ------------------------------------------------------------------------- * * $Id: db_install.php,v 1.1 2005/10/22 12:40:53 jonohlsson Exp $ */ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } // // Check if install is really needed... // $module_root_path = dirname(__FILE__) . '/'; include_once($module_root_path . 'includes/common.'.$phpEx); if( !defined('ERRORDOCS_LOG_TABLE') ) { message_die(GENERAL_ERROR, "Couldn't load file includes/common.$phpEx", "", __LINE__, __FILE__); } // // SQL statements to build required module tables... // $sql = array( // // Table: ErrorDocs Log // "CREATE TABLE ".ERRORDOCS_LOG_TABLE." ( id INT(11) DEFAULT '0' NOT NULL, tstamp INT(11) DEFAULT '0' NOT NULL, errno SMALLINT(5) DEFAULT '0' NOT NULL, user_id MEDIUMINT(8) DEFAULT '0' NOT NULL, user_ip CHAR(8) DEFAULT '', request_uri VARCHAR(255) DEFAULT '', http_referer VARCHAR(255) DEFAULT '', PRIMARY KEY (tstamp) )" ); $n = 0; $message = "<b>This list is a result of the SQL queries needed for this Module</b><br/><br/>"; while($sql[$n]) { $message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : ''; if( !$result = $db->sql_query($sql[$n]) ) { $message .= '<b><font color=#FF0000>[Error or Already added]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />'; } else { $message .='<b><font color=#0000fF>[Added/Updated]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />'; } $n++; } $message .= '<br />If you get some Error, Already Added or Updated, relax, this is normal when updating modules'; echo '<br /> <br />'; echo '<table cellpadding="4" cellspacing="1" border="0" class="forumline">'; echo '<tr><th class="thHead" align="center">Module Installation Information</th></tr>'; echo '<tr><td class="row1" align="center"><span class="gen">' . $message . '</span></td></tr>'; echo '</table> <br />'; ?> --- NEW FILE: readme.txt --- mx_errordocs module for MX-System Portal 2.7+ ====================================================================== - Author: markus_petrux (http://www.phpmix.com) - Installation: Please, read this topic for details: http://www.phpmix.com/phpBB2/viewtopic.php?p=124 - Demo: http://www.phpmix.com/index.php?page=15&errno=404 - Changes: Please, read file version_history.txt ====================================================================== |