[Pkg-owncloud-commits] [owncloud-client] 236/484: Added Non Shibboleth WebDAV authentication and Dav Path customization to `owncloudcmd`
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:46 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 8f5658bc0174d867c616c2ecb098b364d9036143
Author: Niels van Adrichem <n.l.m.vanadrichem at tudelft.nl>
Date: Mon Nov 2 22:57:17 2015 +0100
Added Non Shibboleth WebDAV authentication and Dav Path customization to `owncloudcmd`
---
src/cmd/cmd.cpp | 18 ++++++++++++++++++
src/libsync/account.cpp | 9 +++++++++
src/libsync/account.h | 1 +
src/libsync/theme.cpp | 5 +++++
src/libsync/theme.h | 1 +
5 files changed, 34 insertions(+)
diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp
index 11390db..c75335e 100644
--- a/src/cmd/cmd.cpp
+++ b/src/cmd/cmd.cpp
@@ -56,8 +56,10 @@ struct CmdOptions {
bool useNetrc;
bool interactive;
bool ignoreHiddenFiles;
+ bool nonShib;
QString exclude;
QString unsyncedfolders;
+ QString davPath;
};
// we can't use csync_set_userdata because the SyncEngine sets it already.
@@ -155,6 +157,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, -ns Use Non Shibboleth WebDAV authentication" << std::endl;
+ std::cout << " --davpath, -dp [path] Custom themed dav path, overrides --nonshib" << std::endl;
std::cout << " -h Sync hidden files,do not ignore them" << std::endl;
std::cout << " --version, -v Display version and exit" << std::endl;
std::cout << "" << std::endl;
@@ -222,6 +226,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" || option == "-ns") {
+ options->nonShib = true;
+ } else if( (option == "--davpath" || option == "-dp") && !it.peekNext().startsWith("-") ) {
+ options->davPath = it.next();
} else {
help();
}
@@ -268,6 +276,7 @@ int main(int argc, char **argv) {
options.useNetrc = false;
options.interactive = true;
options.ignoreHiddenFiles = true;
+ options.nonShib = false;
ClientProxy clientProxy;
parseOptions( app.arguments(), &options );
@@ -282,6 +291,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());
}
diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp
index 73a6887..6c5450e 100644
--- a/src/libsync/account.cpp
+++ b/src/libsync/account.cpp
@@ -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
diff --git a/src/libsync/account.h b/src/libsync/account.h
index cb706c4..4a4014d 100644
--- a/src/libsync/account.h
+++ b/src/libsync/account.h
@@ -67,6 +67,7 @@ public:
*/
QString davPath() const;
void setDavPath(const QString&s) { _davPath = s; }
+ void setNonShib(bool nonShib);
static AccountPtr create();
~Account();
diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp
index 709d4c3..6fbe05f 100644
--- a/src/libsync/theme.cpp
+++ b/src/libsync/theme.cpp
@@ -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
diff --git a/src/libsync/theme.h b/src/libsync/theme.h
index d306244..7cd6e7b 100644
--- a/src/libsync/theme.h
+++ b/src/libsync/theme.h
@@ -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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list