<?php
// Simple script to view the execution log

// Security check - ensure the user is authenticated
chdir('../');
include($_SERVER['DOCUMENT_ROOT'] . '/includes/include_all.inc.php');

// Check if user is logged in and has appropriate permissions
if(!isset($_SESSION['front_user_id']) || empty($_SESSION['front_user_id'])) {
    header('Content-Type: text/plain');
    echo "Unauthorized access";
    exit;
}

// Set content type for plain text output
header('Content-Type: text/plain');

// Path to log file
$log_file = '/home/anesoft/public_html/.push/execution_log.txt';

if (file_exists($log_file)) {
    echo file_get_contents($log_file);
} else {
    echo "No log file found. The script may not have run yet.";
}
?>