mirror of
https://github.com/ellite/Wallos.git
synced 2025-12-23 23:18:07 -05:00
fix: wrong check for disabling password login fix: missing apikey validation error on get_monthly_cost api endpoint chore: update readme
16 lines
531 B
PHP
16 lines
531 B
PHP
<?php
|
|
|
|
$currentPage = basename($_SERVER['PHP_SELF']);
|
|
if ($currentPage == 'index.php') {
|
|
// Redirect to subscriptions page if no subscriptions exist
|
|
$stmt = $db->prepare("SELECT COUNT(*) FROM subscriptions WHERE user_id = :userId");
|
|
$stmt->bindValue(':userId', $userId, SQLITE3_INTEGER);
|
|
$result = $stmt->execute();
|
|
$row = $result->fetchArray(SQLITE3_NUM);
|
|
$subscriptionCount = $row[0];
|
|
|
|
if ($subscriptionCount === 0) {
|
|
header('Location: subscriptions.php');
|
|
exit;
|
|
}
|
|
} |