Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
c21d1da0
Commit
c21d1da0
authored
10 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
Support displaynames for dummy user backend
parent
7ecd2207
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/private/user/dummy.php
+18
-3
18 additions, 3 deletions
lib/private/user/dummy.php
with
18 additions
and
3 deletions
lib/private/user/dummy.php
+
18
−
3
View file @
c21d1da0
...
...
@@ -26,9 +26,11 @@
*/
class
OC_User_Dummy
extends
OC_User_Backend
{
private
$users
=
array
();
private
$displayNames
=
array
();
/**
* Create a new user
*
* @param string $uid The username of the user to create
* @param string $password The password of the new user
* @return bool
...
...
@@ -47,6 +49,7 @@ class OC_User_Dummy extends OC_User_Backend {
/**
* delete a user
*
* @param string $uid The username of the user to delete
* @return bool
*
...
...
@@ -63,6 +66,7 @@ class OC_User_Dummy extends OC_User_Backend {
/**
* Set password
*
* @param string $uid The username
* @param string $password The new password
* @return bool
...
...
@@ -80,6 +84,7 @@ class OC_User_Dummy extends OC_User_Backend {
/**
* Check if the password is correct
*
* @param string $uid The username
* @param string $password The password
* @return string
...
...
@@ -97,6 +102,7 @@ class OC_User_Dummy extends OC_User_Backend {
/**
* Get a list of all users
*
* @param string $search
* @param int $limit
* @param int $offset
...
...
@@ -105,12 +111,12 @@ class OC_User_Dummy extends OC_User_Backend {
* Get a list of all users.
*/
public
function
getUsers
(
$search
=
''
,
$limit
=
null
,
$offset
=
null
)
{
if
(
empty
(
$search
))
{
if
(
empty
(
$search
))
{
return
array_keys
(
$this
->
users
);
}
$result
=
array
();
foreach
(
array_keys
(
$this
->
users
)
as
$user
)
{
if
(
stripos
(
$user
,
$search
)
!==
false
)
{
foreach
(
array_keys
(
$this
->
users
)
as
$user
)
{
if
(
stripos
(
$user
,
$search
)
!==
false
)
{
$result
[]
=
$user
;
}
}
...
...
@@ -119,6 +125,7 @@ class OC_User_Dummy extends OC_User_Backend {
/**
* check if a user exists
*
* @param string $uid the username
* @return boolean
*/
...
...
@@ -141,4 +148,12 @@ class OC_User_Dummy extends OC_User_Backend {
public
function
countUsers
()
{
return
0
;
}
public
function
setDisplayName
(
$uid
,
$displayName
)
{
$this
->
displayNames
[
$uid
]
=
$displayName
;
}
public
function
getDisplayName
(
$uid
)
{
return
isset
(
$this
->
displayNames
[
$uid
])
?
$this
->
displayNames
[
$uid
]
:
$uid
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment