<?php
include '../env.php';
require_once(LIB.'common.inc.php');
if (! can_action('view')) {
	echo json_encode(FALSE);
	die;
}

require_once(LIB.'User.class.php');
$userObj = new User();
if (empty($_GET['id'])) {
	if (! is_login()) {
		echo json_encode(FALSE);
		die;
	}
	$user = $userObj->readDetail($_SESSION['user']['login_id']);
} else {
	$user = $userObj->readDetail($_GET['id']);
}

echo json_encode($user);
?>