<?php
require_once('../site/libs/classes/DbPathsArray.php');
require_once('../site/libs/classes/App_DB.php');

$db = new App_DB(DBU::$dba_user);

// Fetch Front-Page setting
$setting = $db->getRecordSet("SELECT setting_value FROM cms_settings WHERE setting_key = 'frontpage_enabled'");
$enabled = !empty($setting) ? $setting[0]['setting_value'] : '0';

if ($enabled === '1') {
    header("Location: web/");
} else {
    require_once('login_page_logic.php'); // I will move the current index.php logic here
}
?>