<?php
/**
 * Version:			1.0.0
 * Author:			ali mogheimi
 * Author URI:		http://wpcar.ir
 * Date: 17/01/2016
 */

require_once "include/functions.php";
require_once "include/lang.php" ;
if (file_exists("include/configs.php"))
    require_once "include/configs.php" ;
if (!isset($config) || $config['state']==='NOT'  ){
    require_once "include/install.php";
    exit;
}
require_once "include/error.php";



// check access ip or domain
if ($config['accepted']== 'on' && isset($_GET['secretkey']) ){
    if (in_array(getRealIP(), $config['acceptedserver']) || in_array(getdomain(),$config['acceptedserver'])) {
     // true state
    }else {
        // yor ip is not accepted
        echo '-100';
        exit();
    }
}


if (isset($_GET['secretkey']) ){
    require_once "include/requestfile.php";

}elseif (isset($_GET['ex_key']) || isset($_GET['downloadkey']) ) {
    require_once "include/dl.php";

}else{
    //you can not access to this file
    error_template(401,$config['domain_for_error_page']);
}