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
introduce names for user backends - via IUserBackend #12819
Conversation
cc @blizzz |
// This means that they should be used by apps instead of the internal ownCloud classes | ||
namespace OCP; | ||
|
||
interface IUserInterfaceV2 extends UserInterface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay... UserInterface... I thought it was about the web UI but actually managing users.
Should probably be called IUserManagement or something else instead. Especially that the "I" is already there for "Interface"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-.- damn I was just blind for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe IUserBackend
? Because we have IUser
(represents one user), IUserManger
(manages user backends), UserInterface
(old version of this but it describes a backend)
26aa3b7
to
0507f11
Compare
@PVince81 I renamed the class ;) |
0507f11
to
1d3b9bc
Compare
Will the JS UI call |
👍 I get you cannot / don't want to rename the "UserInterface" interface as it was there already, which is fine. |
Not yet. Should it be done in the JS part or in the PHP part also? |
I suggest to do it in the JS part when rendering the results. This way your REST results are closer to the original data and the JS is taking care of presentation. |
Not sure if that is not something that belongs into |
@DeepDiver1975 @icewind1991 @PVince81 Opinions? |
* Interface UserInterface | ||
* | ||
* @package OCP | ||
* @deprecated Use \OCP\IUserBackend instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this been released already, or is it new in oC8, because then I'd just delete it right away
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a bit older ;) It's already in stable5 ;) https://github.com/owncloud/core/blob/stable5/lib/public/userinterface.php
Not that strings are not going to be translated, because there is no |
? There are no translated strings in here. If so, then they are in a new PR that follows this one. |
I just mean, adding something like |
@nickvergessen That's another problem, that shouldn't be addressed by this PR |
I'd follow the approach to introduce an interface just like IApacheBackend - basically interface without extends |
1d3b9bc
to
58b4852
Compare
@DeepDiver1975 Implemented and tested your approach. Ready for review |
@@ -27,7 +27,7 @@ | |||
|
|||
use OCA\user_ldap\lib\BackendUtility; | |||
|
|||
class USER_LDAP extends BackendUtility implements \OCP\UserInterface { | |||
class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserInterface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also necessary for user_proxy.php, i can take care of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done with fed45af
This wants to be adjusted as well: https://github.com/owncloud/core/blob/master/lib/private/user/manager.php#L282 |
Why? The additional name requires the new Interface. For other backends you need to add a fallback there. Why change this internal thing if it works already? |
Well, in order to use the backend name, if available, instead of the class name. I.e. the backend would be needed to test if it is an instance of IUserBackend, too. Just as in like the method you used in User. |
fed45af
to
c021895
Compare
@blizzz Fixed ;) |
@@ -279,10 +279,15 @@ public function countUsers() { | |||
if ($backend->implementsActions(\OC_User_Backend::COUNT_USERS)) { | |||
$backendusers = $backend->countUsers(); | |||
if($backendusers !== false) { | |||
if(isset($userCountStatistics[get_class($backend)])) { | |||
$userCountStatistics[get_class($backend)] += $backendusers; | |||
if($this->backend instanceof \OCP\IUserBackend) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost. $backend not $this-backend. we're looping through $this->backends.
c021895
to
403fcfe
Compare
@blizzz done |
Jenkins PR: #12953 |
@owncloud-bot retest this please |
I will have a look
|
* LDAP with multiple servers also proved backendName
403fcfe
to
6da33e1
Compare
Issue is fixed now :) Ready for review again. |
jenkins PR: #12956 |
The inspection completed: 2 new issues, 6 updated code elements |
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 17 lines...]using GIT_SSH to set credentials using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git1007877746804277364.credentials # timeout=10 > git fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse origin/pr/12819/merge^{commit} # timeout=10 > git branch -a --contains 02c9d42ee8e0e8b23fbaaf9fac29d10ac8c01aff # timeout=10 > git rev-parse remotes/origin/pr/12819/merge^{commit} # timeout=10Checking out Revision 02c9d42ee8e0e8b23fbaaf9fac29d10ac8c01aff (origin/pr/12819/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f 02c9d42ee8e0e8b23fbaaf9fac29d10ac8c01aff > git rev-list c508f25f60e5db5bcc8fe0bd962a46b0376c05c2 # timeout=10First time build. Skipping changelog. > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » SLAVEpull-request-analyser-ng-simple » SLAVE completed with result FAILUREStarted calculate disk usage of buildFinished Calculation of disk usage of build in 0 secondsStarted calculate disk usage of workspaceFinished Calculation of disk usage of workspace in 1 minute 25 secondTest FAILed. |
👍 as soons as Jenkins is OK, too. |
cc @DeepDiver1975 @icewind1991 @PVince81 @DeepDiver1975
Is this how we should add stuff to a interface that is implemented by third party apps?
ref #12620 #12806