Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
HydraWiki
Extensions
Reverb
Commits
3d6589ce
Commit
3d6589ce
authored
Mar 12, 2020
by
Robert Nix
Browse files
Use MediaWiki User IDs for user identifiers
parent
54fba8b2
Pipeline
#125776790
passed with stage
in 1 minute and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
includes/UserIdHelper.php
includes/UserIdHelper.php
+2
-5
No files found.
includes/UserIdHelper.php
View file @
3d6589ce
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment