<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %> <%@ page import="com.ecyrd.jspwiki.*" %> <%@ page import="com.ecyrd.jspwiki.auth.AuthenticationManager" %> <%@ page import="com.ecyrd.jspwiki.ui.Installer" %> <%@ page import="com.ecyrd.jspwiki.log.Logger" %> <%@ page import="com.ecyrd.jspwiki.log.LoggerFactory" %> <%@ page import="java.util.ResourceBundle" %> <%@ page import="java.text.MessageFormat" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %> <%! Logger log = LoggerFactory.getLogger("JSPWiki"); %> <% WikiEngine wiki = WikiEngine.getInstance( getServletConfig() ); // Create wiki context and check for authorization WikiContext wikiContext = wiki.createContext( request, WikiContext.INSTALL ); Installer installer = new Installer( request, config ); WikiSession wikiSession = wikiContext.getWikiSession(); // Parse the existing properties installer.parseProperties(); boolean validated = false; String password = null; ResourceBundle rb = wikiContext.getBundle("CoreResources"); // If user hit "submit" button, validate and install them if( request.getParameter("submit") != null ) { validated = installer.validateProperties(); if ( validated ) { installer.saveProperties(); password = installer.createAdministrator(); if ( password != null ) { Object[] args = { Installer.ADMIN_ID, password, Installer.ADMIN_GROUP }; wikiSession.addMessage( Installer.INSTALL_INFO, MessageFormat.format( rb.getString( "install.jsp.install.msg.rnd.pwd" ), args ) ); } } } if ( !installer.adminExists() ) { wikiSession.addMessage( Installer.INSTALL_WARNING, rb.getString( "install.jsp.install.msg.admin.notexists" ) ); } // Make this HTTP response non-cached, and never-expiring response.addHeader("Pragma", "no-cache"); response.setHeader( "Expires", "-1" ); response.setHeader("Cache-Control", "no-cache" ); response.setContentType("text/html; charset=UTF-8"); %> <fmt:message key="install.jsp.title" />






<% if( validated ) { if ( password != null ) { %>

<% } } else { %>

<% } %>





<%=installer.getPropertiesPath()%>
" />

<% if( validated ) { %>

<%=installer.getProperties()%>
<% } %>