<?php
	$topdir = '..';
	require $topdir."/dacode.php3";

	$session = LoadClass('Session');
	$admin = LoadClass('Admin');

	if (!($session->checked && $session->level&pow(2,22))) {
		echo lecho("you bad boy...");
		exit;
	}

	if (!isset($HTTP_GET_VARS['theme']) || !isset($HTTP_GET_VARS['file'])) {
		echo lecho("Wrong invocation");
		exit;
	}
	$file = $HTTP_GET_VARS['file'];
	$body = $admin->extract_theme_tar($HTTP_GET_VARS['theme'],2,$file);
	if (ereg('\.(jpg|jpeg|gif|png)$', $file, $regs)) {
		header('Content-type: image/'.$regs[1]);
		echo $body;
	} else {
		echo "<pre>\n".htmlentities($body)."\n</pre>";
	}

?>
