Skip to content

Commit

Permalink
Merge pull request #30811 from owncloud/stable10-fix-issue-30727
Browse files Browse the repository at this point in the history
[stable10] Fix webUI display of group containing numeric username
  • Loading branch information
phil-davis authored Mar 20, 2018
2 parents b7ec59a + 1f77674 commit 61ae0de
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/private/User/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function clearBackends() {
* @return \OC\User\User|null Either the user or null if the specified user does not exist
*/
public function get($uid) {
if (is_null($uid) || !is_string($uid)) {
if (is_null($uid) || (!is_string($uid) && !is_numeric($uid))) {
return null;
}
if ($this->cachedUsers->hasKey($uid)) { //check the cache first to prevent having to loop over the backends
Expand Down
15 changes: 14 additions & 1 deletion tests/acceptance/features/apiMain/provisioning-v1.feature
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,25 @@ Feature: provisioning
Then the OCS status code should be "103"
And the HTTP status code should be "200"

Scenario: getting a group
Scenario: getting an empty group
Given group "new-group" has been created
When user "admin" sends HTTP method "GET" to API endpoint "/cloud/groups/new-group"
Then the OCS status code should be "100"
And the HTTP status code should be "200"

Scenario: getting users in a group
Given user "brand-new-user" has been created
And user "123" has been created
And group "new-group" has been created
And user "brand-new-user" has been added to group "new-group"
And user "123" has been added to group "new-group"
When user "admin" sends HTTP method "GET" to API endpoint "/cloud/groups/new-group"
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the users returned by the API should be
| brand-new-user |
| 123 |

Scenario: Getting all groups
Given group "0" has been created
And group "new-group" has been created
Expand Down

0 comments on commit 61ae0de

Please sign in to comment.