Commit 788f0aca authored by Cameron Chunn's avatar Cameron Chunn
Browse files

Merge branch 'use-mediawiki-user-ids' into 'master'

Use MediaWiki User IDs for user identifiers

See merge request !139
parents 54fba8b2 3d6589ce
Pipeline #125822982 passed with stage
in 1 minute and 19 seconds
......@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Reverb;
use CentralIdLookup;
use User;
class UserIdHelper {
......@@ -24,8 +23,7 @@ class UserIdHelper {
* @return integer
*/
public static function getUserIdForService(User $user): int {
$lookup = CentralIdLookup::factory();
return $lookup->centralIdFromLocalUser($user, CentralIdLookup::AUDIENCE_RAW);
return $user->getId();
}
/**
......@@ -36,7 +34,6 @@ class UserIdHelper {
* @return User|null
*/
public static function getUserForServiceUserId(int $serviceUserId): ?User {
$lookup = CentralIdLookup::factory();
return $lookup->localUserFromCentralId($serviceUserId);
return User::newFromId($serviceUserId);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment