true, 'message' => _('Internal server error'), ]; // Yggdrasil connections only if (!preg_match(YGGDRASIL_HOST_REGEX, $_SERVER['REMOTE_ADDR'])) { $response->success = false; $response->message = _('Yggdrasil connection required for this action'); } // Init session else if (!$userId = $db->initUserId($_SERVER['REMOTE_ADDR'], USER_DEFAULT_APPROVED, time())) { $response->success = false; $response->message = _('Could not init user session'); } // Get user else if (!$user = $db->getUser($userId)) { $response->success = false; $response->message = _('Could not init user info'); } // On first visit, redirect user to the welcome page with access level question else if (is_null($user->public)) { header( sprintf('Location: %s/welcome.php', WEBSITE_URL) ); } ?>