You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2009/09/08 05:43:40 UTC

svn commit: r812334 [2/2] - in /incubator/jspwiki/trunk: ./ src/WebContent/WEB-INF/classes/ src/WebContent/WEB-INF/classes/templates/ src/WebContent/admin/ src/java/org/apache/wiki/ src/java/org/apache/wiki/action/ src/java/org/apache/wiki/auth/ src/ja...

Modified: incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default_ru.properties
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default_ru.properties?rev=812334&r1=812333&r2=812334&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default_ru.properties (original)
+++ incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default_ru.properties Tue Sep  8 03:43:37 2009
@@ -484,30 +484,28 @@
 javascript.tip.default.title=\u0411\u043e\u043b\u044c\u0448\u0435...
 javascript.prefs.areyousure=\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0443\u0442\u0435\u0440\u044f\u043d\u044b. \u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c?
 #Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
-install.jsp.intro.title=\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 JSPWiki 
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
-install.jsp.intro.p1=\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e!  \u042d\u0442\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0432\u043e\u0441\u043f\u043e\u043c\u0430\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f 
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
-install.jsp.intro.p2=\u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430, \u0448\u0430\u0431\u043b\u043e\u043d \u0444\u0430\u0439\u043b\u0430 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 (<code>jspwiki.properties</code>) \u0431\u0443\u0434\u0435\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u043e\u0434 \u0432\u0430\u0448\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0
 43d\u0430\u0439\u0434\u0435\u043d, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u044b\u0439.   \t\t     
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
 install.jsp.intro.p3=\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c JSPWiki, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b <code>jspwiki.properties</code> \u0432\u0440\u0443\u0447\u043d\u0443\u044e.  
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
-install.jsp.basics.title=\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
-install.jsp.adv.settings.title=\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.appname.desc.
-applicationName.description=\u041a\u0430\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043b\u044f \u0432\u0438\u043a\u0438? 
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.baseurl.desc.
-baseURL.description=\u041c\u0435\u0441\u0442\u043e\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0439 \u0432\u0438\u043a\u0438 (http:yourwiki.domain.com).
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.page.storage.desc.
-pageDir.description=\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, JSPWiki \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u0432\u043e\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u043d\u0430 \u0436\u0451\u0441\u0442\u043a\u043e\u043c \u0434\u0438\u0441\u043a\u0435. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0430\u044f \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, JSPWiki \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0435\u0451. \u0422\u0430\u043c \u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b,\u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u044b\u0435 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c. 
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.adv.settings.logfile.desc.
-logFile.description=\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.adv.settings.workdir.desc.
-workDir.description=\u0422\u0443\u0442 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u0435\u0448-\u0444\u0430\u0439\u043b\u044b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b.
 #Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.instr.desc.
 install.configure.description=\u041f\u043e\u0441\u043b\u0435 \u043a\u043b\u0438\u043a\u0430  <em>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430!</em> , \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0438\u0448\u0435\u0442 \u0432\u0430\u0448\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432  \u0444\u0430\u0439\u043b <code>{0}</code>.   \u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0443\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0433\u0440\u0443\u043f\u0435 \u0430\u0434\u043c\u0438\u043d \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u043c \u043f\u0430\u0440\u043e\u043b\u0435\u043c.
 #Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.validated.new.props.
 install.jspwiki.properties=\u0412\u043e\u0442 \u0412\u0430\u0448\u0438 \u043d\u043e\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 (jspwiki.properties)
 #Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
 install.title=\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 JSPWiki 
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.intro.p1.
+install.intro.p1=\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e!  \u042d\u0442\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0432\u043e\u0441\u043f\u043e\u043c\u0430\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f 
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.intro.p2.
+install.intro.p2=\u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430, \u0448\u0430\u0431\u043b\u043e\u043d \u0444\u0430\u0439\u043b\u0430 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 (<code>jspwiki.properties</code>) \u0431\u0443\u0434\u0435\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u043e\u0434 \u0432\u0430\u0448\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043d\
 u0430\u0439\u0434\u0435\u043d, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u044b\u0439.   \t\t     
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.title.
+install.basics=\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.appname.desc.. Formerly named applicationName.description.
+install.applicationName.description=\u041a\u0430\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043b\u044f \u0432\u0438\u043a\u0438? 
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.baseurl.desc.. Formerly named baseURL.description.
+install.baseURL.description=\u041c\u0435\u0441\u0442\u043e\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0439 \u0432\u0438\u043a\u0438 (http:yourwiki.domain.com).
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.page.storage.desc.. Formerly named pageDir.description.
+install.pageDir.description=\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, JSPWiki \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u0432\u043e\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u043d\u0430 \u0436\u0451\u0441\u0442\u043a\u043e\u043c \u0434\u0438\u0441\u043a\u0435. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0430\u044f \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, JSPWiki \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0435\u0451. \u0422\u0430\u043c \u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b,\u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u044b\u0435 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c. 
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.adv.settings.logfile.desc.. Formerly named logFile.description.. Formerly named logDirectory.description.
+install.logDirectory.description=\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.adv.settings.workdir.desc.. Formerly named workDir.description.
+install.workDir.description=\u0422\u0443\u0442 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u0435\u0448-\u0444\u0430\u0439\u043b\u044b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b.
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.adv.settings.title.
+install.advanced=\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438

Modified: incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default_zh_CN.properties
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default_zh_CN.properties?rev=812334&r1=812333&r2=812334&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default_zh_CN.properties (original)
+++ incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/templates/default_zh_CN.properties Tue Sep  8 03:43:37 2009
@@ -484,30 +484,28 @@
 javascript.tip.default.title=\u66f4\u591a...
 javascript.prefs.areyousure=\u5982\u679c\u6ca1\u6709\u5355\u51fb\u201c\u4fdd\u5b58\u7528\u6237\u9996\u9009\u9879\u201d\u6309\u94ae\uff0c\u524d\u9762\u6240\u505a\u7684\u66f4\u6539\u5c06\u4e22\u5931\u3002\u662f\u5426\u8981\u9000\u51fa\u6b64\u9875\u9762\uff1f
 #Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
-install.jsp.intro.title=JSPWiki \u5b89\u88c5\u7a0b\u5e8f
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
-install.jsp.intro.p1=\u6b22\u8fce\u4f7f\u7528 JSPWiki\uff01\u672c JSP \u9875\u9762\u65e8\u5728\u5e2e\u52a9\u60a8\u5b8c\u6210 JSPWiki \u5b89\u88c5\u7684\u7b2c\u4e00\u4e2a\u9636\u6bb5\u3002\u5982\u679c\u770b\u5230\u6b64\u9875\u9762\uff0c\u8bf4\u660e\u60a8\u5df2\u7ecf\u5728 Web \u5bb9\u5668\uff08Web Container\uff09\u91cc\u6b63\u786e\u5730\u5b89\u88c5\u4e86 JSPWiki\u3002
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
-install.jsp.intro.p2=\u73b0\u5728\u8fd8\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u914d\u7f6e\u3002\u5728\u6309\u4e0b\u201c\u914d\u7f6e\uff01\u201d\u540e\uff0c\u5c06\u4f1a\u4fee\u6539\u7a0b\u5e8f\u5305\u91cc\u7684 <code>jspwiki.properties</code> \u6587\u4ef6\uff0c\u5982\u679c\u627e\u4e0d\u5230\u7684\u8fd9\u4e2a\u6587\u4ef6\u7684\u8bdd\uff0c\u7a0b\u5e8f\u4f1a\u521b\u5efa\u8fd9\u6837\u4e00\u4e2a\u65b0\u6587\u4ef6\u3002
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
 install.jsp.intro.p3=\u672c\u5b89\u88c5\u7a0b\u5e8f\u662f\u9488\u5bf9\u90a3\u4e9b\u53ea\u60f3\u5c3d\u5feb\u5b89\u88c5\u5e76\u8fd0\u884c JSPWiki \u7684\u4eba\u8bbe\u8ba1\u7684\u3002\u5982\u679c\u60a8\u6253\u7b97\u628a JSPWiki \u96c6\u6210\u5230\u73b0\u6709\u7684\u7cfb\u7edf\uff0c\u5efa\u8bae\u76f4\u63a5\u7f16\u8f91 <code>jspwiki.properties</code> \u6587\u4ef6\u3002\u53ef\u4ee5\u5728 <code>yourwiki/WEB-INF/</code> \u4e0b\u9762\u627e\u5230\u4e00\u4e2a\u6837\u672c\u914d\u7f6e\u6587\u4ef6\u3002
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
-install.jsp.basics.title=\u57fa\u672c
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
-install.jsp.adv.settings.title=\u9ad8\u7ea7\u8bbe\u7f6e
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.appname.desc.
-applicationName.description=\u6253\u7b97\u600e\u4e48\u547d\u540d\u60a8\u7684 wiki\uff1f\u5c3d\u91cf\u4f7f\u7528\u76f8\u5bf9\u7b80\u77ed\u7684\u540d\u79f0\u3002
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.baseurl.desc.
-baseURL.description=\u8bf7\u6307\u5b9a JSPWiki \u7684\u4f4d\u7f6e\u3002
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.page.storage.desc.
-pageDir.description=\u7f3a\u7701\u60c5\u51b5\u4e0b\uff0cJSPWiki \u4f1a\u4f7f\u7528 VersioningFileProvider\uff0c\u5b83\u4f1a\u628a\u6587\u4ef6\u4fdd\u5b58\u5728\u60a8\u7684\u786c\u76d8\u4e0a\u7684\u7279\u5b9a\u76ee\u5f55\u3002\u5982\u679c\u6307\u5b9a\u4e86\u4e0d\u5b58\u5728\u7684\u76ee\u5f55\uff0cJSPWiki \u4f1a\u81ea\u52a8\u521b\u5efa\u3002\u6240\u6709\u7684\u9644\u4ef6\u4e5f\u4f1a\u4fdd\u5b58\u5728\u8fd9\u4e2a\u76ee\u5f55\u3002
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.adv.settings.logfile.desc.
-logFile.description=JSPWiki \u4f7f\u7528 Jakarta Log4j \u8bb0\u5f55\u65e5\u5fd7\u3002\u8bf7\u544a\u8bc9 JSPWiki \u65e5\u5fd7\u6587\u4ef6\u7684\u4fdd\u5b58\u4f4d\u7f6e\u3002
-#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.adv.settings.workdir.desc.
-workDir.description=\u8fd9\u4e2a\u5730\u65b9\u4f1a\u4fdd\u5b58\u6240\u6709\u7f13\u5b58\u548c\u5176\u4ed6\u8fd0\u884c\u65f6\u751f\u6210\u7684\u6570\u636e\u3002
 #Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.instr.desc.
 install.configure.description=\u5728\u5355\u51fb<em>\u914d\u7f6e\uff01</em>\u540e\uff0c\u5b89\u88c5\u7a0b\u5e8f\u5c06\u628a\u60a8\u7684\u8bbe\u7f6e\u5199\u5230 <code>{0}</code>\u3002 \u5b83\u8fd8\u4f1a\u521b\u5efa\u4e00\u4e2a\u7ba1\u7406\u5458\u5e10\u6237\uff08\u5bc6\u7801\u968f\u673a\u751f\u6210\uff09\u548c\u4e00\u4e2a Admin \u7ec4\u3002
 #Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.validated.new.props.
 install.jspwiki.properties=\u4e0b\u9762\u662f\u60a8\u7684\u65b0 jspwiki.properties \u6587\u4ef6
 #Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.
 install.title=JSPWiki \u5b89\u88c5\u7a0b\u5e8f
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.intro.p1.
+install.intro.p1=\u6b22\u8fce\u4f7f\u7528 JSPWiki\uff01\u672c JSP \u9875\u9762\u65e8\u5728\u5e2e\u52a9\u60a8\u5b8c\u6210 JSPWiki \u5b89\u88c5\u7684\u7b2c\u4e00\u4e2a\u9636\u6bb5\u3002\u5982\u679c\u770b\u5230\u6b64\u9875\u9762\uff0c\u8bf4\u660e\u60a8\u5df2\u7ecf\u5728 Web \u5bb9\u5668\uff08Web Container\uff09\u91cc\u6b63\u786e\u5730\u5b89\u88c5\u4e86 JSPWiki\u3002
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.intro.p2.
+install.intro.p2=\u73b0\u5728\u8fd8\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u914d\u7f6e\u3002\u5728\u6309\u4e0b\u201c\u914d\u7f6e\uff01\u201d\u540e\uff0c\u5c06\u4f1a\u4fee\u6539\u7a0b\u5e8f\u5305\u91cc\u7684 <code>jspwiki.properties</code> \u6587\u4ef6\uff0c\u5982\u679c\u627e\u4e0d\u5230\u7684\u8fd9\u4e2a\u6587\u4ef6\u7684\u8bdd\uff0c\u7a0b\u5e8f\u4f1a\u521b\u5efa\u8fd9\u6837\u4e00\u4e2a\u65b0\u6587\u4ef6\u3002
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.title.
+install.basics=\u57fa\u672c
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.appname.desc.. Formerly named applicationName.description.
+install.applicationName.description=\u6253\u7b97\u600e\u4e48\u547d\u540d\u60a8\u7684 wiki\uff1f\u5c3d\u91cf\u4f7f\u7528\u76f8\u5bf9\u7b80\u77ed\u7684\u540d\u79f0\u3002
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.baseurl.desc.. Formerly named baseURL.description.
+install.baseURL.description=\u8bf7\u6307\u5b9a JSPWiki \u7684\u4f4d\u7f6e\u3002
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.basics.page.storage.desc.. Formerly named pageDir.description.
+install.pageDir.description=\u7f3a\u7701\u60c5\u51b5\u4e0b\uff0cJSPWiki \u4f1a\u4f7f\u7528 VersioningFileProvider\uff0c\u5b83\u4f1a\u628a\u6587\u4ef6\u4fdd\u5b58\u5728\u60a8\u7684\u786c\u76d8\u4e0a\u7684\u7279\u5b9a\u76ee\u5f55\u3002\u5982\u679c\u6307\u5b9a\u4e86\u4e0d\u5b58\u5728\u7684\u76ee\u5f55\uff0cJSPWiki \u4f1a\u81ea\u52a8\u521b\u5efa\u3002\u6240\u6709\u7684\u9644\u4ef6\u4e5f\u4f1a\u4fdd\u5b58\u5728\u8fd9\u4e2a\u76ee\u5f55\u3002
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.adv.settings.logfile.desc.. Formerly named logFile.description.. Formerly named logDirectory.description.
+install.logDirectory.description=JSPWiki \u4f7f\u7528 Jakarta Log4j \u8bb0\u5f55\u65e5\u5fd7\u3002\u8bf7\u544a\u8bc9 JSPWiki \u65e5\u5fd7\u6587\u4ef6\u7684\u4fdd\u5b58\u4f4d\u7f6e\u3002
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.adv.settings.workdir.desc.. Formerly named workDir.description.
+install.workDir.description=\u8fd9\u4e2a\u5730\u65b9\u4f1a\u4fdd\u5b58\u6240\u6709\u7f13\u5b58\u548c\u5176\u4ed6\u8fd0\u884c\u65f6\u751f\u6210\u7684\u6570\u636e\u3002
+#Copied from src/WebContent/WEB-INF/classes/CoreResources.properties.. Formerly named install.jsp.adv.settings.title.
+install.advanced=\u9ad8\u7ea7\u8bbe\u7f6e

Modified: incubator/jspwiki/trunk/src/WebContent/admin/Install.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/admin/Install.jsp?rev=812334&r1=812333&r2=812334&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/admin/Install.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/admin/Install.jsp Tue Sep  8 03:43:37 2009
@@ -44,10 +44,9 @@
       <div id="page">
         <div id="pagecontent">
         
-          <h1><fmt:message key="install.jsp.intro.title" /></h1>
-          <p><fmt:message key="install.jsp.intro.p1" /></p>
-          <p><fmt:message key="install.jsp.intro.p2" /></p>
-          <p><fmt:message key="install.jsp.intro.p3" /></p>
+          <h1><fmt:message key="install.title" /></h1>
+          <p><fmt:message key="install.intro.p1" /></p>
+          <p><fmt:message key="install.intro.p2" /></p>
           
           <!-- Any messages or errors? -->
           <div class="instructions"><s:messages /></div>
@@ -57,52 +56,65 @@
             <s:form beanclass="org.apache.wiki.action.InstallActionBean">
             
               <!-- Admin password, application name, base URL and page directory -->
-              <h3><fmt:message key="install.jsp.basics.title" /></h3>
+              <h3><fmt:message key="install.basics" /></h3>
               <div>
                 <s:label for="adminPassword" />
                 <s:text name="adminPassword" size="20" />
                 <s:errors field="adminPassword" />
-                <div class="description"><fmt:message key="adminPassword.description" /></div>
+                <div class="description"><fmt:message key="install.adminPassword.description" /></div>
               </div>
               
               <div>
                 <s:label for="properties.jspwiki.jspwiki_applicationName" />
                 <s:text name="properties.jspwiki.jspwiki_applicationName" size="20" />
                 <s:errors field="properties.jspwiki.jspwiki_applicationName" />
-                <div class="description"><fmt:message key="applicationName.description" /></div>
+                <div class="description"><fmt:message key="install.applicationName.description" /></div>
               </div>
               <div>
                 <s:label for="properties.jspwiki.jspwiki_baseURL" />
                 <s:text name="properties.jspwiki.jspwiki_baseURL" size="40" />
                 <s:errors field="properties.jspwiki.jspwiki_baseURL" />
-                <div class="description"><fmt:message key="baseURL.description" /></div>
+                <div class="description"><fmt:message key="install.baseURL.description" /></div>
               </div>
               <div>
-                <s:label for="properties.jspwiki.jspwiki_fileSystemProvider_pageDir" />
-                <s:text name="properties.jspwiki.jspwiki_fileSystemProvider_pageDir" size="50" />
-                <s:errors field="properties.jspwiki.jspwiki_fileSystemProvider_pageDir" />
-                <div class="description"><fmt:message key="pageDir.description" /></div>
+                <s:label for="properties.priha.priha_provider_defaultProvider_directory" />
+                <s:text name="properties.priha.priha_provider_defaultProvider_directory" size="50" />
+                <s:errors field="properties.priha.priha_provider_defaultProvider_directory" />
+                <div class="description"><fmt:message key="install.pageDir.description" /></div>
               </div>
               
-              <!-- Advanced settings: logging/work directories -->
-              <h3><fmt:message key="install.jsp.adv.settings.title" /></h3>
+              <!-- Advanced settings: security, logging/work directories -->
+              <h3><fmt:message key="install.advanced" /></h3>
               <div>
-                <s:label for="properties.log4j.log4j_appender_FileLog_File" />
-                <s:text name="properties.log4j.log4j_appender_FileLog_File" size="50" />
-                <s:errors field="properties.log4j.log4j_appender_FileLog_File" />
-                <div class="description"><fmt:message key="logFile.description" /></div>
+                <s:label for="logDirectory" />
+                <s:text name="logDirectory" size="50" />
+                <s:errors field="logDirectory" />
+                <div class="description"><fmt:message key="install.logDirectory.description" /></div>
               </div>
               <div>
                 <s:label for="properties.jspwiki.jspwiki_workDir" />
                 <s:text name="properties.jspwiki.jspwiki_workDir" size="40" />
                 <s:errors field="properties.jspwiki.jspwiki_workDir" />
-                <div class="description"><fmt:message key="workDir.description" /></div>
+                <div class="description"><fmt:message key="install.workDir.description" /></div>
+              </div>
+              <div>
+                <s:label for="properties.jspwiki.jspwiki_userdatabase" />
+                <s:select id="userdatabase" name="properties.jspwiki.jspwiki_userdatabase">
+                  <s:option value="org.apache.wiki.auth.user.XMLUserDatabase">XML (default)</s:option>
+                  <s:option value="org.apache.wiki.auth.user.LdapUserDatabase">LDAP</s:option>
+                </s:select>
+                <s:errors field="properties.jspwiki.jspwiki_userdatabase" />
+                <div class="description"><fmt:message key="install.userdatabase.description" /></div>
+              </div>
+              <div>
+                <s:button id="ldap.showConfig" name="ldap.showConfig"
+                  onclick="$('ldapDivConfig').style.display='block'; $('ldap.showConfig').style.display='none';" />
               </div>
             
-              <!-- LDAP -->
-              <h3><fmt:message key="install.ldap.title" /></h3>
-              <p><fmt:message key="install.ldap.description" /></p>
-              <div id="security.ldap">
+              <!-- LDAP config -->
+              <div id="ldapDivConfig" style="display:none;">
+                <h3><fmt:message key="install.ldap" /></h3>
+                <p><fmt:message key="install.ldap.description" /></p>
                 <div>
                   <s:label for="properties.jspwiki.ldap_config" />
                   <s:select id="ldap.config" name="properties.jspwiki.ldap_config">
@@ -136,16 +148,16 @@
                 <div class="description" id="ldapConnResults"></div>
                 <!-- LDAP authentication settings and test button -->
                 <div>
-                  <s:label for="properties.jspwiki.ldap_bindDN" />
-                  <s:text name="properties.jspwiki.ldap_bindDN" size="40" />
-                  <s:errors field="properties.jspwiki.ldap_bindDN" />
-                  <div class="description"><fmt:message key="ldap.bindDN.description" /></div>
+                  <s:label for="properties.jspwiki.ldap_bindUser" />
+                  <s:text name="properties.jspwiki.ldap_bindUser" size="40" />
+                  <s:errors field="properties.jspwiki.ldap_bindUser" />
+                  <div class="description"><fmt:message key="ldap.bindUser.description" /></div>
                 </div>
                 <div>
-                  <s:label for="bindDNpassword" />
-                  <s:text name="bindDNpassword" size="20" />
-                  <s:errors field="bindDNpassword" />
-                  <div class="description"><fmt:message key="ldap.bindDNpassword.description" /></div>
+                  <s:label for="bindPassword" />
+                  <s:text name="bindPassword" size="20" />
+                  <s:errors field="bindPassword" />
+                  <div class="description"><fmt:message key="ldap.bindPassword.description" /></div>
                 </div>
                 <s:button name="testLdapAuthentication" onclick="Stripes.executeEvent(form, this.name, 'ldapAuthResults');" />
                 <div class="description" id="ldapAuthResults"></div>
@@ -170,11 +182,7 @@
               </div>
               
               <!-- Save the configuration -->
-              <p>
-                <fmt:message key="install.configure.description">
-                  <fmt:param>${wikiActionBean.properties.jspwiki.path}</fmt:param>
-                </fmt:message>
-              <p>
+              <p><fmt:message key="install.configure.description" /><p>
               <s:submit name="save" />
 
             </s:form>

Added: incubator/jspwiki/trunk/src/WebContent/admin/InstallSuccess.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/admin/InstallSuccess.jsp?rev=812334&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/admin/InstallSuccess.jsp (added)
+++ incubator/jspwiki/trunk/src/WebContent/admin/InstallSuccess.jsp Tue Sep  8 03:43:37 2009
@@ -0,0 +1,43 @@
+<%-- 
+    JSPWiki - a JSP-based WikiWiki clone.
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
+--%>
+<%@ page import="org.apache.wiki.*"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s"%>
+<%@ page errorPage="/Error.jsp" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title><fmt:message key="install.title" /></title>
+    <link rel="stylesheet" media="screen, projection" type="text/css" href='<wiki:Link format="url" templatefile="jspwiki.css" />' />
+  </head>
+  <body class="view">
+    <div id="wikibody">
+      <div id="page">
+        <div id="pagecontent">
+          <h1><fmt:message key="install.success" /></h1>
+          <p><fmt:message key="install.success.description" /></p>
+          <s:link beanclass="org.apache.wiki.action.ViewActionBean"><fmt:message key="install.success.clickhere" /></s:link>
+        </div>
+      </div>
+    </div>
+  </body>
+</html>

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=812334&r1=812333&r2=812334&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Tue Sep  8 03:43:37 2009
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "152";
+    public static final String     BUILD         = "153";
 
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java?rev=812334&r1=812333&r2=812334&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java Tue Sep  8 03:43:37 2009
@@ -24,6 +24,7 @@
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URI;
+import java.net.URL;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.security.Principal;
@@ -36,6 +37,8 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang.time.StopWatch;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.PropertyConfigurator;
 import org.apache.wiki.action.WikiActionBean;
 import org.apache.wiki.action.WikiContextFactory;
 import org.apache.wiki.api.FilterException;
@@ -1556,7 +1559,19 @@
      */
     public void restart() throws WikiException
     {
+        // Shut down the wiki
         shutdown();
+        
+        // Restart logging
+        // FIXME: use introspection instead
+        LogManager.resetConfiguration();
+        ClassLoader cl = this.getClass().getClassLoader();
+        URL log4jprops = cl.getResource( "log4j.properties" );
+        if (log4jprops != null) {
+            PropertyConfigurator.configure(log4jprops);
+        }
+        
+        // Restart the wiki
         m_properties = PropertyReader.loadWebAppProps( m_servletContext );
         initialize( m_properties );
     }

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/InstallActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/InstallActionBean.java?rev=812334&r1=812333&r2=812334&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/InstallActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/InstallActionBean.java Tue Sep  8 03:43:37 2009
@@ -48,9 +48,11 @@
 import org.apache.wiki.auth.LdapConfig;
 import org.apache.wiki.auth.WikiSecurityException;
 import org.apache.wiki.auth.authorize.LdapAuthorizer;
+import org.apache.wiki.auth.authorize.WebContainerAuthorizer;
 import org.apache.wiki.auth.user.LdapUserDatabase;
 import org.apache.wiki.auth.user.UserDatabase;
 import org.apache.wiki.auth.user.UserProfile;
+import org.apache.wiki.auth.user.XMLUserDatabase;
 import org.apache.wiki.ui.stripes.WikiRequestContext;
 import org.apache.wiki.util.CommentedProperties;
 import org.apache.wiki.util.CryptoUtil;
@@ -286,38 +288,6 @@
         }
 
         /**
-         * Simply sanitizes any path which contains backslashes (sometimes
-         * Windows users may have them) by expanding them to double-backslashes
-         * 
-         * @param key the key of the setting to sanitize
-         */
-        private void sanitizePath( String key )
-        {
-            String s = m_settings.get( key );
-            s = TextUtil.replaceString( s, "\\", "\\\\" );
-            s = s.trim();
-            m_settings.put( key, s );
-        }
-
-        /**
-         * Simply sanitizes any URL which contains backslashes (sometimes
-         * Windows users may have them)
-         * 
-         * @param key the key of the setting to sanitize
-         */
-        private void sanitizeURL( String key )
-        {
-            String s = m_settings.get( key );
-            s = TextUtil.replaceString( s, "\\", "/" );
-            s = s.trim();
-            if( !s.endsWith( "/" ) )
-            {
-                s = s + "/";
-            }
-            m_settings.put( key, s );
-        }
-
-        /**
          * Converts a key from the format Stripes can use into normal properties
          * form.
          * 
@@ -342,7 +312,11 @@
 
     private static final String CONFIG_WORK_DIR = "jspwiki_workDir";
 
-    private static final String CONFIG_PAGE_DIR = "jspwiki_fileSystemProvider_pageDir";
+    private static final String CONFIG_PAGE_DIR = "priha_provider_defaultProvider_directory";
+
+    private static final String CONFIG_USERDATABASE = "jspwiki_userdatabase";
+
+    private static final String CONFIG_AUTHORIZER = "jspwiki_authorizer";
 
     private static final String CONFIG_LDAP_SSL = "ldap_ssl";
 
@@ -360,7 +334,7 @@
         }
     }
 
-    private String m_bindDNpassword = null;
+    private String m_bindPassword = null;
 
     private String m_adminPassword = null;
 
@@ -368,7 +342,7 @@
 
     private File m_keychainPath = null;
 
-    private String m_keychainPassword = null;
+    private String m_logDirectory = null;
 
     /**
      * PropertiesMap object for configuring {@code jspwiki.properties}
@@ -404,13 +378,23 @@
     }
 
     /**
-     * Returns the LDAP bind-DN password.
+     * Returns the LDAP binding password.
      * 
      * @return the password
      */
-    public String getBindDNpassword()
+    public String getBindPassword()
     {
-        return m_bindDNpassword;
+        return m_bindPassword;
+    }
+
+    /**
+     * Returns the directory where log files are stored.
+     * 
+     * @return the directory
+     */
+    public String getLogDirectory()
+    {
+        return m_logDirectory;
     }
 
     public Map<String, PropertiesMap<String, String>> getProperties()
@@ -471,17 +455,40 @@
         log4j.load();
         m_properties.put( "log4j", log4j );
 
-        // Create a new keychain with random password
-        m_keychainPassword = TextUtil.generateRandomPassword() + TextUtil.generateRandomPassword();
-        jspwiki.put( AuthenticationManager.PROP_KEYCHAIN_PATH, "keychain" );
-        m_keychainPath = new File( path, "/WEB-INF/keychain" );
-        m_keychain = new Keychain();
-        m_keychain.load( null, m_keychainPassword.toCharArray() );
+        // Load priha.properties
+        PropertiesMap<String, String> priha;
+        priha = new PropertiesMap<String, String>( new File( path, "/WEB-INF/classes/priha.properties" ) );
+        priha.load();
+        m_properties.put( "priha", priha );
+
+        // Get the log directory
+        m_logDirectory = log4j.get( CONFIG_LOG_FILE );
+        if( m_logDirectory == null )
+        {
+            m_logDirectory = System.getProperty( "java.io.tmpdir" );
+        }
+        File logs = new File( m_logDirectory );
+        if( logs.exists() && !logs.isDirectory() )
+        {
+            logs = logs.getParentFile();
+            if( logs == null )
+            {
+                logs = new File( System.getProperty( "java.io.tmpdir" ) );
+            }
+        }
+        m_logDirectory = logs.getAbsolutePath();
+
+        // Load the Keychain (or create new one with random password)
+        initKeychain( path, jspwiki );
 
         // Set some sensible defaults
+        if( !jspwiki.containsKey( CONFIG_USERDATABASE ) )
+        {
+            jspwiki.put( CONFIG_USERDATABASE, XMLUserDatabase.class.getName() );
+        }
         if( !jspwiki.containsKey( CONFIG_WORK_DIR ) )
         {
-            jspwiki.put( CONFIG_WORK_DIR, "/tmp/" );
+            jspwiki.put( CONFIG_WORK_DIR, System.getProperty( "java.io.tmpdir" ) );
         }
         if( !jspwiki.containsKey( PropertiesMap.escapedKey( WikiEngine.PROP_ENCODING ) ) )
         {
@@ -511,38 +518,55 @@
     @WikiRequestContext( "install" )
     public Resolution install()
     {
-        // Has admin password been set?
-        if( !getAdminExists() )
-        {
-            List<Message> messages = getContext().getMessages();
-            messages.add( new LocalizableMessage( "install.jsp.install.msg.admin.notexists" ) );
-        }
-
         return new ForwardResolution( "/admin/Install.jsp" );
     }
 
+    /**
+     * Saves the properties files with updated settings, and restarts the wiki.
+     * 
+     * @return if successful, always returns a {@link ForwardResolution} to
+     *         {@code /admin/InstallSuccess.jsp}.
+     * @throws Exception
+     */
     @HandlesEvent( "save" )
     public Resolution save() throws Exception
     {
         // Sanitize any paths
         PropertiesMap<String, String> jspwiki = m_properties.get( "jspwiki" );
-        jspwiki.sanitizeURL( CONFIG_BASE_URL );
-        jspwiki.sanitizePath( CONFIG_PAGE_DIR );
-        jspwiki.sanitizePath( CONFIG_WORK_DIR );
+        jspwiki.put( CONFIG_BASE_URL, sanitizeURL( jspwiki.get( CONFIG_BASE_URL ) ) );
+        jspwiki.put( CONFIG_WORK_DIR, sanitizeDir( jspwiki.get( CONFIG_WORK_DIR ) ) );
         PropertiesMap<String, String> log4j = m_properties.get( "log4j" );
-        log4j.sanitizePath( CONFIG_LOG_FILE );
+        log4j.put( CONFIG_LOG_FILE, sanitizeDir( m_logDirectory ) + "jspwiki.log" );
+        PropertiesMap<String, String> priha = m_properties.get( "priha" );
+        priha.put( CONFIG_PAGE_DIR, sanitizeDir( priha.get( CONFIG_PAGE_DIR ) ) );
+
+        // Set the correct userdatabase and authorizer
+        String userdatabase = jspwiki.get( CONFIG_USERDATABASE );
+        if( LdapUserDatabase.class.getName().equals( userdatabase ) )
+        {
+            jspwiki.put( CONFIG_AUTHORIZER, LdapAuthorizer.class.getName() );
+        }
+        else
+        {
+            jspwiki.put( CONFIG_AUTHORIZER, WebContainerAuthorizer.class.getName() );
+        }
 
         // Hash the admin password
         String passwordHash = CryptoUtil.getSaltedPassword( m_adminPassword.getBytes() );
         jspwiki.put( CONFIG_ADMIN_PASSWORD_HASH, passwordHash );
 
         // Save the keychain
-        m_keychain.store( new FileOutputStream( m_keychainPath ), m_keychainPassword.toCharArray() );
-        jspwiki.put( AuthenticationManager.PROP_KEYCHAIN_PASSWORD, m_keychainPassword );
+        String password = jspwiki.get( AuthenticationManager.PROP_KEYCHAIN_PASSWORD );
+        if( password == null )
+        {
+            throw new WikiSecurityException( "Keychain password missing; this should not happen." );
+        }
+        m_keychain.store( new FileOutputStream( m_keychainPath ), password.toCharArray() );
 
         // Save each properties file
         jspwiki.store();
         log4j.store();
+        priha.store();
 
         // Restart the WikiEngine
         WikiEngine engine = getContext().getEngine();
@@ -556,52 +580,63 @@
      * 
      * @param password the admin password
      */
-    @Validate( required = true, minlength = 16 )
+    @Validate( required = true, on = "save", minlength = 16 )
     public void setAdminPassword( String password )
     {
         m_adminPassword = password;
     }
 
     /**
-     * Sets the LDAP bind-DN password. Optional when LDAP is selected for
+     * Sets the LDAP binding password. Optional when LDAP is selected for
      * authentication and user/role storage.
      * 
      * @param password
      */
     @Validate( required = false )
-    public void setBindDNpassword( String password ) throws KeyStoreException
+    public void setBindPassword( String password ) throws KeyStoreException
     {
-        m_bindDNpassword = password;
+        m_bindPassword = password;
         if( password != null )
         {
-            KeyStore.Entry keypass = new Keychain.Password( m_bindDNpassword );
-            m_keychain.setEntry( LdapConfig.KEYCHAIN_BIND_DN_ENTRY, keypass );
+            KeyStore.Entry keypass = new Keychain.Password( m_bindPassword );
+            m_keychain.setEntry( LdapConfig.KEYCHAIN_LDAP_BIND_PASSWORD, keypass );
         }
     }
 
     /**
+     * Sets the directory where log files are stored.
+     * 
+     * @param dir the log directory
+     */
+    @Validate( required = true, on = "save" )
+    public void setLogDirectory( String dir )
+    {
+        m_logDirectory = dir;
+    }
+
+    /**
      * @param properties
      */
     @ValidateNestedProperties( {
-                                @Validate( field = "jspwiki.jspwiki_applicationName", required = true, on = "save", label = "install.installer.default.appname" ),
-                                @Validate( field = "jspwiki.jspwiki_baseURL", required = true, on = "save", label = "install.installer.validate.baseurl" ),
-                                @Validate( field = "jspwiki.jspwiki_fileSystemProvider_pageDir", required = true, on = "save", label = "install.installer.default.pagedir" ),
-                                @Validate( field = "jspwiki.jspwiki_workDir", required = true, on = "save", label = "install.installer.validate.workdir" ),
-                                @Validate( field = "log4j.log4j_appender_FileLog_File", required = true, on = "save", label = "install.installer.validate.logdir" ),
+                                @Validate( field = "jspwiki.jspwiki_applicationName", required = true, on = "save" ),
+                                @Validate( field = "jspwiki.jspwiki_baseURL", required = true, on = "save" ),
+                                @Validate( field = "priha.priha_provider_defaultProvider_directory", required = true, on = "save" ),
+                                @Validate( field = "jspwiki.jspwiki_workDir", required = true, on = "save" ),
+                                @Validate( field = "jspwiki.jspwiki_userdatabase", required = true, on = "save" ),
                                 @Validate( field = "jspwiki.ldap_connectionURL", required = true, on = { "testLdapConnection",
                                                                                                         "testLdapAuthentication",
                                                                                                         "testLdapUsers",
-                                                                                                        "testLdapRoles" }, label = "properties.jspwiki.ldap_connectionURL" ),
-                                @Validate( field = "jspwiki.ldap_bindDN", required = true, on = "testLdapAuthentication", label = "properties.jspwiki.ldap_bindDN" ),
-                                @Validate( field = "jspwiki.ldap_userBase", required = true, on = "testLdapUsers", label = "properties.jspwiki.ldap_userBase" ),
-                                @Validate( field = "jspwiki.ldap_roleBase", required = true, on = "testLdapRoles", label = "properties.jspwiki.ldap_roleBase" ) } )
+                                                                                                        "testLdapRoles" } ),
+                                @Validate( field = "jspwiki.ldap_bindUser", required = true, on = "testLdapAuthentication" ),
+                                @Validate( field = "jspwiki.ldap_userBase", required = true, on = "testLdapUsers" ),
+                                @Validate( field = "jspwiki.ldap_roleBase", required = true, on = "testLdapRoles" ) } )
     public void setProperties( Map<String, PropertiesMap<String, String>> properties )
     {
         m_properties = properties;
     }
 
     /**
-     * AJAX event method that tests LDAP authentication based on the bind-DN
+     * AJAX event method that tests LDAP authentication based on the bind-user
      * settings, returning any results as an array of JavaScript strings.
      * 
      * @return the results
@@ -610,7 +645,7 @@
     @HandlesEvent( "testLdapAuthentication" )
     public Resolution testLdapAuthentication() throws WikiSecurityException
     {
-        // Call the main connection method (the bind-DN property is
+        // Call the main connection method (the bindUser property is
         // required for this method, though, so we are guaranteed to
         // do this with a username/password
         return testLdapConnection();
@@ -652,22 +687,13 @@
      * @throws WikiSecurityException
      */
     @HandlesEvent( "testLdapRoles" )
-    public Resolution testLdapRoleLoolup() throws WikiSecurityException
+    public Resolution testLdapRoleLookup() throws WikiSecurityException
     {
         WikiEngine engine = getContext().getEngine();
         PropertiesMap<String, String> jspwiki = m_properties.get( "jspwiki" );
         List<String> messages = new ArrayList<String>();
         try
         {
-            // Make sure keychain is unlocked
-            Keychain keychain = engine.getAuthenticationManager().getKeychain();
-            if( !keychain.isLoaded() )
-            {
-                keychain.load( null, m_keychainPassword.toCharArray() );
-                Keychain.Password password = new Keychain.Password( m_bindDNpassword );
-                keychain.setEntry( LdapConfig.KEYCHAIN_BIND_DN_ENTRY, password );
-            }
-
             // Initialize a new user authorizer
             Authorizer authorizer = new LdapAuthorizer();
             authorizer.initialize( engine, jspwiki.m_props );
@@ -710,15 +736,6 @@
         List<String> messages = new ArrayList<String>();
         try
         {
-            // Make sure keychain is unlocked
-            Keychain keychain = engine.getAuthenticationManager().getKeychain();
-            if( !keychain.isLoaded() )
-            {
-                keychain.load( null, m_keychainPassword.toCharArray() );
-                Keychain.Password password = new Keychain.Password( m_bindDNpassword );
-                keychain.setEntry( LdapConfig.KEYCHAIN_BIND_DN_ENTRY, password );
-            }
-
             // Initialize a new user database
             UserDatabase db = new LdapUserDatabase();
             db.initialize( engine, jspwiki.m_props );
@@ -751,8 +768,53 @@
     }
 
     /**
-     * Initializes an LDAP connection, using the bind-DN username and password
-     * if supplied.
+     * Initializes the Keychain by attempting to unlock it first based on
+     * current {@code jspwiki.properties} settings. If this fails, a new
+     * Keychain is created at {@code /WEB-INF/keychain}. It is not persisted to
+     * disk until {@link #save()} is called.
+     * 
+     * @param path the webapp root path
+     * @param jspwiki the PropertiesMap containing the current {@code
+     *            jspwiki.properties}.
+     * @throws IOException if the new Keychain cannot be loaded (this should
+     *             never be thrown under normal conditions)
+     * @throws NoSuchAlgorithmException if the new Keychain cannot be loaded
+     *             (this should never be thrown under normal conditions)
+     */
+    private void initKeychain( String path, PropertiesMap<String, String> jspwiki ) throws IOException, NoSuchAlgorithmException
+    {
+        AuthenticationManager authMgr = getContext().getEngine().getAuthenticationManager();
+        m_keychain = authMgr.getKeychain();
+        boolean keychainUnlocked = false;
+        String password = null;
+        if( !m_keychain.isLoaded() )
+        {
+            password = jspwiki.get( AuthenticationManager.PROP_KEYCHAIN_PASSWORD );
+            if( password != null )
+            {
+                try
+                {
+                    authMgr.unlockKeychain( password );
+                    keychainUnlocked = true;
+                }
+                catch( WikiSecurityException e )
+                {
+                }
+            }
+        }
+        if( !keychainUnlocked )
+        {
+            password = TextUtil.generateRandomPassword() + TextUtil.generateRandomPassword();
+            m_keychain.load( null, password.toCharArray() );
+        }
+        jspwiki.put( AuthenticationManager.PROP_KEYCHAIN_PATH, "keychain" );
+        jspwiki.put( AuthenticationManager.PROP_KEYCHAIN_PASSWORD, password );
+        m_keychainPath = new File( path, "/WEB-INF/keychain" );
+    }
+
+    /**
+     * Initializes an LDAP connection, using the bind-user and password if
+     * supplied.
      * 
      * @return the initialized connection
      * @throws NamingException if a connection cannot be made to the LDAP server
@@ -763,18 +825,55 @@
         PropertiesMap<String, String> jspwiki = m_properties.get( "jspwiki" );
         LdapConfig config = LdapConfig.getInstance( m_keychain, jspwiki.m_props, new String[0] );
         Hashtable<String, String> env;
-        if( !jspwiki.containsKey( "ldap_bindDN" ) )
+        if( !jspwiki.containsKey( "ldap_bindUser" ) )
         {
             env = config.newJndiEnvironment();
             messages.add( "Binding as anonymous user." );
         }
         else
         {
-            String username = jspwiki.get( "ldap_bindDN" );
-            env = config.newJndiEnvironment( username, m_bindDNpassword );
+            String username = jspwiki.get( "ldap_bindUser" );
+            env = config.newJndiEnvironment( username, m_bindPassword );
             Object principal = env.get( Context.SECURITY_PRINCIPAL );
             messages.add( "Binding with principal: " + principal.toString() );
         }
         return new InitialLdapContext( env, null );
     }
+
+    /**
+     * Simply sanitizes any path which contains backslashes (sometimes Windows
+     * users may have them) by expanding them to double-backslashes
+     * 
+     * @param key the key of the setting to sanitize
+     */
+    private String sanitizeDir( String dir )
+    {
+        String s = dir;
+        s = TextUtil.replaceString( s, "\\", "\\\\" );
+        s = s.trim();
+        if( !s.endsWith( "\\" ) || !s.endsWith( "/" ) )
+        {
+            s = s + "/";
+        }
+        return s;
+    }
+
+    /**
+     * Simply sanitizes any URL which contains backslashes (sometimes Windows
+     * users may have them)
+     * 
+     * @param key the key of the setting to sanitize
+     */
+    private String sanitizeURL( String url )
+    {
+        String s = url;
+        s = TextUtil.replaceString( s, "\\", "/" );
+        s = s.trim();
+        if( !s.endsWith( "/" ) )
+        {
+            s = s + "/";
+        }
+        return s;
+    }
+
 }

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/LdapConfig.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/LdapConfig.java?rev=812334&r1=812333&r2=812334&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/LdapConfig.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/LdapConfig.java Tue Sep  8 03:43:37 2009
@@ -36,8 +36,8 @@
  * this class prefixed {@code PROPERTY_}, such as
  * {@link #PROPERTY_AUTHENTICATION}.</li>
  * <li>a {@link Keychain} object that optionally stores the password used for
- * binding to the LDAP server, if a "bind DN" property was set by
- * {@link #PROPERTY_BIND_DN}.</li>
+ * binding to the LDAP server, if a "binding user" property was set by
+ * {@link #PROPERTY_BIND_USER}.</li>
  * <li>an array of String objects that supply the property names that must be
  * configured in order for the LdapConfig initialization to succeed. The
  * required properties are set by the calling program to account for the fact
@@ -58,39 +58,37 @@
  * how the login id should be formatted into a credential the LDAP server will
  * understand. The exact credential pattern varies by LDAP server. OpenLDAP
  * expects login IDs that match a distinguished name. Active Directory, on the
- * other hand, requires just the "short" login ID that is not in DN format. The
- * user ID supplied during the login will be substituted into the
- * {@code \{0\}} token in this pattern, and the user base will be 
- * substituted into the {@code \{1\}} token. Valid examples of login ID patterns
- * include {@code uid=\{0\},\{1\}} (for OpenLDAP) and
- * {@code \{0\}} (for Active Directory).</li>
+ * other hand, requires just the "short" username that is not in DN format. The
+ * user ID supplied during the login will be substituted into the {@code \ 0\}
+ * token in this pattern, and the user base will be substituted into the {@code
+ * \ 1\} token. Valid examples of login ID patterns include {@code uid=\ 0\}
+ * ,\{1\}} (for OpenLDAP) and {@code \ 0\} (for Active Directory).</li>
  * <li>{@link #PROPERTY_USER_BASE} - the distinguished name of the base location
  * where user objects are located. This is generally an organizational unit (OU)
- * DN, such as {@code ou=people,dc=jspwiki,dc=org}. The user base and all
- * of its subtrees will be searched. For directories that contain multiple OUs
- * where users are located, use a higher-level base location (e.g.,
- * {@code dc=jspwiki,dc=org}).</li>
+ * DN, such as {@code ou=people,dc=jspwiki,dc=org}. The user base and all of its
+ * subtrees will be searched. For directories that contain multiple OUs where
+ * users are located, use a higher-level base location (e.g., {@code
+ * dc=jspwiki,dc=org}).</li>
  * <li>{@link #PROPERTY_USER_FILTER} - an RFC 2254 search filter string used for
  * locating the actual user object within the user base. The user ID supplied
- * during the login will be substituted into the {@code \{0\}} token in this
+ * during the login will be substituted into the {@code \ 0\} token in this
  * filter, if it contains one. Only the first match will be selected, so it is
  * important that this filter selects unique objects. For example, if the user
- * filter is {@code (&(objectClass=inetOrgPerson)(uid=\{0\}))} and the user
- * name supplied during login is {@code fflintstone}, the the first object
- * within {@link #PROPERTY_USER_BASE} that matches the filter
- * {@code (&(objectClass=inetOrgPerson)(uid=fflintstone))} will be
- * selected. A suitable value for this property that works with Active Directory
- * 2000 and later is {@code (&(objectClass=person)(sAMAccountName=\{0\}))}.</li>
+ * filter is {@code (&(objectClass=inetOrgPerson)(uid=\ 0\}))} and the user name
+ * supplied during login is {@code fflintstone}, the the first object within
+ * {@link #PROPERTY_USER_BASE} that matches the filter {@code
+ * (&(objectClass=inetOrgPerson)(uid=fflintstone))} will be selected. A suitable
+ * value for this property that works with Active Directory 2000 and later is
+ * {@code (&(objectClass=person)(sAMAccountName=\ 0\}))}.</li>
  * <li>{@link #PROPERTY_SSL} - Optional parameter that specifies whether to use
- * SSL when connecting to the LDAP server. Values like {@code true} or
- * {@code on} indicate that SSL should be used. If this parameter is not
- * supplied, SSL will not be used.</li>
+ * SSL when connecting to the LDAP server. Values like {@code true} or {@code
+ * on} indicate that SSL should be used. If this parameter is not supplied, SSL
+ * will not be used.</li>
  * <li>{@link #PROPERTY_AUTHENTICATION} - Optional parameter that specifies the
- * type of authentication method to be used. Valid values include
- * {@code simple} for plaintext username/password, and
- * {@code DIGEST-MD5} for digested passwords. Note that if SSL is not used,
- * for safety reasons this method will default to {@code DIGEST-MD5} to
- * prevent password interception.</li>
+ * type of authentication method to be used. Valid values include {@code simple}
+ * for plaintext username/password, and {@code DIGEST-MD5} for digested
+ * passwords. Note that if SSL is not used, for safety reasons this method will
+ * default to {@code DIGEST-MD5} to prevent password interception.</li>
  * </ul>
  * <p>
  * LdapConfig objects are immutable and therefore thread-safe.
@@ -100,9 +98,9 @@
 {
     /**
      * The name of the {@link Keychain} entry that supplies the password used by
-     * the "bind DN", if one was specified by {@link #PROPERTY_BIND_DN}.
+     * the "binding user", if one was specified by {@link #PROPERTY_BIND_USER}.
      */
-    public static final String KEYCHAIN_BIND_DN_ENTRY = "ldap.bindDNPassword";
+    public static final String KEYCHAIN_LDAP_BIND_PASSWORD = "ldap.bindPassword";
 
     /**
      * Property that specifies the JNDI authentication type. Valid values are
@@ -113,10 +111,13 @@
     public static final String PROPERTY_AUTHENTICATION = "ldap.authentication";
 
     /**
-     * Property that supplies the DN used to bind to the directory when looking
-     * up users and roles.
+     * Property that supplies the username used to bind to the directory when
+     * looking up users and roles. This username is <em>not</em> the
+     * fully-qualified name the LDAP directory expects; it is the short
+     * "login name" (for example: {@code janne}. This name is transformed into
+     * the fully-qualified name via {@link #PROPERTY_LOGIN_ID_PATTERN}.
      */
-    public static final String PROPERTY_BIND_DN = "ldap.bindDN";
+    public static final String PROPERTY_BIND_USER = "ldap.bindUser";
 
     /**
      * Property that indicates what LDAP server configuration to use. Valid
@@ -135,16 +136,16 @@
     /**
      * Property that supplies the filter for finding users within the role base
      * that possess a given role, e.g. {@code
-     * (&(objectClass=groupOfUniqueNames)(cn=\{0\})(uniqueMember=\{1\}))} .
+     * (&(objectClass=groupOfUniqueNames)(cn=\ 0\})(uniqueMember=\{1\}))} .
      */
     public static final String PROPERTY_IS_IN_ROLE_FILTER = "ldap.isInRoleFilter";
 
     /**
-     * Property that specifies the pattern for the username used to log in to
-     * the LDAP server. This pattern maps the username supplied at login time by
-     * the user to a username format the LDAP server can recognized. The Usually
-     * this is a pattern that produces a full DN, for example {@code uid=\{0\}
-     * ,\{1\}}. However, sometimes (as with Active
+     * Property that specifies the pattern for the fully-qualified username used
+     * to log in to the LDAP server. This pattern maps the username supplied at
+     * login time by the user to a username format the LDAP server can
+     * recognized. Usually this is a pattern that produces a full DN, for
+     * example {@code uid=\ 0\} ,\{1\}}. However, sometimes (as with Active
      * Directory 2003 and later) only the userid is used, in which case the
      * principal will simply be \{0\} . The default value if not supplied is
      * \{0\} .
@@ -188,7 +189,7 @@
      */
     public static final String PROPERTY_USER_FILTER = "ldap.userFilter";
 
-    private static final Map<Default,LdapConfig> CONFIGS = new HashMap<Default,LdapConfig>();
+    private static final Map<Default, LdapConfig> CONFIGS = new HashMap<Default, LdapConfig>();
 
     private static final SearchControls SEARCH_CONTROLS;
 
@@ -204,7 +205,7 @@
         options.put( PROPERTY_USER_LOGIN_NAME_ATTRIBUTE, "sAMAccountName" );
         options.put( PROPERTY_USER_OBJECT_CLASS, "person" );
         options.put( PROPERTY_USER_FILTER, "(&(objectClass=person)(sAMAccountName={0}))" );
-        LdapConfig config = new LdapConfig( null,options,new String[0] );
+        LdapConfig config = new LdapConfig( null, options, new String[0] );
         CONFIGS.put( Default.ACTIVE_DIRECTORY, config );
 
         // OpenLDAP defaults
@@ -214,14 +215,13 @@
         options.put( PROPERTY_USER_LOGIN_NAME_ATTRIBUTE, "uid" );
         options.put( PROPERTY_USER_OBJECT_CLASS, "inetOrgPerson" );
         options.put( PROPERTY_USER_FILTER, "(&(objectClass=inetOrgPerson)(uid={0}))" );
-        config = new LdapConfig( null,options,new String[0] );
+        config = new LdapConfig( null, options, new String[0] );
         CONFIGS.put( Default.OPEN_LDAP, config );
     }
 
     /**
-     * Escapes a string so that it conforms to an RFC2254-compliant
-     * LDAP search filter. See
-     * http://blogs.sun.com/shankar/entry/what_is_ldap_injection
+     * Escapes a string so that it conforms to an RFC2254-compliant LDAP search
+     * filter. See http://blogs.sun.com/shankar/entry/what_is_ldap_injection
      * 
      * @param dn the DN to escape
      * @return the escaped DN
@@ -310,13 +310,14 @@
     /**
      * Typesafe enumeration indicating which configuration to use.
      */
-    public enum Default { 
+    public enum Default
+    {
         /** Active Directory 2000 and higher. */
-        ACTIVE_DIRECTORY, 
+        ACTIVE_DIRECTORY,
         /** OpenLDAP. */
         OPEN_LDAP;
     }
-    
+
     /**
      * For a supplied LDAP user object, returns the user's equivalent JSPWiki
      * "full name." The full name will be equal to the user's first name (
@@ -355,8 +356,8 @@
     /**
      * Factory method that creates a new LdapConfig object.
      * 
-     * @param keychain the Keychain that stores the password for the "bind DN",
-     *            if one is used for this config
+     * @param keychain the Keychain that stores the password for the
+     *            "binding user", if one is used for this config
      * @param props the properties object containing the initialization
      *            parameters for the config
      * @param requiredProperties the properties that are must be set in order
@@ -389,16 +390,16 @@
      * The configured filter for finding whether a user belongs to a particular
      * group.
      * 
-     * @link #PROPERTY_IS_IN_ROLE_FILTER
+     * @see #PROPERTY_IS_IN_ROLE_FILTER
      */
     public final String isInRoleFilter;
 
     /**
      * The distinguished name used for connecting to the LDAP server.
      * 
-     * @link #bindDN
+     * @see #PROPERTY_BIND_USER
      */
-    public final String bindDN;
+    public final String bindUser;
 
     /**
      * The configured value of the SSL property.
@@ -459,8 +460,8 @@
     /**
      * Private constructor that creates an immutable LdapConfig object.
      * 
-     * @param keychain the Keychain that stores the password for the "bind DN",
-     *            if one is used for this config
+     * @param keychain the Keychain that stores the password for the
+     *            "binding user", if one is used for this config
      * @param props the properties object containing the initialization
      *            parameters for the config
      * @param requiredProperties the properties that are must be set in order
@@ -475,14 +476,14 @@
         String defaultUserLoginNameAttribute = "uid";
         String defaultUserObjectClass = "inetOrgPerson";
         String defaultUserFilter = null;
-        
+
         // Did user select a config shortcut for AD or OpenLdap?
         String config = (String) props.get( PROPERTY_CONFIG );
-        if ( config != null )
+        if( config != null )
         {
             try
             {
-                Default configEnum = Default.valueOf( config ); 
+                Default configEnum = Default.valueOf( config );
                 LdapConfig defaults = CONFIGS.get( configEnum );
                 defaultIsInRoleFilter = defaults.isInRoleFilter;
                 defaultLoginIdPattern = defaults.loginIdPattern;
@@ -492,17 +493,16 @@
             }
             catch( IllegalArgumentException e )
             {
-                throw new IllegalArgumentException( "'" + config + 
-                  "' is not a valid config value for " + PROPERTY_CONFIG + ".", e );
+                throw new IllegalArgumentException( "'" + config + "' is not a valid config value for " + PROPERTY_CONFIG + ".", e );
             }
         }
 
         // Basic connection properties
         connectionUrl = getProperty( props, PROPERTY_CONNECTION_URL, null );
 
-        // Binding DN properties
+        // Binding user properties
         m_keychain = keychain;
-        bindDN = getProperty( props, PROPERTY_BIND_DN, null );
+        bindUser = getProperty( props, PROPERTY_BIND_USER, null );
 
         // User lookup properties
         userBase = getProperty( props, PROPERTY_USER_BASE, null );
@@ -572,24 +572,25 @@
     /**
      * Builds a JNDI environment hashtable for performing an operation on the
      * LDAP server. The hashtable is built using the properties used to
-     * initialize the LdapConfig object. If property {@link #PROPERTY_BIND_DN}
-     * was set, that DN will be used as the authentication principal. The
-     * password will be obtained from the Keychain.
+     * initialize the LdapConfig object. If property {@link #PROPERTY_BIND_USER}
+     * was set, that used will be used to build a fully-qualified username using
+     * {@link #PROPERTY_LOGIN_ID_PATTERN}. The password will be obtained from
+     * the Keychain.
      * 
      * @return the constructed hash table
      * @throws NamingException
      */
     public Hashtable<String, String> newJndiEnvironment() throws NamingException
     {
-        // If we need a Bind DN and Keychain is loaded, get the bind DN and
-        // password
-        String username = bindDN;
+        // If we need a binding user and Keychain is loaded, get
+        // username/password
+        String username = bindUser;
         String password = null;
         if( username != null )
         {
             try
             {
-                password = getBindDNPassword();
+                password = getBindPassword();
             }
             catch( KeyStoreException e )
             {
@@ -606,8 +607,9 @@
      * initialize the LdapConfig object. The username and password parameters
      * supply the LDAP credentials used with the connection.
      * 
-     * @param username the user's distinguished name (DN), used for
-     *            authentication
+     * @param username the username for authentication, which will be
+     *            substituted into {@link #PROPERTY_LOGIN_ID_PATTERN} to produce
+     *            a fully-qualified username to log into the LDAP server
      * @param password the password
      * @return the constructed hash table
      */
@@ -617,7 +619,7 @@
         env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
 
         // Create fully qualified username
-        if ( loginIdPattern != null && username != null )
+        if( loginIdPattern != null && username != null )
         {
             username = loginIdPattern.replace( "{0}", username );
         }
@@ -630,7 +632,7 @@
         {
             env.put( Context.SECURITY_PRINCIPAL, username );
         }
-        if ( password != null )
+        if( password != null )
         {
             env.put( Context.SECURITY_CREDENTIALS, password );
         }
@@ -648,19 +650,19 @@
     }
 
     /**
-     * Retrieves the password to be used with a bind DN.
+     * Retrieves the password to be used with the binding username.
      * 
      * @return the plaintext password
      * @throws KeyStoreException if the Keychain was not supplied during
      *             initialization, or if the lookup fails for any reason
      */
-    private String getBindDNPassword() throws KeyStoreException
+    private String getBindPassword() throws KeyStoreException
     {
         if( m_keychain == null )
         {
             throw new KeyStoreException( "LdapConfig was initialized without a keychain!" );
         }
-        KeyStore.Entry password = m_keychain.getEntry( LdapConfig.KEYCHAIN_BIND_DN_ENTRY );
+        KeyStore.Entry password = m_keychain.getEntry( LdapConfig.KEYCHAIN_LDAP_BIND_PASSWORD );
         if( password != null && password instanceof Keychain.Password )
         {
             return ((Keychain.Password) password).getPassword();
@@ -685,9 +687,9 @@
             m_configured.add( shortProperty );
             return props.get( property ).toString().trim();
         }
-        
+
         // Return the default
-        if ( defaultValue != null )
+        if( defaultValue != null )
         {
             m_configured.add( shortProperty );
         }

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/LdapAuthorizer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/LdapAuthorizer.java?rev=812334&r1=812333&r2=812334&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/LdapAuthorizer.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/LdapAuthorizer.java Tue Sep  8 03:43:37 2009
@@ -23,19 +23,20 @@
 /**
  * <p>
  * Authorizer whose Roles are supplied by LDAP groups. This Authorizer is often
- * used in conjunction with {@link LdapUserDatabase} for authentication. This can
- * be done either as part of the web container authentication configuration or
- * (more likely) as part of JSPWiki's own native authentication configuration.
+ * used in conjunction with {@link LdapUserDatabase} for authentication. This
+ * can be done either as part of the web container authentication configuration
+ * or (more likely) as part of JSPWiki's own native authentication
+ * configuration.
  * </p>
  * <p>
  * When {@link #initialize(WikiEngine, Properties)} executes, a new instance of
  * {@link org.apache.wiki.auth.LdapConfig} is created and configured based on
- * the settings in <code>jspwiki.properties</code>. The properties that are
- * required in order for LdapAuthorizer to function correctly are
+ * the settings in {@code jspwiki.properties}. The properties that are required
+ * in order for LdapAuthorizer to function correctly are
  * {@link LdapConfig#PROPERTY_CONNECTION_URL},
  * {@link LdapConfig#PROPERTY_ROLE_BASE} and
  * {@link LdapConfig#PROPERTY_IS_IN_ROLE_FILTER}. Additional properties that can
- * be set include {@link LdapConfig#PROPERTY_BIND_DN},
+ * be set include {@link LdapConfig#PROPERTY_BIND_USER},
  * {@link LdapConfig#PROPERTY_AUTHENTICATION} and
  * {@link LdapConfig#PROPERTY_SSL}. See the documentation for that LdapConfig
  * for more details.
@@ -176,35 +177,33 @@
     /**
      * {@inheritDoc}
      * <p>
-     * This implementation returns <code>true</code> when the user login
-     * Principal contained in the WikiSession's Subject belongs to an LDAP group
-     * found in the role-base DN. The login Principal is assumed to be a valid
-     * DN. The scope searched is provided by
-     * {@link LdapConfig#PROPERTY_ROLE_BASE}, and the filter to match roles is
-     * provided by {@link LdapConfig#PROPERTY_IS_IN_ROLE_FILTER}.
+     * This implementation returns {@code true} when the user login Principal
+     * contained in the WikiSession's Subject belongs to an LDAP group found in
+     * the role-base DN. The login Principal is assumed to be a valid JSPWiki
+     * login name and is transformed into a full DN before the search by
+     * consulting {@link LdapConfig#getUserDn(String)}. The scope searched is
+     * provided by {@link LdapConfig#PROPERTY_ROLE_BASE}, and the filter to
+     * match roles is provided by {@link LdapConfig#PROPERTY_IS_IN_ROLE_FILTER}.
      * </p>
      * <p>
      * For example, consider a WikiSession whose subject contains three user
-     * principals, the two built-in roles <code>ALL</code> and
-     * <code>AUTHENTICATED</code>, and a group principal <code>MyGroup</code>:
+     * principals, the two built-in roles {@code ALL} and {@code AUTHENTICATED},
+     * and a group principal {@code MyGroup}. We assume the user names are
+     * stored in the user-base DN {@code ou=people,dc=jspwiki,dc=org}:
      * </p>
-     * <blockquote>
-     * <code>WikiPrincipal.LOGIN_NAME "uid=biggie.smalls,ou=people,dc=jspwiki,dc=org"<br/>
+     * <blockquote> {@code WikiPrincipal.LOGIN_NAME "biggie.smalls"<br/>
      * WikiPrincipal.FULL_NAME "Biggie Smalls"<br/>
      * WikiPrincipal.WIKI_NAME "BiggieSmalls"<br/>
-     * Role.ALL
-     * Role.AUTHENTICATED
-     * GroupPrincipal "MyGroup"</code></blockquote>
+     * Role.ALL Role.AUTHENTICATED GroupPrincipal "MyGroup"}</blockquote>
      * <p>
-     * In this case, the DN
-     * <code>uid=biggie.smalls,ou=people,dc=jspwiki,dc=org</code> would be
-     * examined for membership in an LDAP group whose common name matches
-     * <code>role</code>. Given an is-in-role filter of
-     * <code>(&(objectClass=groupOfUniqueNames)(cn={0})(uniqueMember={1}))</code>
-     * , an LDAP search would be constructed to find objects whose
-     * <code>objectClass</code> was of type <code>groupOfUniqueNames</code> and
-     * whose <code>uniqueMember<code> attribute contained the value
-     * <code>uid=biggie.smalls,ou=people,dc=jspwiki,dc=org</code>.
+     * In this case, the DN {@code
+     * uid=biggie.smalls,ou=people,dc=jspwiki,dc=org} would be examined for
+     * membership in an LDAP group whose common name matches {@code role}. Given
+     * an is-in-role filter of {@code (&(objectClass=groupOfUniqueNames)(cn=\
+     * 0\})(uniqueMember=\{1\}))}, an LDAP search would be constructed to find
+     * objects whose {@code objectClass} was of type {@code groupOfUniqueNames}
+     * and whose {@code uniqueMember} attribute contained the value {@code
+     * uid=biggie.smalls,ou=people,dc=jspwiki,dc=org}.
      * </p>
      */
     public boolean isUserInRole( WikiSession session, Principal role )

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/authorize/LdapAuthorizerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/authorize/LdapAuthorizerTest.java?rev=812334&r1=812333&r2=812334&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/authorize/LdapAuthorizerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/authorize/LdapAuthorizerTest.java Tue Sep  8 03:43:37 2009
@@ -49,7 +49,7 @@
         Keychain keychain = new Keychain();
         keychain.load( null, "keychain-password".toCharArray() );
         Keychain.Password password = new Keychain.Password( "password" );
-        keychain.setEntry( LdapConfig.KEYCHAIN_BIND_DN_ENTRY, password );
+        keychain.setEntry( LdapConfig.KEYCHAIN_LDAP_BIND_PASSWORD, password );
         File file = new File("tests/etc/WEB-INF/test-keychain" );
         OutputStream stream = new FileOutputStream( file );
         keychain.store( stream, "keychain-password".toCharArray() );
@@ -75,7 +75,7 @@
         props.put( AuthorizationManager.PROP_AUTHORIZER, LdapAuthorizer.class.getCanonicalName() );
         props.put( LdapConfig.PROPERTY_ROLE_BASE, "ou=roles,dc=jspwiki,dc=org" );
         props.put( LdapConfig.PROPERTY_IS_IN_ROLE_FILTER, "(&(&(objectClass=groupOfUniqueNames)(cn={0}))(uniqueMember={1}))" );
-        props.put( LdapConfig.PROPERTY_BIND_DN, "Fred" );
+        props.put( LdapConfig.PROPERTY_BIND_USER, "Fred" );
         props.put( AuthenticationManager.PROP_KEYCHAIN_PATH, "test-keychain" );
         props.put( AuthenticationManager.PROP_KEYCHAIN_PASSWORD, "keychain-password" );
 
@@ -246,7 +246,7 @@
         // Set the Authorizer properties
         props.put( AuthorizationManager.PROP_AUTHORIZER, LdapAuthorizer.class.getCanonicalName() );
         props.put( LdapConfig.PROPERTY_ROLE_BASE, "OU=Distribution Lists,OU=.Global,OU=forrester,DC=forrester,DC=loc" );
-        props.put( LdapConfig.PROPERTY_BIND_DN, "ajaquith" );
+        props.put( LdapConfig.PROPERTY_BIND_USER, "ajaquith" );
         props.put( AuthenticationManager.PROP_KEYCHAIN_PATH, "/Users/arj/workspace/ldap/forrester" );
         props.put( AuthenticationManager.PROP_KEYCHAIN_PASSWORD, "keychain-password" );
         
@@ -261,7 +261,7 @@
         Keychain keychain = new Keychain();
         InputStream stream = new FileInputStream( new File( "/Users/arj/workspace/ldap/forrester") );
         keychain.load( stream, "keychain-password".toCharArray() );
-        Keychain.Password password = (Keychain.Password)keychain.getEntry( LdapConfig.KEYCHAIN_BIND_DN_ENTRY );
+        Keychain.Password password = (Keychain.Password)keychain.getEntry( LdapConfig.KEYCHAIN_LDAP_BIND_PASSWORD );
         
         //
         // 2. Test the LdapAuthorizer