// Global CDN variable
// global $rs_cdn;
// $rs_cdn = (isset($_SESSION['cdn'])) ? $_SESSION['cdn'] : new RS_CDN();
// Start session, if not started
if (!session_id()) {
    session_start();
}
// Define session data
defined('RS_CDN_PATH') or die;
$_SESSION['cdn'] = isset($_SESSION['cdn']) ? $_SESSION['cdn'] : new RS_CDN();
$_SESSION['cdn_settings'] = $_SESSION['cdn']->api_settings;
// Save CDN settings
save_cdn_settings();
$settings_error = false;
// Get files and counts
$local_files = load_files_needing_upload();
$local_count = count($local_files);
// Check if connection has been made by grabbing container
try {
    $container = $_SESSION['cdn']->container_object();
} catch (Exception $e) {
    $settings_error = true;
}
?>
<script type="text/javascript">
	var plugin_path = "<?php 
echo RS_CDN_URL;
?>
";
</script>
<div class="wrap rs_cdn">
/**
 * Get a list of the files that need uploaded
 */
function get_files($params)
{
    echo json_encode(load_files_needing_upload());
    die;
}