Houston we lost forums

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Houston we lost forums
webshark
PayPal Donation
CZ Moderator
 Codezwiz Site Donator
webshark has been a member for over 20 year's 20 Year Member
turkey.gif
Age: 55
Gender: Male
Website:
Status: Offline
Joined: Mar 23, 2004
0.09 posts per day
Posts: 643
Points: 57,200
   
Hello

i just tryed to patched common.php manually and when back to my site i see i have no forums anymore icon_mrgreen.gif
so i unpatched it till someone help me ,here is my common.php
if ( !defined('IN_PHPBB') )
{
        die("Hacking attempt");
}
//Unset Vars
function unset_vars(&$var)
{
while (list($var_name, $null) = @each($var))
{
if ( ! ( $var_name == 'phpbb_root_path' || $var_name == 'no_page_header' || $var_name == 'phpEx' || $var_name == 'admin' || $var_name == 'user' || $var_name == 'name' ) )
{
unset($GLOBALS[$var_name]);
}
}
return;
}
error_reporting  (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
// Unset globally registered vars - PHP5 ... hhmmm
if (@$ini_val('register_globals') == '1' || strtolower(@$ini_val('register_globals')) == 'on')
{
$var_prefix = 'HTTP';
$var_suffix = '_VARS';
$test = array('_GET', '_POST', '_SERVER', '_COOKIE', '_ENV');
foreach ($test as $var)
{ if (is_array(${
$var_prefix . $var . $var_suffix}))
{
unset_vars(${$var_prefix . $var . $var_suffix});
@reset(${$var_prefix . $var . $var_suffix});
}
if (is_array(${$var}))
{
unset_vars(${$var});
@reset(${$var});
}
}
if (is_array(${'_FILES'}))
{
unset_vars(${'_FILES'});
@reset(${'_FILES'});
}
if (is_array(${'HTTP_POST_FILES'}))
{
unset_vars(${'HTTP_POST_FILES'});
@reset(${'HTTP_POST_FILES'});
}
}

//
// addslashes to vars if magic_quotes_gpc is off
// this is a security precaution to prevent someone
// trying to break out of a SQL statement.
//
if( !get_magic_quotes_gpc() )
{
        if( is_array($HTTP_GET_VARS) )
        {
                while( list($k, $v) = each($HTTP_GET_VARS) )
                {
                        if( is_array($HTTP_GET_VARS[$k]) )
                        {
                                while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
                                {
                                        $HTTP_GET_VARS[$k][$k2] = addslashes($v2);
                                }
                                @reset($HTTP_GET_VARS[$k]);
                        }
                        else
                        {
                                $HTTP_GET_VARS[$k] = addslashes($v);
                        }
                }
                @reset($HTTP_GET_VARS);
        }

        if( is_array($HTTP_POST_VARS) )
        {
                while( list($k, $v) = each($HTTP_POST_VARS) )
                {
                        if( is_array($HTTP_POST_VARS[$k]) )
                        {
                                while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) )
                                {
                                        $HTTP_POST_VARS[$k][$k2] = addslashes($v2);
                                }
                                @reset($HTTP_POST_VARS[$k]);
                        }
                        else
                        {
                                $HTTP_POST_VARS[$k] = addslashes($v);
                        }
                }
                @reset($HTTP_POST_VARS);
        }

        if( is_array($HTTP_COOKIE_VARS) )
        {
                while( list($k, $v) = each($HTTP_COOKIE_VARS) )
                {
                        if( is_array($HTTP_COOKIE_VARS[$k]) )
                        {
                                while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) )
                                {
                                        $HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2);
                                }
                                @reset($HTTP_COOKIE_VARS[$k]);
                        }
                        else
                        {
                                $HTTP_COOKIE_VARS[$k] = addslashes($v);
                        }
                }
                @reset($HTTP_COOKIE_VARS);
        }
}

//
// Define some basic configuration arrays this also prevents
// malicious rewriting of language and otherarray values via
// URI params
//
$board_config = array();
$userdata = array();
$theme = array();
$images = array();
$lang = array();
$nav_links = array();
$gen_simple_header = FALSE;

include($phpbb_root_path . 'config.'.$phpEx);

if( !defined("PHPBB_INSTALLED") )
{
        header("Location: modules.php?name=Forums&file=install");
        exit;
}

global $forum_admin;
if ($forum_admin == 1) {
    //include("../../../db/db.php");
    include("../../../includes/constants.php");
    include("../../../includes/template.php");
    include("../../../includes/sessions.php");
    include("../../../includes/auth.php");
    include("../../../includes/functions.php");
} else {
    include("includes/constants.php");
    include("includes/template.php");
    include("includes/sessions.php");
    include("includes/auth.php");
    include("includes/functions.php");
    include("db/db.php");
}

//
// Obtain and encode users IP
//
// I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as
// private range IP's appearing instead of the guilty routable IP, tough, don't
// even bother complaining ... go scream and shout at the idiots out there who feel
// "clever" is doing harm rather than good ... karma is a great thing ... :)
//
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR );

$user_ip = encode_ip($client_ip);

//
// Setup forum wide options, if this fails
// then we output a CRITICAL_ERROR since
// basic forum information is not available
//
$sql = "SELECT *
        FROM " . CONFIG_TABLE;
if( !($result = $db->sql_query($sql)) )
{
        message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
}

while ( $row = $db->sql_fetchrow($result) )
{
        $board_config[$row['config_name']] = $row['config_value'];
}


//
// Show 'Board is disabled' message if needed.
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
{
        message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}

?>



Back to top Reply with quote
#2   re: Houston we lost forums
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 61
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
Same problem here. Anyone found the solution?



Back to top Reply with quote
#3   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Looks like you missed a line in the second edit recheck it.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#4   re: Houston we lost forums
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 61
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
DOH! That fixed it for me!

Thanks



Back to top Reply with quote
#5   re: Houston we lost forums
webshark
PayPal Donation
CZ Moderator
 Codezwiz Site Donator
webshark has been a member for over 20 year's 20 Year Member
turkey.gif
Age: 55
Gender: Male
Website:
Status: Offline
Joined: Mar 23, 2004
0.09 posts per day
Posts: 643
Points: 57,200
   
i tryed again and it same icon_redface.gif



Back to top Reply with quote
#6   re: Houston we lost forums
webshark
PayPal Donation
CZ Moderator
 Codezwiz Site Donator
webshark has been a member for over 20 year's 20 Year Member
turkey.gif
Age: 55
Gender: Male
Website:
Status: Offline
Joined: Mar 23, 2004
0.09 posts per day
Posts: 643
Points: 57,200
   
daut
can u please put ure common.php here so i can copy it icon_rolleyes.gif



Back to top Reply with quote
#7   re: Houston we lost forums
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 61
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
Here it is, but with some modifications. If it doesn't work, let me know. I have a heavily modded forum, and I don't know if all of it will work for you.

<?php
/***************************************************************************
*                                common.php
*                            -------------------
*   begin                : Saturday, Feb 23, 2001
*   copyright            : (C) 2001 The phpBB Group
*   email                : [ Register or login to view links on this board. ]
*
*   $Id: common.php,v 1.74.2.10 2003/06/04 17:41:39 acydburn Exp $
*
*
***************************************************************************/
/***************************************************************************
* phpbb2 forums port version 2.0.5 (c) 2003 - Nuke Cops (http://nukecops.com)
*
* Ported by Nuke Cops to phpbb2 standalone 2.0.5 Test
* and debugging completed by the Elite Nukers and site members.
*
* You run this package at your sole risk. Nuke Cops and affiliates cannot
* be held liable if anything goes wrong. You are advised to test this
* package on a development system. Backup everything before implementing
* in a production environment. If something goes wrong, you can always
* backout and restore your backups.
*
* Installing and running this also means you agree to the terms of the AUP
* found at Nuke Cops.
*
* This is version 2.0.5 of the phpbb2 forum port for PHP-Nuke. Work is based
* on Tom Nitzschner's forum port version 2.0.6. Tom's 2.0.6 port was based
* on the phpbb2 standalone version 2.0.3. Our version 2.0.5 from Nuke Cops is
* now reflecting phpbb2 standalone 2.0.5 that fixes some bugs and the
* invalid_session error message.
***************************************************************************/
/***************************************************************************
*   This file is part of the phpBB2 port to Nuke 6.0 (c) copyright 2002
*   by Tom Nitzschner (tom@toms-home.com)
*   http://bbtonuke.sourceforge.net (or http://www.toms-home.com)
*
*   As always, make a backup before messing with anything. All code
*   release by me is considered sample code only. It may be fully
*   functual, but you use it at your own risk, if you break it,
*   you get to fix it too. No waranty is given or implied.
*
*   Please post all questions/request about this port on http://bbtonuke.sourceforge.net first,
*   then on my site. All original header code and copyright messages will be maintained
*   to give credit where credit is due. If you modify this, the only requirement is
*   that you also maintain all original copyright messages. All my work is released
*   under the GNU GENERAL PUBLIC LICENSE. Please see the README for more information.
*
***************************************************************************/
/***************************************************************************
*
*   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.
*
***************************************************************************/

if ( !defined('IN_PHPBB') )
{
        die("Hacking attempt");
}
//Unset Vars
function unset_vars(&$var)
{
  while (list($var_name, $null) = @each($var))
  {
    if ( ! ( $var_name == 'phpbb_root_path' || $var_name == 'no_page_header' || $var_name == 'phpEx' || $var_name == 'admin' || $var_name == 'user' || $var_name == 'name' ) )
    {
      unset($GLOBALS[$var_name]);
    }
  }
  return;
}
error_reporting  (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
$ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';
// Unset globally registered vars - PHP5 ... hhmmm
if (@$ini_val('register_globals') == '1' || strtolower(@$ini_val('register_globals')) == 'on')
{
    $var_prefix = 'HTTP';
    $var_suffix = '_VARS';

    $test = array('_GET', '_POST', '_SERVER', '_COOKIE', '_ENV');

    foreach ($test as $var)
    {
        if (is_array(${$var_prefix . $var . $var_suffix}))
        {
            unset_vars(${$var_prefix . $var . $var_suffix});
            @reset(${$var_prefix . $var . $var_suffix});
        }

        if (is_array(${$var}))
        {
            unset_vars(${$var});
            @reset(${$var});
        }
    }

    if (is_array(${'_FILES'}))
    {
        unset_vars(${'_FILES'});
        @reset(${'_FILES'});
    }

    if (is_array(${'HTTP_POST_FILES'}))
    {
        unset_vars(${'HTTP_POST_FILES'});
        @reset(${'HTTP_POST_FILES'});
    }
}
//
// addslashes to vars if magic_quotes_gpc is off
// this is a security precaution to prevent someone
// trying to break out of a SQL statement.
//
if( !get_magic_quotes_gpc() )
{
        if( is_array($HTTP_GET_VARS) )
        {
                while( list($k, $v) = each($HTTP_GET_VARS) )
                {
                        if( is_array($HTTP_GET_VARS[$k]) )
                        {
                                while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
                                {
                                        $HTTP_GET_VARS[$k][$k2] = addslashes($v2);
                                }
                                @reset($HTTP_GET_VARS[$k]);
                        }
                        else
                        {
                                $HTTP_GET_VARS[$k] = addslashes($v);
                        }
                }
                @reset($HTTP_GET_VARS);
        }

        if( is_array($HTTP_POST_VARS) )
        {
                while( list($k, $v) = each($HTTP_POST_VARS) )
                {
                        if( is_array($HTTP_POST_VARS[$k]) )
                        {
                                while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) )
                                {
                                        $HTTP_POST_VARS[$k][$k2] = addslashes($v2);
                                }
                                @reset($HTTP_POST_VARS[$k]);
                        }
                        else
                        {
                                $HTTP_POST_VARS[$k] = addslashes($v);
                        }
                }
                @reset($HTTP_POST_VARS);
        }

        if( is_array($HTTP_COOKIE_VARS) )
        {
                while( list($k, $v) = each($HTTP_COOKIE_VARS) )
                {
                        if( is_array($HTTP_COOKIE_VARS[$k]) )
                        {
                                while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) )
                                {
                                        $HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2);
                                }
                                @reset($HTTP_COOKIE_VARS[$k]);
                        }
                        else
                        {
                                $HTTP_COOKIE_VARS[$k] = addslashes($v);
                        }
                }
                @reset($HTTP_COOKIE_VARS);
        }
}

//
// Define some basic configuration arrays this also prevents
// malicious rewriting of language and otherarray values via
// URI params
//
$board_config = array();
$userdata = array();
$theme = array();
$images = array();
$lang = array();
$nav_links = array();
$gen_simple_header = FALSE;

include($phpbb_root_path . 'config.'.$phpEx);

if( !defined("PHPBB_INSTALLED") )
{
        header("Location: modules.php?name=Forums&file=install");
        exit;
}

global $forum_admin;
if ($forum_admin == 1) {
    //include("../../../db/db.php");
    include("../../../includes/constants.php");
    include("../../../includes/template.php");
    include("../../../includes/sessions.php");
    include("../../../includes/auth.php");
    include("../../../includes/functions.php");
   if ( defined('IN_CASHMOD') )
{
   include('../../../includes/functions_cash.'.$phpEx);
}
} else {
    include("includes/constants.php");
    include("includes/template.php");
    include("includes/sessions.php");
    include("includes/auth.php");
    include("includes/functions.php");
    include("db/db.php");
   if ( defined('IN_CASHMOD') )
{
   include('includes/functions_cash.'.$phpEx);
}
}

//
// Obtain and encode users IP
//
// I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as
// private range IP's appearing instead of the guilty routable IP, tough, don't
// even bother complaining ... go scream and shout at the idiots out there who feel
// "clever" is doing harm rather than good ... karma is a great thing ... :)
//
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR );
$user_ip = encode_ip($client_ip);

//
// Setup forum wide options, if this fails
// then we output a CRITICAL_ERROR since
// basic forum information is not available
//
$sql = "SELECT *
        FROM " . CONFIG_TABLE;
if( !($result = $db->sql_query($sql)) )
{
        message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
}

while ( $row = $db->sql_fetchrow($result) )
{
        $board_config[$row['config_name']] = $row['config_value'];
}
include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx);

//
// Show 'Board is disabled' message if needed.
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
{
        message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}

?>



Back to top Reply with quote
#8   re: Houston we lost forums
webshark
PayPal Donation
CZ Moderator
 Codezwiz Site Donator
webshark has been a member for over 20 year's 20 Year Member
turkey.gif
Age: 55
Gender: Male
Website:
Status: Offline
Joined: Mar 23, 2004
0.09 posts per day
Posts: 643
Points: 57,200
   
tyvm
but had errors coz of mods and delete it again may be i couldnt try to patch at 6.30 am icon_sad.gif



Back to top Reply with quote
#9   re: Houston we lost forums
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 61
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
Post your original common.php for me, and I will see if I can mod it for you and repost it here.



Back to top Reply with quote
#10   re: Houston we lost forums
webshark
PayPal Donation
CZ Moderator
 Codezwiz Site Donator
webshark has been a member for over 20 year's 20 Year Member
turkey.gif
Age: 55
Gender: Male
Website:
Status: Offline
Joined: Mar 23, 2004
0.09 posts per day
Posts: 643
Points: 57,200
   
ty daut

i find 11 icon_cool.gif



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum