checkPassword($_SESSION["mainconf_password"])) { $exporter = new ConfigDataExporter(); if (!headers_sent()) { header('Content-Type: application/json; charset=utf-8'); header('Content-disposition: attachment; filename=lam-config.json'); } echo $exporter->exportAsJson(); exit; } echo $_SESSION['header']; printHeaderContents(_("Import and export configuration"), '../..'); ?>


setCSSClasses(array('maxrow fullwidth roundedShadowBox spacing5')); if ($message !== null) { $loginContent->add($message, 12); } $pwdInput = new htmlResponsiveInputField(_("Master password"), 'password', '', '236'); $pwdInput->setIsPassword(true); $loginContent->add($pwdInput, 12); $loginContent->addLabel(new htmlOutputText(' ', false)); $loginContent->addField(new htmlButton('submitLogin', _("Ok"))); $content->add($loginContent, 12); parseHtml(null, $content, array(), false, $tabindex, null); } /** * Checks the login password. * * @param LAMCfgMain $cfg main config * @return bool login ok */ function checkLogin($cfg) { $password = $_POST['password']; if ($cfg->checkPassword($password)) { $_SESSION["mainconf_password"] = $password; return true; } showLoginDialog(new htmlStatusMessage('ERROR', _('The password is invalid! Please try again.'))); return false; } /** * Displays the import/export functions. * * @param LAMCfgMain $cfg main config */ function displayImportExport($cfg) { $tabindex = 0; $content = new htmlResponsiveRow(); $content->add(new htmlSubTitle(_('Export')), 12); $content->add(new htmlButton('exportConfig', _('Export')), 12); $content->add(new htmlSubTitle(_('Import')), 12); parseHtml(null, $content, array(), false, $tabindex, null); } ?>