<?php

	// get the user info
	$query = "
		SELECT
			user.ID AS user,
			user.name AS username,
			timezone.offset AS timezone,
			user.role
		FROM user
		LEFT JOIN timezone ON timezone.ID=user.timezone
		WHERE user.ID=$user_id
	";
	$result = db_do_query($query);
	$row = db_get_row($result, 0);
	
	// save it into the parent system's session for the wrapped pages to access
	$_SESSION["editor"] = $row;
	
	// also save it into the editor's session for standalone pages to access
	session_write_close();
	eval(include_namespace("shared/sessions.php"));
	$_SESSION["editor"] = $row;
	
?>
