Skip to content

Conversation

@blizzz
Copy link
Member

@blizzz blizzz commented Oct 26, 2020

When LDAP users are found as deleted in occ ldap:show-remnants it is displayed whether a listed user was also a sharer. A Y(es) or N(o) is shown in that column. Example:

+--------------------------------------+------------------------+----------+---------------------------------------------+------------------+------------------+-----+--------+
| Nextcloud name                       | Display Name           | LDAP UID | LDAP DN                                     | Last Login       | Detected on      | Dir | Sharer |
+--------------------------------------+------------------------+----------+---------------------------------------------+------------------+------------------+-----+--------+
| folk_31                              | Teresa, John (folk_31) | folk_31  | uid=folk_31,ou=users,ou=small,dc=nc,dc=zara | October 26, 2020 | October 26, 2020 |     | Y      |
| 567DE9DC-D733-4FD5-8F85-EA637640A43A | Anna Mang (amang)      | amang    | cn=anna mang,cn=users,dc=nxtcld,dc=internal | -                | July 30, 2020    |     | N      |
+--------------------------------------+------------------------+----------+---------------------------------------------+------------------+------------------+-----+--------+

I was made aware that a condition failed to show it properly, if a user had more than one share 🙈 In the old code (mostly unchanged since 2014) also the relevant share tables were queried directly, as the share manager was not in place. This is updated in this PR as well.

Some refactorings are necessary, for instance moving logic from the OfflineUsers constructor. This allows for unit tests, but makes the instance also more lazy in gathering info on that user. Some further code cleanup was while some class signatures needed change. Leaving changed and added tests aside, about 20 LoC are saved.

The first three commits are essentially the base of the fix for NC 20 and below (PR coming in a bit).

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@faily-bot
Copy link

faily-bot bot commented Oct 26, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 34577: failure

mariadb10.4-php7.4

Show full log
There was 1 error:

1) Test\Share20\DefaultShareProviderTest::testGetShareByIdUserShare
OCP\Share\Exceptions\ShareNotFound: There was an error retrieving the share. Maybe the link is wrong, it was unshared, or it was deleted.

/drone/src/lib/private/Share20/DefaultShareProvider.php:763
/drone/src/tests/lib/Share20/DefaultShareProviderTest.php:220

--

There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

mysql8.0-php7.4

  • cancelled - typically means that the tests took longer than the drone CI allows them to run

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Code looks good 👍

Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

🐘

@blizzz blizzz merged commit 41fe4dc into master Oct 27, 2020
@blizzz blizzz deleted the fix/noid/remnants-sharee-display branch October 27, 2020 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants