updates error handling

This commit is contained in:
Flatlogic Bot 2026-02-20 06:17:21 +00:00
parent 4dd5015f18
commit 84e9690f02
3 changed files with 42 additions and 8 deletions

View File

@ -246,6 +246,8 @@ body {
padding: 2rem;
transition: all 0.3s;
min-height: 100vh;
display: flex;
flex-direction: column;
}
[dir="rtl"] .main-content {
@ -296,6 +298,7 @@ body {
display: flex;
justify-content: space-between;
align-items: center;
flex-shrink: 0;
}
/* UI Components */
@ -332,6 +335,8 @@ body {
.main-footer {
background: transparent;
color: var(--text-muted);
margin-top: auto;
flex-shrink: 0;
}
.main-footer .border-top {

View File

@ -2,10 +2,26 @@
declare(strict_types=1);
// Sessions setup
if (!is_dir(__DIR__ . '/sessions')) {
mkdir(__DIR__ . '/sessions', 0777, true);
$sessions_dir = __DIR__ . '/sessions';
if (!is_dir($sessions_dir)) {
@mkdir($sessions_dir, 0777, true);
}
if (is_writable($sessions_dir)) {
session_save_path($sessions_dir);
}
// Check for required extensions
$required_extensions = ['pdo', 'pdo_mysql', 'curl', 'json'];
$missing_extensions = [];
foreach ($required_extensions as $ext) {
if (!extension_loaded($ext)) {
$missing_extensions[] = $ext;
}
}
if (!empty($missing_extensions)) {
die("Error: The following PHP extensions are required but missing: " . implode(', ', $missing_extensions) . ". Please contact your hosting provider to enable them.");
}
session_save_path(__DIR__ . '/sessions');
// Enhanced session security and iframe compatibility
if ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')) {
@ -37,9 +53,15 @@ $lang = $_SESSION['lang'];
$dir = ($lang === 'ar') ? 'rtl' : 'ltr';
// Licensing Middleware
$is_activated = LicenseService::isActivated();
$trial_days = LicenseService::getTrialRemainingDays();
$can_access = LicenseService::canAccess();
try {
$is_activated = LicenseService::isActivated();
$trial_days = LicenseService::getTrialRemainingDays();
$can_access = LicenseService::canAccess();
} catch (PDOException $e) {
die("Database Connection Error: " . $e->getMessage() . "<br><br>Please check your <b>db/config.php</b> settings.");
} catch (Exception $e) {
die("Application Error: " . $e->getMessage());
}
$page = $_GET['page'] ?? 'dashboard';
if (!$can_access && $page !== 'activate') {
@ -11255,8 +11277,10 @@ document.addEventListener('DOMContentLoaded', function() {
</div>
<footer class="main-footer d-print-none">
<div class="text-center py-4 border-top mt-5">
<span class="text-muted small">Powered By Meezan Accounting omanapp.cloud aalabry@gmail.com- Whatsapp:+96899359472</span>
<div class="text-center py-3 border-top mt-5">
<div class="text-muted small">
Powered By <strong>Meezan Accounting</strong> &bull; omanapp.cloud &bull; aalabry@gmail.com &bull; Whatsapp: +968 99359472
</div>
</div>
</footer>
</div>

View File

@ -23,6 +23,11 @@ if ($step === 1) {
'status' => extension_loaded('pdo_mysql'),
'current' => extension_loaded('pdo_mysql') ? 'Loaded' : 'Missing'
],
'curl' => [
'name' => 'cURL Extension (Required for Licensing)',
'status' => extension_loaded('curl'),
'current' => extension_loaded('curl') ? 'Loaded' : 'Missing'
],
'config_writable' => [
'name' => 'db/config.php Writable',
'status' => is_writable(__DIR__ . '/../db/config.php'),