https://bugzilla.wikimedia.org/show_bug.cgi?id=46255

       Web browser: ---
            Bug ID: 46255
           Summary: User.php : please add a public function isUser( $user
                    ) to check whether arbitrary(!) $user object is a user
                    i.e. has account
           Product: MediaWiki
           Version: 1.21-git
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General/Unknown
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

I was surprised, that User.php has no public function to quickly check whether
an arbitrary $user object is a user (with acccount).

After asking around, I implemented such a function locally in E:OpenID where
that is needed:

private static function isUser( $user ) {
  return ( $user ) ? $user->loadFromId() : false;
}

but suggest you core developers add a proper function to the core.


see
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/OpenID.git;a=commit;h=HEAD

If you are of a distinct opinion, or have a better idea, pls. let me know, or
even close the bug. I just wanted to mention, that core lacks such a function,
which can be of general use elsewhere.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to