roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1569623 - in /roller/branches/roller_5.0: weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/ weblogger-webapp/src/main/webapp/WEB-INF/ weblogger-webapp/src/main/webapp/roller-ui/scripts/
Date Wed, 19 Feb 2014 03:50:40 GMT
Author: gmazza
Date: Wed Feb 19 03:50:40 2014
New Revision: 1569623

URL: http://svn.apache.org/r1569623
Log:
Porting Greg's fix for ROL-1983 to the 5.0.x branch.

Modified:
    roller/branches/roller_5.0/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/UserDataServlet.java
    roller/branches/roller_5.0/weblogger-webapp/src/main/webapp/WEB-INF/web.xml
    roller/branches/roller_5.0/weblogger-webapp/src/main/webapp/roller-ui/scripts/ajax-user.js

Modified: roller/branches/roller_5.0/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/UserDataServlet.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_5.0/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/UserDataServlet.java?rev=1569623&r1=1569622&r2=1569623&view=diff
==============================================================================
--- roller/branches/roller_5.0/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/UserDataServlet.java
(original)
+++ roller/branches/roller_5.0/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/UserDataServlet.java
Wed Feb 19 03:50:40 2014
@@ -57,16 +57,21 @@ public class UserDataServlet extends Htt
     public void doGet(HttpServletRequest request, HttpServletResponse response)
             throws ServletException, IOException {
 
+        boolean admin = false;
+
         WeblogRequest weblogRequest = null;
         try {
             weblogRequest = new WeblogRequest(request);
 
             // Make sure we have the correct authority
             User user = weblogRequest.getUser();
-            if (user == null || !user.hasGlobalPermission("admin")) {
-                // user not found or not admin
+            if (user == null) {
+                // user not found
                 response.sendError(HttpServletResponse.SC_NOT_FOUND);
                 return;
+            } else if (user.hasGlobalPermission("admin")) {
+                // admin
+                admin = true;
             }
 
         } catch (Exception e) {
@@ -96,7 +101,11 @@ public class UserDataServlet extends Htt
                 User user = (User)userIter.next();
                 response.getWriter().print(user.getUserName());
                 response.getWriter().print(",");
-                response.getWriter().println(user.getEmailAddress());
+                if (admin) {
+                    response.getWriter().println(user.getEmailAddress());
+                } else {
+                    response.getWriter().println(user.getScreenName());
+                }
             }
             response.flushBuffer();
         } catch (WebloggerException e) {

Modified: roller/branches/roller_5.0/weblogger-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/roller/branches/roller_5.0/weblogger-webapp/src/main/webapp/WEB-INF/web.xml?rev=1569623&r1=1569622&r2=1569623&view=diff
==============================================================================
--- roller/branches/roller_5.0/weblogger-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ roller/branches/roller_5.0/weblogger-webapp/src/main/webapp/WEB-INF/web.xml Wed Feb 19
03:50:40 2014
@@ -471,7 +471,7 @@
 
     <servlet-mapping>
         <servlet-name>UserDataServlet</servlet-name>
-        <url-pattern>/roller-ui/admin/userdata/*</url-pattern>
+        <url-pattern>/roller-ui/authoring/userdata/*</url-pattern>
     </servlet-mapping>
 
 

Modified: roller/branches/roller_5.0/weblogger-webapp/src/main/webapp/roller-ui/scripts/ajax-user.js
URL: http://svn.apache.org/viewvc/roller/branches/roller_5.0/weblogger-webapp/src/main/webapp/roller-ui/scripts/ajax-user.js?rev=1569623&r1=1569622&r2=1569623&view=diff
==============================================================================
--- roller/branches/roller_5.0/weblogger-webapp/src/main/webapp/roller-ui/scripts/ajax-user.js
(original)
+++ roller/branches/roller_5.0/weblogger-webapp/src/main/webapp/roller-ui/scripts/ajax-user.js
Wed Feb 19 03:50:40 2014
@@ -30,7 +30,7 @@ function createRequestObject() {
 var http = createRequestObject();
 var init = false;
 var isBusy = false;
-var userURL = "<%= request.getContextPath() %>" + "/roller-ui/admin/userdata?length=50";
+var userURL = "<%= request.getContextPath() %>" + "/roller-ui/authoring/userdata?length=50";
 
 function onUserNameFocus(enabled) {
     if (!init) {



Mime
View raw message