<?php
include_once (ROOT . FOLDER_CORE . '/auth.php'); 
if ($auth == 1) {
    $cli_user = $_SERVER["HTTP_CLIENT_ID"];
    if (isset($_POST["doc_fichero_1"])) {
        $coding_file_1 = $_POST["doc_fichero_1"];
        if (isset($_POST["doc_name_1"])) {
            include_once ('servAddDocSerban_uploadDoc.php');
        }else {
            $data[] = array ( 
                "status" => "NOT OK",
                "message" => "error : doc_name is missing"
            );
        }                               
    }else {
        $data[] = array ( 
            "status" => "NOT OK",
            "message" => "error : doc_fichero is missing"
        );
    }
    header("Content-type: application/json; charset=utf-8");
    echo json_encode($data);
}elseif ($auth == 0) {
    $data = array();
    $data[] = array ( 
        "code" => "unauthorized_client",
        "message" => "Invalid authorization token"
    );
    header("Content-type: application/json; charset=utf-8");
    echo json_encode($data);
}
?>