Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions lib/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,11 @@ public function __construct(array $urlParams = []) {
$userManager->clearBackends();
$userManager->registerBackend($c->query(AlternativeHomeUserBackend::class));

$userManager->listen('\OC\User', 'postCreateUser', function ($user, $password) use ($c) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if this is only for fixing Oracle, I don't see why the code has been moved outside of the "postCreateUser" hook instead of just changing the literal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That was from TM patch

What's the intention of this postCreateUser here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I added this back then to delay updating the accounts table to after the admin user got created, because in some cases it would happen too early. Not sure if this time we got lucky or other core changes would remove the need for this.

If this doesn't break acceptance tests on core then I'm fine keeping it this way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

https://drone.owncloud.com/owncloud/core/10273 - acceptance tests are all green

$q = $c->getServer()->getDatabaseConnection()->getQueryBuilder();
$q->update('*PREFIX*accounts')
->set('backend', $q->expr()->literal(AlternativeHomeUserBackend::class))
->where($q->expr()->eq('user_id', $q->createNamedParameter($user->getUID())))
->execute();
});

// first call must adjust all existing backends
if ($config->getAppValue($appName, 'updated_all', 'no') === 'no') {
$q = $c->getServer()->getDatabaseConnection()->getQueryBuilder();
$q->update('*PREFIX*accounts')
->set('backend', $q->expr()->literal(AlternativeHomeUserBackend::class))
->set('backend', $q->createNamedParameter(AlternativeHomeUserBackend::class))
->where($q->expr()->eq('backend', $q->createNamedParameter(\OC\User\Database::class)))
->execute();

Expand Down