News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1319595022:v:use_geshi-1:v:type-php

Started by SleePy, Oct 26, 2011, 02:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SleePy

<?php
error_reporting(E_ALL);
ini_set('display_errors', 'on');

$base_path = '/home/svn/sm-smf/trunk';
$settings_path = '/home/smf/svn_files';

$php_open = '<' . '?' . 'php';

$revision = trim(str_replace('Revision: ', '', shell_exec('svn info /home/svn/sm-smf/trunk | grep "Revision"')));

// Get.
$contents = file_get_contents($base_path . '/index.php');

// The revision.

// Edit.
$contents = strtr($contents, array(
   'require_once(dirname(__FILE__) . \'/Settings.php\');' => 'require(\'' . $settings_path . '/Settings.php\');',
));


if (isset($_GET['destory_session']))
{
   $contents = file_get_contents($base_path . '/SSI.php');
   $contents = substr($contents, strlen($php_open));
   eval($contents);

   require_once($sourcedir . '/Subs-Auth.php');
   setLoginCookie(-3600, 0);
   if (isset($_SESSION['login_' . $cookiename]))
      unset($_SESSION['login_' . $cookiename]);

   
   Header('location: ' . str_replace('session_destroy', '', $_SERVER['HTTP_REFERER']));
   exit;
}

// Prepare.
$contents = substr($contents, strlen($php_open));

// Send.
$forum_version = 'SMF test';

$GLOBALS['true_start'] = microtime();
eval($contents);
$GLOBALS['true_end'] = microtime();

// Its quite possible that this actually is overriding the apache call.
require_once($settings_path . '/exit_script.php');
?>
No siggy! :D