mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 04:55:48 +03:00
Merge git://github.com/NvanAdrichem/client into 2.1, pull #4060
This commit is contained in:
commit
8abaf92083
7 changed files with 46 additions and 0 deletions
|
@ -50,6 +50,12 @@ OPTIONS
|
|||
``--httpproxy http://[user@pass:]<server>:<port>``
|
||||
Uses ``server`` as HTTP proxy.
|
||||
|
||||
``--nonshib``
|
||||
Uses Non Shibboleth WebDAV Authentication
|
||||
|
||||
``--davpath [path]``
|
||||
Overrides the WebDAV Path with ``path``
|
||||
|
||||
Example
|
||||
=======
|
||||
To synchronize the ownCloud directory ``Music`` to the local directory ``media/music``
|
||||
|
|
|
@ -42,6 +42,12 @@ Other command line switches supported by ``owncloudcmd`` include the following:
|
|||
``--unsyncedfolders [file]``
|
||||
File containing list of folders to not sync
|
||||
|
||||
``--nonshib``
|
||||
Uses Non Shibboleth WebDAV Authentication
|
||||
|
||||
``--davpath [path]``
|
||||
Overrides the WebDAV Path with ``path``
|
||||
|
||||
Credential Handling
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -56,8 +56,10 @@ struct CmdOptions {
|
|||
bool useNetrc;
|
||||
bool interactive;
|
||||
bool ignoreHiddenFiles;
|
||||
bool nonShib;
|
||||
QString exclude;
|
||||
QString unsyncedfolders;
|
||||
QString davPath;
|
||||
int restartTimes;
|
||||
};
|
||||
|
||||
|
@ -156,6 +158,8 @@ void help()
|
|||
std::cout << " --password, -p [pass] Use [pass] as password" << std::endl;
|
||||
std::cout << " -n Use netrc (5) for login" << std::endl;
|
||||
std::cout << " --non-interactive Do not block execution with interaction" << std::endl;
|
||||
std::cout << " --nonshib Use Non Shibboleth WebDAV authentication" << std::endl;
|
||||
std::cout << " --davpath [path] Custom themed dav path, overrides --nonshib" << std::endl;
|
||||
std::cout << " --max-sync-retries [n] Retries maximum n times (default to 3)" << std::endl;
|
||||
std::cout << " -h Sync hidden files,do not ignore them" << std::endl;
|
||||
std::cout << " --version, -v Display version and exit" << std::endl;
|
||||
|
@ -224,6 +228,10 @@ void parseOptions( const QStringList& app_args, CmdOptions *options )
|
|||
options->exclude = it.next();
|
||||
} else if( option == "--unsyncedfolders" && !it.peekNext().startsWith("-") ) {
|
||||
options->unsyncedfolders = it.next();
|
||||
} else if( option == "--nonshib" ) {
|
||||
options->nonShib = true;
|
||||
} else if( option == "--davpath" && !it.peekNext().startsWith("-") ) {
|
||||
options->davPath = it.next();
|
||||
} else if( option == "--max-sync-retries" && !it.peekNext().startsWith("-") ) {
|
||||
options->restartTimes = it.next().toInt();
|
||||
} else {
|
||||
|
@ -272,6 +280,7 @@ int main(int argc, char **argv) {
|
|||
options.useNetrc = false;
|
||||
options.interactive = true;
|
||||
options.ignoreHiddenFiles = true;
|
||||
options.nonShib = false;
|
||||
options.restartTimes = 3;
|
||||
ClientProxy clientProxy;
|
||||
|
||||
|
@ -287,6 +296,15 @@ int main(int argc, char **argv) {
|
|||
if(!options.target_url.endsWith("/")) {
|
||||
options.target_url.append("/");
|
||||
}
|
||||
|
||||
if( options.nonShib ) {
|
||||
account->setNonShib(true);
|
||||
}
|
||||
|
||||
if(!options.davPath.isEmpty()) {
|
||||
account->setDavPath( options.davPath );
|
||||
}
|
||||
|
||||
if( !options.target_url.contains( account->davPath() )) {
|
||||
options.target_url.append(account->davPath());
|
||||
}
|
||||
|
|
|
@ -497,6 +497,15 @@ bool Account::rootEtagChangesNotOnlySubFolderEtags()
|
|||
return (serverVersionInt() >= 0x080100);
|
||||
}
|
||||
|
||||
void Account::setNonShib(bool nonShib)
|
||||
{
|
||||
if( nonShib ) {
|
||||
_davPath = Theme::instance()->webDavPathNonShib();
|
||||
} else {
|
||||
_davPath = Theme::instance()->webDavPath();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace OCC
|
||||
|
|
|
@ -67,6 +67,7 @@ public:
|
|||
*/
|
||||
QString davPath() const;
|
||||
void setDavPath(const QString&s) { _davPath = s; }
|
||||
void setNonShib(bool nonShib);
|
||||
|
||||
static AccountPtr create();
|
||||
~Account();
|
||||
|
|
|
@ -412,5 +412,10 @@ QString Theme::webDavPath() const
|
|||
return QLatin1String("remote.php/webdav/");
|
||||
}
|
||||
|
||||
QString Theme::webDavPathNonShib() const
|
||||
{
|
||||
return QLatin1String("remote.php/nonshib-webdav/");
|
||||
}
|
||||
|
||||
} // end namespace client
|
||||
|
||||
|
|
|
@ -227,6 +227,7 @@ public:
|
|||
* it has a trailing slash, for example "remote.php/webdav/".
|
||||
*/
|
||||
virtual QString webDavPath() const;
|
||||
virtual QString webDavPathNonShib() const;
|
||||
|
||||
protected:
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
|
|
Loading…
Reference in a new issue