<?php
	require("../__common__/__define_common.php");
	require("../__common__/include-common-all.php");
	require("../account/__logincheck.php");

	$img_file = my_GET('img').'';
	if (defined("photo_LIMITED_IMAGES_FOLDER") and photo_LIMITED_IMAGES_FOLDER <> '') {
		if ($_SESSION['システム管理者'] <> "YES" or photo_LIMITED_ADMIN_NOLIMIT <> 'YES') {
			$len = strlen(photo_LIMITED_IMAGES_FOLDER);
			if (substr($img_file, 0, $len) <> photo_LIMITED_IMAGES_FOLDER) {
				exit;
			}
		}
	}
	if ($img_file == '') {
		exit;
	}
	$img_file_SJIS = myfile_ENCODE($img_file);
	$attr = getimagesize($img_file_SJIS);
	$fp = fopen($img_file_SJIS, "rb");
	if ($attr && $fp) {
		header('Content-type: '.$attr['mime']);
		fpassthru($fp);
	}
?>
