jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mets...@apache.org
Subject svn commit: r942373 - in /incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH: ./ etc/i18n/ src/com/ecyrd/jspwiki/ src/com/ecyrd/jspwiki/content/ src/com/ecyrd/jspwiki/providers/ src/com/ecyrd/jspwiki/tags/
Date Sat, 08 May 2010 12:11:46 GMT
Author: metskem
Date: Sat May  8 12:11:45 2010
New Revision: 942373

URL: http://svn.apache.org/viewvc?rev=942373&view=rev
Log:
2.8.4-svn-12        
        * JSPWIKI-392 and JSPWIKI-442 invalid asserted usernames
        * JSPWIKI-649 CachingProvider.deleteVersion leaves a stale m_historyCache
        

Modified:
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources.properties
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources_nl.properties
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiSession.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/content/Exporter.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/providers/CachingProvider.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/providers/VersioningFileProvider.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/tags/UserNameTag.java

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog?rev=942373&r1=942372&r2=942373&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog Sat May  8 12:11:45 2010
@@ -1,4 +1,12 @@
-2010-04-23  Dirk Frederickx <brushed@apache.org>
+2010-05-08  Harry Metske <metskem@apache.org>
+
+        * 2.8.4-svn-12
+        
+        * JSPWIKI-392 and JSPWIKI-442 invalid asserted usernames
+        
+        * JSPWIKI-649 CachingProvider.deleteVersion leaves a stale m_historyCache
+        
+        * 2010-04-23  Dirk Frederickx <brushed@apache.org>
 
         * 2.8.4-svn-11
         

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources.properties
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources.properties?rev=942373&r1=942372&r2=942373&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources.properties (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources.properties Sat May
 8 12:11:45 2010
@@ -46,6 +46,7 @@ security.error.illegalloginname=Login na
 security.user.loginname=Login name
 security.user.fullname=Full name
 security.user.email=Email address
+security.user.fullname.invalid=Invalid Username
 
 # Renaming
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources_nl.properties
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources_nl.properties?rev=942373&r1=942372&r2=942373&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources_nl.properties (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources_nl.properties Sat
May  8 12:11:45 2010
@@ -47,6 +47,7 @@ security.error.illegalloginname=Ongeldig
 security.user.loginname=Login naam
 security.user.fullname=Volledige naam
 security.user.email=Email adres
+security.user.fullname.invalid=Ongeldige Gebruikers Naam
 
 # Renaming
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java?rev=942373&r1=942372&r2=942373&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java Sat May
 8 12:11:45 2010
@@ -77,7 +77,7 @@ public final class Release
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "11";
+    public static final String     BUILD         = "12";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiSession.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiSession.java?rev=942373&r1=942372&r2=942373&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiSession.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiSession.java Sat
May  8 12:11:45 2010
@@ -438,7 +438,6 @@ public final class WikiSession implement
      * GroupManager. This method adds Principals to the private Subject managed
      * by the WikiSession.
      * @see com.ecyrd.jspwiki.event.WikiEventListener#actionPerformed(com.ecyrd.jspwiki.event.WikiEvent)
-     * {@inheritDoc}
      */
     public final void actionPerformed( WikiEvent event )
     {

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/content/Exporter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/content/Exporter.java?rev=942373&r1=942372&r2=942373&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/content/Exporter.java
(original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/content/Exporter.java
Sat May  8 12:11:45 2010
@@ -73,8 +73,8 @@ public class Exporter
     /**
      *  Create a new wiki exporter.
      *  
-     *  @param engine The WikiEngine to export
      *  @param outStream The stream to which the XML data should be written.
+     *  @param verbose use verbosity or not
      * 
      *  @throws UnsupportedEncodingException If your platform does not support UTF-8
      */

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/providers/CachingProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/providers/CachingProvider.java?rev=942373&r1=942372&r2=942373&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/providers/CachingProvider.java
(original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/providers/CachingProvider.java
Sat May  8 12:11:45 2010
@@ -815,10 +815,10 @@ public class CachingProvider
             {
                 m_cache.removeEntry( pageName );
                 m_textCache.removeEntry( pageName );
-                m_historyCache.removeEntry( pageName );
             }
 
             m_provider.deleteVersion( pageName, version );
+            m_historyCache.removeEntry( pageName );
         }
     }
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/providers/VersioningFileProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/providers/VersioningFileProvider.java?rev=942373&r1=942372&r2=942373&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/providers/VersioningFileProvider.java
(original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/providers/VersioningFileProvider.java
Sat May  8 12:11:45 2010
@@ -670,6 +670,11 @@ public class VersioningFileProvider
 
     /**
      *  {@inheritDoc}
+     *  
+     *  Deleting versions has never really worked,
+     *  JSPWiki assumes that version histories are "not gappy". 
+     *  Using deleteVersion() is definitely not recommended.
+     *  
      */
     public void deleteVersion( String page, int version )
         throws ProviderException

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/tags/UserNameTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/tags/UserNameTag.java?rev=942373&r1=942372&r2=942373&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/tags/UserNameTag.java
(original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/tags/UserNameTag.java
Sat May  8 12:11:45 2010
@@ -22,11 +22,14 @@ package com.ecyrd.jspwiki.tags;
 
 import java.io.IOException;
 import java.security.Principal;
+import java.util.regex.Pattern;
+
 import javax.servlet.http.HttpServletRequest;
 
 import com.ecyrd.jspwiki.WikiEngine;
 import com.ecyrd.jspwiki.WikiSession;
 import com.ecyrd.jspwiki.TextUtil;
+import com.ecyrd.jspwiki.i18n.InternationalizationManager;
 
 /**
  *  Returns the current user name, or empty, if the user has not been
@@ -34,21 +37,34 @@ import com.ecyrd.jspwiki.TextUtil;
  *
  *  @since 2.0
  */
-public class UserNameTag
-    extends WikiTagBase
+public class UserNameTag extends WikiTagBase
 {
     private static final long serialVersionUID = 0L;
-    
-    public final int doWikiStartTag()
-        throws IOException
+
+    private static String notStartWithBlankOrColon = "^[^( |:)]";
+
+    private static String noColons = "[^:]*";
+
+    private static final Pattern VALID_USER_NAME_PATTERN = Pattern.compile(notStartWithBlankOrColon
+ noColons);
+
+    public final int doWikiStartTag() throws IOException
     {
         WikiEngine engine = this.m_wikiContext.getEngine();
-        WikiSession wikiSession = WikiSession.getWikiSession( engine, (HttpServletRequest)pageContext.getRequest()
);
+        WikiSession wikiSession = WikiSession.getWikiSession(engine, (HttpServletRequest)
pageContext.getRequest());
         Principal user = wikiSession.getUserPrincipal();
 
-        if( user != null )
+        if (user != null)
         {
-            pageContext.getOut().print( TextUtil.replaceEntities( user.getName() ) );
+            if (VALID_USER_NAME_PATTERN.matcher(user.getName()).matches())
+            {
+                pageContext.getOut().print(TextUtil.replaceEntities(user.getName()));
+            }
+            else
+            {
+                pageContext.getOut().print(
+                                           m_wikiContext.getBundle(InternationalizationManager.CORE_BUNDLE)
+                                               .getString("security.user.fullname.invalid"));
+            }
         }
 
         return SKIP_BODY;



Mime
View raw message