Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose backend type via REST API #12711

Merged
merged 2 commits into from
Dec 10, 2014
Merged

Conversation

LukasReschke
Copy link
Member

This change will expose the user backend via the REST API which is a pre-requisite for #12620.

For example:

[{
    "name": "9707A09E-CA9A-4ABE-A66A-3F632F16C409",
    "displayname": "Document Conversion User Account",
    "groups": [],
    "subadmin": [],
    "quota": "default",
    "storageLocation": "\/Users\/lreschke\/Programming\/core\/data\/9707A09E-CA9A-4ABE-A66A-3F632F16C409",
    "lastLogin": 0,
    "backend": "OCA\\user_ldap\\USER_LDAP"
}, {
    "name": "ED86733E-745C-4E4D-90CB-278A9737DB3C",
    "displayname": "Hacker",
    "groups": [],
    "subadmin": [],
    "quota": "default",
    "storageLocation": "\/Users\/lreschke\/Programming\/core\/data\/ED86733E-745C-4E4D-90CB-278A9737DB3C",
    "lastLogin": 0,
    "backend": "OCA\\user_ldap\\USER_LDAP"
}, {
    "name": "71CDF45B-E125-450D-983C-D9192F36EC88",
    "displayname": "admin",
    "groups": [],
    "subadmin": [],
    "quota": "default",
    "storageLocation": "\/Users\/lreschke\/Programming\/core\/data\/71CDF45B-E125-450D-983C-D9192F36EC88",
    "lastLogin": 0,
    "backend": "OCA\\user_ldap\\USER_LDAP"
}, {
    "name": "admin",
    "displayname": "admin",
    "groups": ["admin"],
    "subadmin": [],
    "quota": "default",
    "storageLocation": "\/Users\/lreschke\/Programming\/core\/data\/admin",
    "lastLogin": "1418057287",
    "backend": "OC_User_Database"
}, {
    "name": "test",
    "displayname": "test",
    "groups": [],
    "subadmin": [],
    "quota": "default",
    "storageLocation": "\/Users\/lreschke\/Programming\/core\/data\/test",
    "lastLogin": 0,
    "backend": "OC_User_Database"
}]

@MorrisJobke Please review.

@LukasReschke
Copy link
Member Author

Yes - I know that exposing the class name directly is not really the best approach to this but I consider it a sensible solution for now. Open for other suggestions though.

@LukasReschke LukasReschke force-pushed the add-backend-to-rest-index branch from dde0cd1 to cf516da Compare December 8, 2014 22:56
@LukasReschke
Copy link
Member Author

@PVince81 Easy one - up for a review as well? :-)

@LukasReschke
Copy link
Member Author

@DeepDiver1975 Please update lint on the CI server. It can't handle the PHP 5.4 short array syntax.

@LukasReschke
Copy link
Member Author

Error from CI:

18:03:28     [apply] PHP Parse error:  syntax error, unexpected '[', expecting ')' in /var/jenkins/workspace/pull-request-analyser-ng-simple/label/vm-slave-02/tests/settings/controller/userscontrollertest.php on line 123

Code:

->will($this->returnValue(['foo' => 'M. Foo', 'admin' => 'S. Admin', 'bar' => 'B. Ar']));

@LukasReschke LukasReschke force-pushed the add-backend-to-rest-index branch from cf516da to 77e9717 Compare December 8, 2014 23:09
@MorrisJobke MorrisJobke added this to the 8.0-current milestone Dec 9, 2014
for (var i = 0; i < trs.length; i++) {
trs[i].removeClass('transparent');
}
}, 0);
UserList.updating = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should then in the .always() callback. Otherwise it will show the loading state on error all the time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Very good catch. - Adjusted with b09ee3b

This change will expose the user backend via the REST API which is a pre-requisite for #12620.

For example:
````json
[{"name":"9707A09E-CA9A-4ABE-A66A-3F632F16C409","displayname":"Document Conversion User Account","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/9707A09E-CA9A-4ABE-A66A-3F632F16C409","lastLogin":0,"backend":"OCA\\user_ldap\\USER_LDAP"},{"name":"ED86733E-745C-4E4D-90CB-278A9737DB3C","displayname":"Hacker","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/ED86733E-745C-4E4D-90CB-278A9737DB3C","lastLogin":0,"backend":"OCA\\user_ldap\\USER_LDAP"},{"name":"71CDF45B-E125-450D-983C-D9192F36EC88","displayname":"admin","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/71CDF45B-E125-450D-983C-D9192F36EC88","lastLogin":0,"backend":"OCA\\user_ldap\\USER_LDAP"},{"name":"admin","displayname":"admin","groups":["admin"],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/admin","lastLogin":"1418057287","backend":"OC_User_Database"},{"name":"test","displayname":"test","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/test","lastLogin":0,"backend":"OC_User_Database"}]
```
@LukasReschke LukasReschke force-pushed the add-backend-to-rest-index branch from b09ee3b to 4c13918 Compare December 9, 2014 11:04
@LukasReschke
Copy link
Member Author

Switched back to PHP 5.3 array notation for the sake of being able to merge this on time…

@PVince81
Copy link
Contributor

PVince81 commented Dec 9, 2014

Isn't that the file build/phpcs.xml or build/phpmd.xml that needs adjusting for the code style ?

@LukasReschke
Copy link
Member Author

Isn't that the file build/phpcs.xml or build/phpmd.xml that needs adjusting for the code style ?

No idea. Filed #12720 for that.

@LukasReschke
Copy link
Member Author

Branch for CI: #12723

@scrutinizer-notifier
Copy link

The inspection completed: 4 new issues, 5 updated code elements

@LukasReschke
Copy link
Member Author

From #12723 (comment)

🚀 Test PASSed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/4129/
🚀 Test PASSed. 🚀


Who wants to make me happy and review this? :)

LukasReschke added a commit that referenced this pull request Dec 9, 2014
This adds a "backend" type filter to the index REST route which is a pre-requisite for #12620

For example when calling `index.php/settings/users/users?offset=0&limit=10&gid=&pattern=&backend=OC_User_Database` only users within the backend `OC_User_Database` would be shown. (requires sending a CSRF token as well)

Depends upon #12711
@LukasReschke
Copy link
Member Author

Mentioning @nickvergessen as he always likes to review stuff.

@MorrisJobke
Copy link
Contributor

👍

@nickvergessen
Copy link
Contributor

php looks good, didn't review js

@MorrisJobke
Copy link
Contributor

@nickvergessen It's nearly just intendation: https://github.com/owncloud/core/pull/12711/files?w=1#diff-3 Just have a look if the list is still loaded, then everything is fine.

@LukasReschke
Copy link
Member Author

As discussed with Joas, merging.

LukasReschke added a commit that referenced this pull request Dec 10, 2014
@LukasReschke LukasReschke merged commit 5398bbd into master Dec 10, 2014
@LukasReschke LukasReschke deleted the add-backend-to-rest-index branch December 10, 2014 10:56
LukasReschke added a commit that referenced this pull request Dec 10, 2014
This adds a "backend" type filter to the index REST route which is a pre-requisite for #12620

For example when calling `index.php/settings/users/users?offset=0&limit=10&gid=&pattern=&backend=OC_User_Database` only users within the backend `OC_User_Database` would be shown. (requires sending a CSRF token as well)

Depends upon #12711
@MorrisJobke MorrisJobke mentioned this pull request Dec 22, 2014
27 tasks
@lock lock bot locked as resolved and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants