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

	$img_file = $_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 = mb_convert_encoding($img_file, 'SJIS-win', 'UTF-8');
	$attr = getimagesize($img_file_SJIS);
	$fp = fopen($img_file_SJIS, "rb");
	if ($attr && $fp) {
		header('Content-type: '.$attr['mime']);
		fpassthru($fp);
	}
?>
