$timezone = $_COOKIE["site" . $app['currentSite']->getId() . "timezone"]; } else { if (in_array('Europe/London', $site->getCachedTimezonesAsList())) { $timezone = 'Europe/London'; } else { $timezone = $site->getCachedTimezonesAsList()[0]; } } } $app['twig']->addGlobal('currentTimeZone', $timezone); $app['twig']->addGlobal('allowedTimeZones', $app['currentSite']->getCachedTimezonesAsList()); $app['currentTimeZone'] = $timezone; # ////////////// Country if (!$app['currentSite']->getCachedIsMultipleCountries()) { $cr = new CountryRepository(); $app['currentSiteHasOneCountry'] = $cr->loadBySite($app['currentSite']); $app['twig']->addGlobal('currentSiteHasOneCountry', $app['currentSiteHasOneCountry']); } # ////////////// Misc header("X-Pingback: " . $app['config']->getWebSiteDomainSecure($app['currentSite']->getSlug()) . "/receivepingback.php"); }); $permissionCalendarChangeRequired = function (Request $request, Application $app) { global $CONFIG; if (!$app['currentUserPermissions']->hasPermission("org.openacalendar", "CALENDAR_CHANGE")) { if ($app['currentUser']) { return $app->abort(403); // TODO } else { return new RedirectResponse($CONFIG->getWebIndexDomainSecure() . '/you/login'); } }