[Bug 46255] User.php : please add a public function isUser( $user ) to check whether arbitrary(!) $user object is a user i.e. has account

2013-03-23 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=46255

--- Comment #8 from db duplicate...@googlemail.com ---
isLoggedIn does your job, but the way you have it also possible

isLoggedin is calling getId which is calling loadFromId, so this is doing the
same thing than your idea.

Calling isLoggedIn on $wgUser would check, if the visiting user has a
registered account (yes, when he has a account, but not logged in, this will
also give false ...)

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 46255] User.php : please add a public function isUser( $user ) to check whether arbitrary(!) $user object is a user i.e. has account

2013-03-21 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=46255

--- Comment #3 from db duplicate...@googlemail.com ---
That is done with isLoggedIn

The method name is misleading, you does not check, if the user behind the
object is currently logged in the wiki. You only check, if there is a account.

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 46255] User.php : please add a public function isUser( $user ) to check whether arbitrary(!) $user object is a user i.e. has account

2013-03-21 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=46255

--- Comment #4 from T. Gries m...@tgries.de ---
I don't want to check whether that user is logged-in (this can be done checking
against $wgUser.)

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 46255] User.php : please add a public function isUser( $user ) to check whether arbitrary(!) $user object is a user i.e. has account

2013-03-21 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=46255

Chad H. innocentkil...@gmail.com changed:

   What|Removed |Added

 CC||innocentkil...@gmail.com

--- Comment #5 from Chad H. innocentkil...@gmail.com ---
$user = User::newFromId( 1234 );
$user-loadFromDatabase();

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 46255] User.php : please add a public function isUser( $user ) to check whether arbitrary(!) $user object is a user i.e. has account

2013-03-21 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=46255

--- Comment #6 from T. Gries m...@tgries.de ---
(In reply to comment #5)
 $user = User::newFromId( 1234 );
 $user-loadFromDatabase();

I do this

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

is is okay ?


https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/OpenID.git;a=blob;f=SpecialOpenIDIdentifier.body.php;h=d8270c4c4e63602fc3a00124feff3aa923ea1498;hb=ae494618ee890a8fe7f77cc2f5951f1157a6d8ba#l46

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 46255] User.php : please add a public function isUser( $user ) to check whether arbitrary(!) $user object is a user i.e. has account

2013-03-21 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=46255

T. Gries m...@tgries.de changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #7 from T. Gries m...@tgries.de ---
so, as no function will apparently added to core, I am in the mood of
closing...

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 46255] User.php : please add a public function isUser( $user ) to check whether arbitrary(!) $user object is a user i.e. has account

2013-03-19 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=46255

db duplicate...@googlemail.com changed:

   What|Removed |Added

 CC||duplicate...@googlemail.com

--- Comment #1 from db duplicate...@googlemail.com ---
Try to use
$user  $user-isLoggedIn()
or
$user  !$user-isAnon()
to detect, if the user object is a valid account

loadFromId assumed that you have set a id on the object.

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 46255] User.php : please add a public function isUser( $user ) to check whether arbitrary(!) $user object is a user i.e. has account

2013-03-19 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=46255

--- Comment #2 from T. Gries m...@tgries.de ---
(In reply to comment #1)
 Try to use
 $user  $user-isLoggedIn()
 or
 $user  !$user-isAnon()
 to detect, if the user object is a valid account
 
 loadFromId assumed that you have set a id on the object.

Exactly this is the case, because the incoming OpenID Identifier has an id
(SpecialOpenIDIdentifier/id) from which a user object is created newFromID(i).

I do *not* want to test whether this is the or an logged-in user, but only, if
there is an account with that id.

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 46255] User.php : please add a public function isUser( $user ) to check whether arbitrary(!) $user object is a user i.e. has account

2013-03-18 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=46255

T. Gries m...@tgries.de changed:

   What|Removed |Added

   Keywords||easy
   Priority|Unprioritized   |Normal
   Severity|normal  |enhancement

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l