mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
owncloudcmd: ask for the login and password and put it in the url (if it's not there already)
Because we cannot rely on HTTPCredentials to open windows in a command line tool Fixes #1860
This commit is contained in:
parent
3c89415df1
commit
278bc5a8cd
1 changed files with 16 additions and 1 deletions
|
@ -146,6 +146,21 @@ int main(int argc, char **argv) {
|
|||
|
||||
|
||||
QUrl url(options.target_url.toUtf8());
|
||||
if (url.userName().isEmpty()) {
|
||||
std::cout << "** Please enter the username:" << std::endl;
|
||||
std::string s;
|
||||
std::getline(std::cin, s);
|
||||
url.setUserName(QString::fromStdString(s));
|
||||
}
|
||||
if (url.password().isEmpty()) {
|
||||
std::cout << "** Please enter the password:" << std::endl;
|
||||
std::string s;
|
||||
std::getline(std::cin, s);
|
||||
url.setPassword(QString::fromStdString(s));
|
||||
}
|
||||
|
||||
QUrl originalUrl = url;
|
||||
|
||||
Account account;
|
||||
|
||||
// Find the folder and the original owncloud url
|
||||
|
@ -165,7 +180,7 @@ restart_sync:
|
|||
|
||||
CSYNC *_csync_ctx;
|
||||
if( csync_create( &_csync_ctx, options.source_dir.toUtf8(),
|
||||
options.target_url.toUtf8()) < 0 ) {
|
||||
originalUrl.toEncoded().constData()) < 0 ) {
|
||||
qFatal("Unable to create csync-context!");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue