<?php
require __DIR__ . '/_bootstrap.php'; // starts session, loads helpers

// If already logged in, go to dashboard; otherwise to login
if (!empty($_SESSION['admin'])) {
  header('Location: ' . url_for('/admin/dashboard.php'));
} else {
  header('Location: ' . url_for('/admin/login.php'));
}
exit;
