<?php

/**
 * Smart Report Maker
 * Version 9.0.0
 * Author : Webuccino
 * All copyrights are preserved to Webuccino
 * URL : http://mysqlreports.com/
 */
ob_start();
define('BASEPATH', 1);
define("DIRECTACESS", 1);
require_once "../request.php";

if (isset($_SESSION[Session_wizard_key]["redirect"])) {
    $redirect = $_SESSION[Session_wizard_key]["redirect"];
    clear_sessions();
    header("Location: " . $redirect);
    exit();
} else {
    die("Access denied!");
}

function clear_sessions()
{
    $keep = array(
        Session_security_key,
        'report_id'
    );

    foreach ($_SESSION as $key => $value) {

        if (!in_array($key, $keep)) {

            unset($_SESSION[$key]);
        }

    }

    return true;
}
