<?php
$base_path = '/home/svn/sm-smf/trunk';
$settings_path = '/home/smf/svn_files';
$php_open = '<' . '?' . 'php';
$php_close = '?' . '>';
$revision = trim(str_replace('Revision: ', '', shell_exec('svn info /home/svn/sm-smf/trunk | grep "Revision"')));
require_once(dirname(__FILE__) . '/Settings.php');
// Get.
$contents = file_get_contents($base_path . '/index.php');
// Edit.
$contents = strtr($contents, array(
'require_once(dirname(__FILE__) . \'/Settings.php\');' => 'require(\'' . $settings_path . '/Settings.php\');',
));
// WIP, needs fixing.
if (isset($_GET['destory_session']))
{
$contents = file_get_contents($base_path . '/SSI.php');
$contents = substr($contents, strlen($php_open), -strlen($php_close));
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), -strlen($php_close));
// Send.
$forum_version = 'SMF test';
eval($contents);
require_once($settings_path . '/exit_script.php');
?>