diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-07-07 11:29:46 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-07-07 11:29:46 +0200 |
commit | ba16fd0d337fa26114f55086198979d147a298c1 (patch) | |
tree | 39111cec77d17d5eeb60bd1b609e7a8419310459 /build | |
parent | 5ace43f43895cba4b398367e10731f92450d7da2 (diff) | |
parent | ed28885d73181e61c06802639910014e8a265e42 (diff) | |
download | nextcloud-server-ba16fd0d337fa26114f55086198979d147a298c1.tar.gz nextcloud-server-ba16fd0d337fa26114f55086198979d147a298c1.zip |
Merge branch 'master' into sync-master
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 18 | ||||
-rw-r--r-- | build/integration/features/provisioning-v1.feature | 2 | ||||
-rw-r--r-- | build/integration/features/webdav-related.feature | 29 | ||||
-rwxr-xr-x | build/integration/run.sh | 11 | ||||
-rw-r--r-- | build/license.php | 66 | ||||
-rw-r--r-- | build/package.json | 2 |
6 files changed, 117 insertions, 11 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 0abb8667739..23f80c2fa76 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -42,6 +42,7 @@ trait WebDav { $request->setBody($body); } + return $client->send($request); } @@ -71,6 +72,23 @@ trait WebDav { } /** + * @When /^User "([^"]*)" copies file "([^"]*)" to "([^"]*)"$/ + * @param string $user + * @param string $fileSource + * @param string $fileDestination + */ + public function userCopiesFileTo($user, $fileSource, $fileDestination) { + $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath; + $headers['Destination'] = $fullUrl . $fileDestination; + try { + $this->response = $this->makeDavRequest($user, 'COPY', $fileSource, $headers); + } catch (\GuzzleHttp\Exception\ClientException $e) { + // 4xx and 5xx responses cause an exception + $this->response = $e->getResponse(); + } + } + + /** * @When /^Downloading file "([^"]*)" with range "([^"]*)"$/ * @param string $fileSource * @param string $range diff --git a/build/integration/features/provisioning-v1.feature b/build/integration/features/provisioning-v1.feature index d44903c2743..135c67dc3a6 100644 --- a/build/integration/features/provisioning-v1.feature +++ b/build/integration/features/provisioning-v1.feature @@ -282,6 +282,7 @@ Feature: provisioning Then the OCS status code should be "100" And the HTTP status code should be "200" And apps returned are + | admin_audit | | comments | | dav | | federatedfilesharing | @@ -292,6 +293,7 @@ Feature: provisioning | files_versions | | provisioning_api | | systemtags | + | theming | | updatenotification | Scenario: get app info diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature index 06df280ea64..a135f077f71 100644 --- a/build/integration/features/webdav-related.feature +++ b/build/integration/features/webdav-related.feature @@ -257,3 +257,32 @@ Feature: webdav-related When Downloading file "/welcome.txt" as "userToBeDisabled" Then the HTTP status code should be "503" + Scenario: Copying files into a folder with edit permissions + Given using dav path "remote.php/webdav" + And user "user0" exists + And user "user1" exists + And As an "user1" + And user "user1" created a folder "/testcopypermissionsAllowed" + And as "user1" creating a share with + | path | testcopypermissionsAllowed | + | shareType | 0 | + | permissions | 31 | + | shareWith | user0 | + And User "user0" uploads file with content "copytest" to "/copytest.txt" + When User "user0" copies file "/copytest.txt" to "/testcopypermissionsAllowed/copytest.txt" + Then the HTTP status code should be "201" + + Scenario: Copying files into a folder without edit permissions + Given using dav path "remote.php/webdav" + And user "user0" exists + And user "user1" exists + And As an "user1" + And user "user1" created a folder "/testcopypermissionsNotAllowed" + And as "user1" creating a share with + | path | testcopypermissionsNotAllowed | + | shareType | 0 | + | permissions | 1 | + | shareWith | user0 | + And User "user0" uploads file with content "copytest" to "/copytest.txt" + When User "user0" copies file "/copytest.txt" to "/testcopypermissionsNotAllowed/copytest.txt" + Then the HTTP status code should be "403" diff --git a/build/integration/run.sh b/build/integration/run.sh index 5a222bda3e3..2abceaa1fad 100755 --- a/build/integration/run.sh +++ b/build/integration/run.sh @@ -1,5 +1,14 @@ #!/usr/bin/env bash +COMPOSER=$(which composer) + +if [ -x "$COMPOSER" ]; then + echo "Using composer executable $COMPOSER" +else + echo "Could not find composer executable" >&2 + exit 1 +fi + composer install SCENARIO_TO_RUN=$1 @@ -31,7 +40,7 @@ kill $PHPPID kill $PHPPID_FED if [ -z $HIDE_OC_LOGS ]; then - tail "../../data/owncloud.log" + tail "../../data/nextcloud.log" fi exit $RESULT diff --git a/build/license.php b/build/license.php index 493c7dafd98..bed3854925f 100644 --- a/build/license.php +++ b/build/license.php @@ -29,6 +29,27 @@ class Licenses /** @AUTHORS@ * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +EOD; + $this->licenseTextLegacy = <<<EOD +/** +@AUTHORS@ + * * @copyright Copyright (c) @YEAR@, ownCloud, Inc. * @license AGPL-3.0 * @@ -46,7 +67,7 @@ class Licenses * */ EOD; - $this->licenseText = str_replace('@YEAR@', date("Y"), $this->licenseText); + $this->licenseTextLegacy = str_replace('@YEAR@', date("Y"), $this->licenseTextLegacy); } /** @@ -118,10 +139,15 @@ With help from many libraries and frameworks including: echo "MIT licensed file: $path" . PHP_EOL; return; } - $source = $this->eatOldLicense($source); - $authors = $this->getAuthors($path, $gitRoot); - $license = str_replace('@AUTHORS@', $authors, $this->licenseText); + if ($this->isOwnCloudLicensed($source)) { + $authors = $this->getAuthors($path, $gitRoot, true); + $license = str_replace('@AUTHORS@', $authors, $this->licenseTextLegacy); + } else { + $authors = $this->getAuthors($path, $gitRoot); + $license = str_replace('@AUTHORS@', $authors, $this->licenseText); + } + $source = $this->eatOldLicense($source); $source = "<?php" . PHP_EOL . $license . PHP_EOL . $source; file_put_contents($path,$source); echo "License updated: $path" . PHP_EOL; @@ -143,6 +169,19 @@ With help from many libraries and frameworks including: return false; } + private function isOwnCloudLicensed($source) { + $lines = explode(PHP_EOL, $source); + while(!empty($lines)) { + $line = $lines[0]; + array_shift($lines); + if (strpos($line, 'ownCloud, Inc') !== false) { + return true; + } + } + + return false; + } + /** * @param string $source * @return string @@ -177,7 +216,7 @@ With help from many libraries and frameworks including: return implode(PHP_EOL, $lines); } - private function getAuthors($file, $gitRoot) { + private function getAuthors($file, $gitRoot, $legacyFiles = false) { // only add authors that changed code and not the license header $licenseHeaderEndsAtLine = trim(shell_exec("grep -n '*/' $file | head -n 1 | cut -d ':' -f 1")); $buildDir = getcwd(); @@ -205,10 +244,19 @@ With help from many libraries and frameworks including: $authors = array_unique($authors); } - $authors = array_map(function($author){ - $this->authors[$author] = $author; - return " * @author $author"; - }, $authors); + if ($legacyFiles) { + $authors = array_map(function($author){ + $this->authors[$author] = $author; + return " * @author $author"; + }, $authors); + } else { + $authors = array_map(function($author){ + $this->authors[$author] = $author; + return " * @copyright Copyright (c) " . date("Y") . ", $author"; + }, $authors); + } + + return implode(PHP_EOL, $authors); } diff --git a/build/package.json b/build/package.json index f5a637171ed..df26ba97785 100644 --- a/build/package.json +++ b/build/package.json @@ -16,7 +16,7 @@ "karma-junit-reporter": "*", "karma-coverage": "*", "karma-phantomjs-launcher": "*", - "phantomjs": "*", + "phantomjs-prebuilt": "*", "jasmine-core": "~2.3.4" }, "engine": "node >= 0.8" |