prepare("SELECT id, username, password_hash, role, full_name, is_active FROM users WHERE username = ? LIMIT 1"); if (!$stmt) { $error = 'Konfigurasi login belum siap. Jalankan migration database terlebih dahulu.'; } else { $stmt->bind_param("s", $user); $stmt->execute(); $result = $stmt->get_result(); $account = $result ? $result->fetch_assoc() : null; if ($account && intval($account['is_active']) === 1 && password_verify($pass, $account['password_hash'])) { session_regenerate_id(true); $_SESSION['user_id'] = intval($account['id']); $_SESSION['username'] = $account['username']; $_SESSION['role'] = $account['role']; $_SESSION['full_name'] = $account['full_name']; $_SESSION['is_admin'] = $account['role'] === 'admin'; header('Location: ' . ($account['role'] === 'admin' ? 'admin.php' : 'index.php')); exit; } $error = 'Username atau password salah.'; $stmt->close(); } } if (isset($conn)) { $conn->close(); } ?>
Halaman ini khusus untuk pengelola data point, polyline, dan polygon.