/** * Initializes the current logged in user and stores their Account object in Core::$user. * @param bool $bypass */ public static function initUser($bypass = false) { if ($bypass || self::checkIsInstalled()) { $setup = Settings::getSetting("userAccountSetup"); if ($setup == "anonymousAdmin") { self::$user = new Account($setup); self::$isLoggedIn = true; } else { $allowMultiUserAnonUse = Core::checkAllowMultiUserAnonymousUse(); if (isset($_SESSION["account_id"])) { self::$user = new Account($_SESSION["account_id"]); self::$isLoggedIn = true; } else { if ($setup == "multiple" && $allowMultiUserAnonUse == "yes") { self::$user = new Account("anonymousUser"); self::$isLoggedIn = true; } } } } }
<?php require_once "library.php"; Core::init(); // if need be, redirect to the install instructions page Utils::maybeShowInstallationPage(); if (!Core::checkIsLoggedIn() && !Core::checkAllowMultiUserAnonymousUse()) { header("location: login.php#t1"); exit; } // start piecing together all the various info we need to pass to the page $pageParams = array(); $settings = Settings::getSettings(); $exportTypes = Core::$exportTypePlugins; $exportTypeAdditionalSettings = ExportTypePluginHelper::getExportTypeAdditionalSettingsHTML($exportTypes); $dataTypes = DataTypePluginHelper::getDataTypeList(Core::$dataTypePlugins); $exportTypeJSModules = ExportTypePluginHelper::getExportTypeJSResources($exportTypes, "string"); $exportTypeCssIncludes = ExportTypePluginHelper::getExportTypeCSSIncludes($exportTypes); $dataTypeJSModules = DataTypePluginHelper::getDataTypeJSResources($dataTypes, "string"); $dataTypeCssIncludes = DataTypePluginHelper::getDataTypeCSSIncludes($dataTypes); $cssIncludes = $exportTypeCssIncludes . "\n" . $dataTypeCssIncludes; // used in the settings page $pageParams["allCountryPlugins"] = Core::$countryPlugins; $pageParams["allExportTypes"] = $exportTypes; $pageParams["groupedDataTypes"] = Core::$dataTypePlugins; $pageParams["allDataTypes"] = $dataTypes; $pageParams["allTranslations"] = Core::$translations->getList(); $useMinifiedResources = Core::isUsingMinifiedResources(); $pageParams["useMinifiedResources"] = $useMinifiedResources; if ($useMinifiedResources) { $pageParams["minifiedResourcePaths"] = Minification::getMinifiedResourcePaths();
<?php require_once "library.php"; Core::init(); // if need be, redirect to the install instructions page Utils::maybeShowInstallationPage(); $isLoggedIn = Core::checkIsLoggedIn(); if ($isLoggedIn || !$isLoggedIn && Core::checkAllowMultiUserAnonymousUse()) { header("location: ./"); exit; } $pageParams = array(); Templates::displayPage("resources/templates/login.tpl", $pageParams);