<?php
header('Access-Control-Allow-Origin: https://crm.cadline.hu');
header('Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept');

$file = $_SERVER['DOCUMENT_ROOT'] . "/activateServer.txt";
$myfile = fopen($file, "r");

$text = 'Inactive';
$i = 0;

while (!$myfile && $i < 10) {
    $myfile = fopen($file, "r");
    $i++;
}

if ($myfile) {
    $text = fread($myfile, filesize($file));
    fclose($myfile);
}

echo $text;
die();
