Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-6532

checkActive(String user, XWikiContext context) checks if context.getUser() is active instead of the parameter user

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.1 M1
    • Component/s: Old Core
    • Labels:
      None
    • keywords:
      checkActive, class XWiki,patch
    • Difficulty:
      Trivial
    • Similar issues:

      Description

      Hi

      I just stumbled across something I think is a bug in the checkActive(user, context) method in the com.xpn.xwiki.XWiki class.

      The method's declaration (Line 5096) is:

       
      public int checkActive(String user, XWikiContext context) throws XWikiException
      

      and later the active check (Lines 5108-5110) is made using:

      String username = context.getUser();
      XWikiDocument userdoc = getDocument(username, context);
      active = userdoc.getIntValue("XWiki.XWikiUsers", "active");
      

      So this method always checks if "context.getUser()" is active instead of checking it for the parameter "user", what would have been the behavior I was expecting.

      The fix would be to remove the variable "username" and use "user" instead.

        Attachments

          Activity

            People

            • Assignee:
              vmassol Vincent Massol
              Reporter:
              ebeutler Edoardo Beutler
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: