mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
owncloudcmd: fetch the dav user
This is required to get the new endpoint working when the server uses ldap or that the dav user is not the same as the login. Issue #6830
This commit is contained in:
parent
ec8c02dad0
commit
3e4486c078
1 changed files with 10 additions and 1 deletions
|
@ -466,13 +466,22 @@ int main(int argc, char **argv)
|
||||||
loop.quit();
|
loop.quit();
|
||||||
});
|
});
|
||||||
job->start();
|
job->start();
|
||||||
|
|
||||||
loop.exec();
|
loop.exec();
|
||||||
|
|
||||||
if (job->reply()->error() != QNetworkReply::NoError){
|
if (job->reply()->error() != QNetworkReply::NoError){
|
||||||
std::cout<<"Error connecting to server\n";
|
std::cout<<"Error connecting to server\n";
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
job = new JsonApiJob(account, QLatin1String("ocs/v1.php/cloud/user"));
|
||||||
|
QObject::connect(job, &JsonApiJob::jsonReceived, [&](const QJsonDocument &json) {
|
||||||
|
const QJsonObject data = json.object().value("ocs").toObject().value("data").toObject();
|
||||||
|
account->setDavUser(data.value("id").toString());
|
||||||
|
account->setDavDisplayName(data.value("display-name").toString());
|
||||||
|
loop.quit();
|
||||||
|
});
|
||||||
|
job->start();
|
||||||
|
loop.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
// much lower age than the default since this utility is usually made to be run right after a change in the tests
|
// much lower age than the default since this utility is usually made to be run right after a change in the tests
|
||||||
|
|
Loading…
Reference in a new issue