<?php // User views the owners, members and guests of this campaign include 'db_config.php'; include 'include/query.php'; include 'include/ownership.php'; include 'include/output.php'; session_start(); if (!isset($_SESSION['user'])) { header('HTTP/1.1 401 Unauthorized', true, 401); exit('You are not logged in.'); } $campaign = intval($_REQUEST['campaign']); if (LT_can_view_campaign($campaign)) { if (is_array($rows = LT_call('read_campaign_users', $campaign))) { LT_output_array($rows, array('integer' => array('id', 'avatar'), 'boolean' => array('viewing'), 'json' => array('cursor'))); } }
<?php // Admin views all messages in a campaign include 'db_config.php'; include 'include/query.php'; include 'include/output.php'; session_start(); if (!isset($_SESSION['admin'])) { header('HTTP/1.1 401 Unauthorized', true, 401); exit('You are not logged in.'); } // Interpret the Request $campaign = intval($_REQUEST['campaign']); $last_message = 0; // show all messages // Query the Database if (is_array($rows = LT_call('read_messages', $campaign, $last_message))) { LT_output_array($rows, array('integer' => array('id', 'user_id', 'avatar', 'time'))); }
<?php // User disowns a map or removes another user from the map's owners include 'db_config.php'; include 'include/query.php'; include 'include/ownership.php'; include 'include/output.php'; session_start(); if (!isset($_SESSION['user'])) { header('HTTP/1.1 401 Unauthorized', true, 401); exit('You are not logged in.'); } $map = intval($_REQUEST['map']); if (LT_can_edit_map($map)) { if (is_array($rows = LT_call('read_map_owners', $map))) { LT_output_array($rows, array('integer' => array('id'), 'boolean' => array('logged_in'))); } }
<?php // User views the blacklist of this campaign include 'db_config.php'; include 'include/query.php'; include 'include/ownership.php'; include 'include/output.php'; session_start(); if (!isset($_SESSION['user'])) { header('HTTP/1.1 401 Unauthorized', true, 401); exit('You are not logged in.'); } $campaign = intval($_REQUEST['campaign']); if (LT_can_view_campaign($campaign)) { if (is_array($rows = LT_call('read_campaign_user_blacklist', $campaign))) { LT_output_array($rows, array()); } }
<?php // Admin resets a user's password include 'db_config.php'; include 'include/query.php'; include 'include/output.php'; session_start(); if (!isset($_SESSION['admin'])) { header('HTTP/1.1 401 Unauthorized', true, 401); exit('You are not logged in.'); } if (is_array($rows = LT_call('read_campaigns'))) { LT_output_array($rows, array('integer' => array('id'))); }
<?php // User views a list of characters he owns include 'db_config.php'; include 'include/query.php'; include 'include/output.php'; session_start(); if (!isset($_SESSION['user'])) { header('HTTP/1.1 401 Unauthorized', true, 401); exit('You are not logged in.'); } if (is_array($rows = LT_call('read_characters', intval($_SESSION['user'])))) { LT_output_array($rows, array('integer' => array('id'), 'json' => array('stats', 'notes', 'portrait', 'piece'))); }
<?php // Admin views all users include 'db_config.php'; include 'include/query.php'; include 'include/output.php'; session_start(); if (!isset($_SESSION['admin'])) { header('HTTP/1.1 401 Unauthorized', true, 401); exit('You are not logged in.'); } // Query the Database if (is_array($rows = LT_call('read_users'))) { LT_output_array($rows, array('integer' => array('id', 'reset_time', 'last_action'), 'boolean' => array('logged_in', 'subscribed'))); }
<?php // User loads a map or refreshes an updated map include 'db_config.php'; include 'include/query.php'; include 'include/ownership.php'; include 'include/output.php'; session_start(); if (!isset($_SESSION['user'])) { header('HTTP/1.1 401 Unauthorized', true, 401); exit('You are not logged in.'); } $map = intval($_REQUEST['map']); if (LT_can_view_map($map)) { if (is_array($rows = LT_call('read_pieces', $map))) { LT_output_array($rows, array('integer' => array('id', 'map', 'character'), 'json' => array('image', 'markers'), 'float' => array('x', 'y'), 'boolean' => array('locked'))); } }
<?php // User views the maps he owns include 'db_config.php'; include 'include/query.php'; include 'include/output.php'; session_start(); if (!isset($_SESSION['user'])) { header('HTTP/1.1 401 Unauthorized', true, 401); exit('You are not logged in.'); } if (is_array($rows = LT_call('read_maps', intval($_SESSION['user'])))) { LT_output_array($rows, array('integer' => array('id', 'rows', 'columns'))); }
<?php // User views campaigns he owns and campaigns he has been invited to include 'db_config.php'; include 'include/query.php'; include 'include/output.php'; session_start(); if (!isset($_SESSION['user'])) { header('HTTP/1.1 401 Unauthorized', true, 401); exit('You are not logged in.'); } $user = intval($_SESSION['user']); if (is_array($rows = LT_call('read_campaign_user_campaigns', $user))) { LT_output_array($rows, array('integer' => array('campaign'))); }