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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 3.1 M1
    • 3.0
    • Old Core
    • None
    • checkActive, class XWiki,patch
    • Trivial

    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

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

            Dates

              Created:
              Updated:
              Resolved: