1. Atlassian
  2. Project: Atlassian
  3. confluence-user-lister-plugin

Commits

David Chui  committed 93f3a55

[maven-release-plugin] copy for tag confluence-userlister-plugin-2.4.1

  • Participants
  • Parent commits 400c82a
  • Branches master
  • Tags confluence-userlister-plugin-2.4.1

Comments (0)

Files changed (5)

File pom.xml

View file
  • Ignore whitespace
-<?xml version="1.0" encoding="UTF-8"?>
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <parent>
         <groupId>com.atlassian.confluence.plugin.base</groupId>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.atlassian.confluence.plugins</groupId>
     <artifactId>confluence-userlister-plugin</artifactId>
-    <version>2.4-SNAPSHOT</version>
+    <version>2.4.1</version>
 
     <name>User Lister</name>
     <packaging>atlassian-plugin</packaging>
 
         <atlassian.pdk.server.username>admin</atlassian.pdk.server.username>
         <atlassian.pdk.server.password>admin</atlassian.pdk.server.password>
-        <atlassian.product.version>2.8.1</atlassian.product.version>
+        <atlassian.product.version>2.8.2</atlassian.product.version>
     </properties>
 
     <description>A plugin which reports on Users, per group, within Confluence</description>
 
 
     <scm>
-        <connection>scm:svn:https://svn.atlassian.com/svn/public/contrib/confluence/confluence-userlister-plugin/trunk
-        </connection>
-        <developerConnection>
-            scm:svn:https://svn.atlassian.com/svn/public/contrib/confluence/confluence-userlister-plugin/trunk
-        </developerConnection>
-        <url>http://svn.atlassian.com/fisheye/browse/public/contrib/confluence/confluence-userlister-plugin/trunk</url>
+        <connection>scm:svn:https://svn.atlassian.com/svn/public/contrib/confluence/confluence-userlister-plugin/tags/confluence-userlister-plugin-2.4.1</connection>
+        <developerConnection>scm:svn:https://svn.atlassian.com/svn/public/contrib/confluence/confluence-userlister-plugin/tags/confluence-userlister-plugin-2.4.1</developerConnection>
+        <url>http://svn.atlassian.com/fisheye/browse/public/contrib/confluence/confluence-userlister-plugin/tags/confluence-userlister-plugin-2.4.1</url>
     </scm>
 </project>

File src/main/java/com/atlassian/confluence/extra/userlister/UserLister.java

View file
  • Ignore whitespace
 import com.atlassian.renderer.v2.macro.BaseMacro;
 import com.atlassian.renderer.v2.macro.MacroException;
 import com.atlassian.user.Group;
+import com.atlassian.user.search.page.Pager;
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.log4j.Logger;
 
 import java.util.ArrayList;
     {
         //1. parse parameters from macro
         String groupNames = StringUtils.defaultString((String) parameters.get("groups"), (String) parameters.get("group"));
-        boolean returnOnlineUsers = Boolean.parseBoolean(StringUtils.defaultString(StringUtils.trim((String) parameters.get("online"))));
+        boolean returnOnlineUsers = Boolean.valueOf(StringUtils.defaultString(StringUtils.trim((String) parameters.get("online")))).booleanValue();
         Boolean showWarning = Boolean.valueOf(StringUtils.defaultString(StringUtils.trim((String) parameters.get("showWarning")), "true"));
+
+        Set blackListedGroups = userListManager.getGroupBlackList();
         
         if(StringUtils.isBlank(groupNames))
             return getText("userlister.no.groups.specified");
 
+        if (ArrayUtils.contains(StringUtils.split(groupNames, ','), UserList.ALL_GROUP_NAME)
+                && blackListedGroups.contains(UserList.ALL_GROUP_NAME))
+            return getText("userlister.group.name.list.contains.asterisk");
+
         Set groups = getGroups(groupNames);
         Set allowedGroups = getAllowedGroups(groups);
         Set deniedGroups = getDeniedGroups(groups);
 
-        Set blackListedGroups = userListManager.getGroupBlackList();
         Collection loggedInUsernames = loggedInUsers.values();
+        
         ArrayList groupList = new ArrayList();
         List emptyGroups = new ArrayList();
 
          */
         if (groups.contains(UserList.ALL_GROUP_NAME))
         {
-            List groupsExpanded = userAccessor.getGroupsAsList(AuthenticatedUserThreadLocal.getUser());
-            for (Iterator i = groupsExpanded.iterator(); i.hasNext();)
+            Pager filteredExpandedGroups = userAccessor.filterUnaccessibleGroups(userAccessor.getGroups(), AuthenticatedUserThreadLocal.getUser());
+            for (Iterator i = filteredExpandedGroups.iterator(); i.hasNext();)
                 groups.add(((Group) i.next()).getName());
 
             /* Then remove the wildcard */

File src/main/java/com/atlassian/confluence/extra/userlister/actions/ConfigureUserListsAction.java

View file
  • Ignore whitespace
 
 import com.atlassian.confluence.core.ConfluenceActionSupport;
 import com.atlassian.confluence.extra.userlister.UserListManager;
+import com.atlassian.confluence.extra.userlister.model.UserList;
 import com.atlassian.confluence.user.UserAccessor;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 
     public String execute() throws Exception
     {
-        if (StringUtils.equals("Save", save))
+        if (StringUtils.equals(getText("add.name"), save))
         {
             userListManager.saveGroupBlackList(getBlackListEntiresAsList());
 
 
     public void validate()
     {
-        if (StringUtils.equals("Back", cancel))
+        if (StringUtils.equals(getText("back.name"), cancel))
             return;
 
         try
             {
                 final String groupName = (String) i.next();
 
-                if (null == userAccessor.getGroup(groupName))
+                if (!StringUtils.equals(UserList.ALL_GROUP_NAME, groupName) && null == userAccessor.getGroup(groupName))
                     invalidGroupNames.add(groupName);
             }
 

File src/main/resources/templates/extra/userlister/configure-blacklist.vm

View file
  • Ignore whitespace
             <p>$action.getText("userlister.configure.preamble")</p>
             <p>$action.getText("userlister.configure.preamble.1")</p>
             <p>$action.getText("userlister.configure.preamble.2")</p>
+            <p>$action.getText("userlister.configure.preamble.3")</p>
         </div>
 
         #parse ( "/template/includes/actionerrors.vm" )

File src/main/resources/userlister.properties

View file
  • Ignore whitespace
   and &quot;confluence-administrator&quot; groups to be listed, you will need to insert the following text into the text area.
 userlister.configure.preamble.2=<pre>confluence-users<br />\
   confluence-adminstrators</pre>
+userlister.configure.preamble.3=You can also specify ''*'' to deny users from listing members of all groups. \
+  However, please note that this <i>does not deny users from listing members of any group</i>. \
+  It just prevents users from using ''*'' to list members of all groups. \
+  Your users can still list members by specifiying non blacklisted groups explictly. For instance: <pre>'{'userlister:groups=confluence-users'}'</pre>
 userlister.configure.successful=Configuration saved.
 userlister.configure.invalid.group.names=Your input contains invalid group names. They are: {0}
 userlister.configure.ioexception=Unable to perform validation due to an IOException. Please check your logs for more details.
   <p>Supplying a groups value will list only members of those groups. The groups value supports a comma separated list of group-names.</p>
 userlister.online.desc=Specifying the online value allows you to filter the user list by the user online status. Setting \
   online=true will show only online users, whereas setting online=false will show only offline users.
-userlister.showWarning.desc=If you've configured this macro to display groups which are black listed by the administrator, \
+userlister.showWarning.desc=If you''ve configured this macro to display groups which are black listed by the administrator, \
   you will get a warning panel at the top. The warning will be automatically displayed by default. To disable the warning, \
   you can specify showWarning=false.
 userlister.groupname.example=confluence-administrators
 userlister.contains.blacklisted.groups.in.result=The output you''re seeing is filtered. It contains blacklisted group(s) below.
 userlister.unable.to.render.result=Error while trying to display UserList! The template used to construct the userlister could not be loaded from the filesystem. \
   Please contact an administrator with the following stacktrace: {0}
+userlister.group.name.list.contains.asterisk=<p><span class=''error''>The group(s) you have specified includes ''*'', which has been blacklisted by the administrator. Please remove it and try again.</span></p>