roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r753383 - in /roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger: config/roller.properties pojos/wrapper/UserWrapper.java
Date Fri, 13 Mar 2009 20:24:19 GMT
Author: snoopdave
Date: Fri Mar 13 20:24:08 2009
New Revision: 753383

URL: http://svn.apache.org/viewvc?rev=753383&view=rev
Log:
Makes private usernames configurable:
   https://issues.apache.org/roller/browse/ROL-1797

Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/config/roller.properties
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/UserWrapper.java

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/config/roller.properties
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/config/roller.properties?rev=753383&r1=753382&r2=753383&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/config/roller.properties
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/config/roller.properties
Fri Mar 13 20:24:08 2009
@@ -354,6 +354,11 @@
 # True to give the first user that is registered admin privileges
 users.firstUserAdmin=true
 
+# Normally, for security purposes Roller keeps usernames private and the user
+# getUserName() method in templates actually returns the user's sceenname.
+# If you want templates to have access to real usernames, set this to false.
+user.privateUserNames=true
+
 # Enable scheme enforcement?
 # Scheme enforcement ensures that specific URLs are viewed only via HTTPS
 schemeenforcement.enabled=false

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/UserWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/UserWrapper.java?rev=753383&r1=753382&r2=753383&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/UserWrapper.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/UserWrapper.java
Fri Mar 13 20:24:08 2009
@@ -19,6 +19,7 @@
 package org.apache.roller.weblogger.pojos.wrapper;
 
 import java.util.Date;
+import org.apache.roller.weblogger.config.WebloggerConfig;
 import org.apache.roller.weblogger.pojos.User;
 
 
@@ -50,7 +51,10 @@
      * username to be displayed publicly, so screen name is returned instead.
      */
     public String getUserName() {
-        return this.pojo.getScreenName();
+        if (WebloggerConfig.getBooleanProperty("user.privateUserNames")) {
+            return this.pojo.getScreenName();
+        }
+        return this.pojo.getUserName();
     }
     
     



Mime
View raw message