} $session = SessionManager::getInstance()->startSession($user); $aParameters["autoLoginUsername"] = $user->getUsername(); $aParameters["auto_start_session"] = $session->getSessionID(); $aPreferences = array(); foreach ($user->getPreferences() as $result) { $aPreferences[] = $result->serialize(); } $aParameters["userPreferences"] = array("response" => array("data" => $aPreferences)); } \Twig_Autoloader::register(); $loader = new \Twig_Loader_Filesystem(dirname(__FILE__) . '/templates/'); $twig = new \Twig_Environment($loader); /* Information about maximum upload sizes */ $maxPostSize = PartKeepr::getBytesFromHumanReadable(ini_get("post_max_size")); $maxFileSize = PartKeepr::getBytesFromHumanReadable(ini_get("upload_max_filesize")); $aParameters["maxUploadSize"] = min($maxPostSize, $maxFileSize); if (!class_exists("Imagick")) { $template = $twig->loadTemplate("error.tpl"); echo $template->render(array("title" => PartKeepr::i18n("ImageMagick is not installed"), "error" => PartKeepr::i18n("You are missing the ImageMagick extension. Please install it and restart the setup to verify that the library was installed correctly."))); exit; } /* ImageMagick formats */ $imagick = new \Imagick(); $aParameters["availableImageFormats"] = $imagick->queryFormats(); /* Automatic Login */ if (Configuration::getOption("partkeepr.frontend.autologin.enabled", false) === true) { $aParameters["autoLoginUsername"] = Configuration::getOption("partkeepr.frontend.autologin.username"); $aParameters["autoLoginPassword"] = Configuration::getOption("partkeepr.frontend.autologin.password"); } if (Configuration::getOption("partkeepr.frontend.motd", false) !== false) {