diff options
-rw-r--r-- | build/build.xml | 4 | ||||
-rw-r--r-- | lib/connector/sabre/auth.php | 21 |
2 files changed, 21 insertions, 4 deletions
diff --git a/build/build.xml b/build/build.xml index 3df77ad024e..0f9d3605da1 100644 --- a/build/build.xml +++ b/build/build.xml @@ -69,8 +69,6 @@ jQuery,$$,OC,$,oc_webroot,oc_appswebroots,oc_current_user,t,Files,FileList,FileA <arg value="--log-csv" /> <arg value="${basedir}/build/logs/phploc.csv" /> <arg path="${basedir}" /> - <arg value="--exclude" /> - <arg value="${basedir}/3rdparty/" /> </exec> </target> @@ -172,8 +170,6 @@ jQuery,$$,OC,$,oc_webroot,oc_appswebroots,oc_current_user,t,Files,FileList,FileA <arg path="${basedir}" /> <arg value="--output" /> <arg path="${basedir}/build/code-browser" /> - <arg value="--exclude" /> - <arg value="${basedir}/3rdparty/" /> </exec> </target> </project> diff --git a/lib/connector/sabre/auth.php b/lib/connector/sabre/auth.php index 6990d928cff..bf3a49593cb 100644 --- a/lib/connector/sabre/auth.php +++ b/lib/connector/sabre/auth.php @@ -60,4 +60,25 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic { } return $user; } + + /** + * Override function here. We want to cache authentication cookies + * in the syncing client to avoid HTTP-401 roundtrips. + * If the sync client supplies the cookies, then OC_User::isLoggedIn() + * will return true and we can see this WebDAV request as already authenticated, + * even if there are no HTTP Basic Auth headers. + * In other case, just fallback to the parent implementation. + * + * @return bool + */ + public function authenticate(Sabre_DAV_Server $server, $realm) { + if (OC_User::isLoggedIn()) { + $user = OC_User::getUser(); + OC_Util::setupFS($user); + $this->currentUser = $user; + return true; + } + + return parent::authenticate($server, $realm); + } } |