Compare commits

...

18 Commits

Author SHA1 Message Date
C Montero-Luque 06ec916b11 8.1.0 2015-07-02 18:20:11 -04:00
Lukas Reschke 7d94d963e9 Merge pull request #17356 from owncloud/stable8.1-apps-keepgloballist
[stable8.1] Fix global app list state
2015-07-02 21:37:41 +02:00
Vincent Petry c051c180ab Fix global app list state 2015-07-02 17:31:22 +02:00
Lukas Reschke 9cba7c1793 Merge pull request #17317 from owncloud/stable81-clean-ocsid
[stable8.1] Delete OCS ID from DB if none is specified
2015-07-02 14:15:27 +02:00
Lukas Reschke 16514762bf Merge pull request #17311 from owncloud/stable81-remove-ocs-ids
[stable8.1] Remove OCS IDs
2015-07-02 14:15:19 +02:00
Björn Schießle caa3210a59 Merge pull request #17308 from owncloud/stable8.1-backport-17293
Stable8.1 backport 17293
2015-07-02 12:17:56 +02:00
Lukas Reschke 8fe5d4b268 Bump versions 2015-07-02 09:20:25 +02:00
Lukas Reschke 85fc84e3d3 Delete OCS ID from DB if none is specified
If no OCS ID is specified in appinfo.xml and an app update is triggered and a OCS ID is stored in the DB we should clean the value.

Ref https://github.com/owncloud/activity/issues/320#issuecomment-117937748
2015-07-02 09:20:21 +02:00
Lukas Reschke 6008bf975d [stable81] Remove OCS IDs
While making the AppStore ready for 8.1 I also deleted some dummy entries which means that these IDs do not resolve anymore. We should remove them to prevent errors such as https://github.com/owncloud/core/issues/17307

Ref https://github.com/owncloud/activity/issues/320#issuecomment-117691867
2015-07-02 08:47:31 +02:00
Jan-Christoph Borchardt 4abec8b5b9 Revert "fix z-index of share-autocomplete"
This reverts commit 4edf388a38.
2015-07-02 08:24:04 +02:00
Jan-Christoph Borchardt d6cbf8be71 Revert "explicitly set z-index on app-content, fix overlap from navigation"
This reverts commit 71e5bc1803.
2015-07-02 08:23:58 +02:00
Thomas Müller d6b24c7bbc Merge pull request #17266 from owncloud/stable8.1-backport-17224
Stable8.1 backport 17224
2015-07-01 16:12:55 +02:00
Morris Jobke c7bc669e00 Merge pull request #17267 from owncloud/stable8.1-backport-17264
Use UTF-8 mode for preg_split and preg_replace
2015-07-01 09:13:48 +02:00
Lukas Reschke 09038697cd Use UTF-8 mode for preg_split and preg_replace
Otherwise a single application with a description containing a non compliant character can break the whole ownCloud appstore. This is for example https://apps.owncloud.com/content/show.php?content=149553

Fixes https://github.com/owncloud/core/issues/17101#issuecomment-117365224
2015-07-01 07:52:40 +02:00
Thomas Müller eb2e8d99cc Avoid namespace clash 2015-07-01 07:48:35 +02:00
Thomas Müller 82493e9789 Fixing content type detection and handle all local printErrorPage calls 2015-07-01 07:48:31 +02:00
Thomas Müller 526a45be18 Adding request specific exception handling - now with WebDAV responses - refs #17192 2015-07-01 07:48:27 +02:00
Thomas Müller 283f8e7e69 Adding exception handling for ServerNotAvailableException - refs #17192 2015-07-01 07:48:23 +02:00
19 changed files with 136 additions and 49 deletions
-1
View File
@@ -19,5 +19,4 @@ Turning the feature off removes shared files and folders on the server for all s
<files>public.php</files>
<webdav>publicwebdav.php</webdav>
</public>
<ocsid>166050</ocsid>
</info>
+1 -1
View File
@@ -1 +1 @@
0.6.1
0.6.2
-1
View File
@@ -18,5 +18,4 @@ To prevent a user from running out of disk space, the ownCloud Deleted files app
<documentation>
<user>user-trashbin</user>
</documentation>
<ocsid>166052</ocsid>
</info>
+1 -1
View File
@@ -1 +1 @@
0.6.2
0.6.3
-1
View File
@@ -18,5 +18,4 @@ In addition to the expiry of versions, ownClouds versions app makes certain n
<user>user-versions</user>
</documentation>
<default_enable/>
<ocsid>166053</ocsid>
</info>
+1 -1
View File
@@ -1 +1 @@
1.0.5
1.0.6
-1
View File
@@ -17,7 +17,6 @@ A user logs into ownCloud with their LDAP or AD credentials, and is granted acce
<documentation>
<admin>admin-ldap</admin>
</documentation>
<ocsid>166061</ocsid>
<dependencies>
<lib>ldap</lib>
</dependencies>
+1 -1
View File
@@ -1 +1 @@
0.6.0
0.6.1
-1
View File
@@ -12,5 +12,4 @@
<types>
<authentication/>
</types>
<ocsid>166062</ocsid>
</info>
+1 -1
View File
@@ -1 +1 @@
1.1.0.1
1.1.0.2
+1 -1
View File
@@ -410,7 +410,6 @@
position: relative;
height: 100%;
overflow-y: auto;
z-index: 100;
}
#app-content-wrapper {
@@ -556,3 +555,4 @@ em {
z-index:500;
padding:16px;
}
-1
View File
@@ -161,7 +161,6 @@ a.showCruds:hover,a.unshare:hover {
max-height:103px;
overflow-y:auto;
overflow-x:hidden;
z-index: 101 !important;
}
.notCreatable {
+5 -2
View File
@@ -1174,6 +1174,8 @@ class OC_App {
$appData = self::getAppInfo($appId);
if (array_key_exists('ocsid', $appData)) {
OC_Appconfig::setValue($appId, 'ocsid', $appData['ocsid']);
} elseif(OC_Appconfig::getValue($appId, 'ocsid', null) !== null) {
OC_Appconfig::deleteKey($appId, 'ocsid');
}
foreach ($appData['remote'] as $name => $path) {
OCP\CONFIG::setAppValue('core', 'remote_' . $name, $appId . '/' . $path);
@@ -1228,17 +1230,18 @@ class OC_App {
// manages line breaks itself
// first of all we split on empty lines
$paragraphs = preg_split("!\n[[:space:]]*\n!m", $data['description']);
$paragraphs = preg_split("!\n[[:space:]]*\n!mu", $data['description']);
$result = [];
foreach ($paragraphs as $value) {
// replace multiple whitespace (tabs, space, newlines) inside a paragraph
// with a single space - also trims whitespace
$result[] = trim(preg_replace('![[:space:]]+!m', ' ', $value));
$result[] = trim(preg_replace('![[:space:]]+!mu', ' ', $value));
}
// join the single paragraphs with a empty line in between
$data['description'] = implode("\n\n", $result);
}
return $data;
+29 -15
View File
@@ -30,7 +30,12 @@
*/
namespace OC\Connector\Sabre;
class Auth extends \Sabre\DAV\Auth\Backend\AbstractBasic {
use Exception;
use Sabre\DAV\Auth\Backend\AbstractBasic;
use Sabre\DAV\Exception\NotAuthenticated;
use Sabre\DAV\Exception\ServiceUnavailable;
class Auth extends AbstractBasic {
const DAV_AUTHENTICATED = 'AUTHENTICATED_TO_DAV_BACKEND';
/**
@@ -69,7 +74,7 @@ class Auth extends \Sabre\DAV\Auth\Backend\AbstractBasic {
} else {
\OC_Util::setUpFS(); //login hooks may need early access to the filesystem
if(\OC_User::login($username, $password)) {
// make sure we use owncloud's internal username here
// make sure we use ownCloud's internal username here
// and not the HTTP auth supplied one, see issue #14048
$ocUser = \OC_User::getUser();
\OC_Util::setUpFS($ocUser);
@@ -99,21 +104,30 @@ class Auth extends \Sabre\DAV\Auth\Backend\AbstractBasic {
}
/**
* 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.
*
* @param \Sabre\DAV\Server $server
* @param $realm
* @return bool
*/
* 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.
*
* @param \Sabre\DAV\Server $server
* @param string $realm
* @return bool
* @throws ServiceUnavailable
*/
public function authenticate(\Sabre\DAV\Server $server, $realm) {
$result = $this->auth($server, $realm);
return $result;
try {
$result = $this->auth($server, $realm);
return $result;
} catch (NotAuthenticated $e) {
throw $e;
} catch (Exception $e) {
$class = get_class($e);
$msg = $e->getMessage();
throw new ServiceUnavailable("$class: $msg");
}
}
/**
+57 -14
View File
@@ -25,22 +25,72 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
use OC\Connector\Sabre\ExceptionLoggerPlugin;
use Sabre\DAV\Exception\ServiceUnavailable;
use Sabre\DAV\Server;
/**
* Class RemoteException
* Dummy exception class to be use locally to identify certain conditions
*/
class RemoteException extends Exception {
}
/**
* @param Exception $e
*/
function handleException(Exception $e) {
$request = \OC::$server->getRequest();
// in case the request content type is text/xml - we assume it's a WebDAV request
$isXmlContentType = strpos($request->getHeader('Content-Type'), 'text/xml');
if ($isXmlContentType === 0) {
// fire up a simple server to properly process the exception
$server = new Server();
$server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->getLogger()));
$server->on('beforeMethod', function () use ($e) {
if ($e instanceof RemoteException) {
switch ($e->getCode()) {
case OC_Response::STATUS_SERVICE_UNAVAILABLE:
throw new ServiceUnavailable($e->getMessage());
case OC_Response::STATUS_NOT_FOUND:
throw new \Sabre\DAV\Exception\NotFound($e->getMessage());
}
}
$class = get_class($e);
$msg = $e->getMessage();
throw new ServiceUnavailable("$class: $msg");
});
$server->exec();
} else {
$statusCode = OC_Response::STATUS_INTERNAL_SERVER_ERROR;
if ($e instanceof \OC\ServiceUnavailableException ) {
$statusCode = OC_Response::STATUS_SERVICE_UNAVAILABLE;
}
\OCP\Util::writeLog('remote', $e->getMessage(), \OCP\Util::FATAL);
if ($e instanceof RemoteException) {
OC_Response::setStatus($e->getCode());
OC_Template::printErrorPage($e->getMessage());
} else {
OC_Response::setStatus($statusCode);
OC_Template::printExceptionErrorPage($e);
}
}
}
try {
require_once 'lib/base.php';
if (\OCP\Util::needUpgrade()) {
// since the behavior of apps or remotes are unpredictable during
// an upgrade, return a 503 directly
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printErrorPage('Service unavailable');
exit;
throw new RemoteException('Service unavailable', OC_Response::STATUS_SERVICE_UNAVAILABLE);
}
$request = \OC::$server->getRequest();
$pathInfo = $request->getPathInfo();
if ($pathInfo === false || $pathInfo === '') {
OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);
exit;
throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND);
}
if (!$pos = strpos($pathInfo, '/', 1)) {
$pos = strlen($pathInfo);
@@ -50,8 +100,7 @@ try {
$file = \OC::$server->getConfig()->getAppValue('core', 'remote_' . $service);
if(is_null($file)) {
OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);
exit;
throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND);
}
// force language as given in the http request
@@ -82,12 +131,6 @@ try {
$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
require_once $file;
} catch (\OC\ServiceUnavailableException $ex) {
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
\OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL);
OC_Template::printExceptionErrorPage($ex);
} catch (Exception $ex) {
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
\OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL);
OC_Template::printExceptionErrorPage($ex);
handleException($ex);
}
+3 -2
View File
@@ -86,11 +86,12 @@ OC.Settings.Apps = OC.Settings.Apps || {
}), {
type:'GET',
success: function (apps) {
var appList = _.map(_.indexBy(apps.apps, 'id'), function(app) {
var appListWithIndex = _.indexBy(apps.apps, 'id');
OC.Settings.Apps.State.apps = appListWithIndex;
var appList = _.map(appListWithIndex, function(app) {
// default values for missing fields
return _.extend({level: 0}, app);
});
OC.Settings.Apps.State.apps = appList;
var source = $("#app-template").html();
var template = Handlebars.compile(source);
+26
View File
@@ -159,6 +159,32 @@ describe('OC.Settings.Apps tests', function() {
var results = getResultsFromDom();
expect(results.length).toEqual(5);
expect(results).toEqual(['alpha', 'delta', 'zork', 'foo', 'nolevel']);
expect(OC.Settings.Apps.State.apps).toEqual({
'foo': {
id: 'foo',
name: 'Foo app',
level: 0
},
'alpha': {
id: 'alpha',
name: 'Alpha app',
level: 300
},
'nolevel': {
id: 'nolevel',
name: 'No level'
},
'zork': {
id: 'zork',
name: 'Some famous adventure game',
level: 200
},
'delta': {
id: 'delta',
name: 'Mathematical symbol',
level: 200
}
});
});
});
+8 -2
View File
@@ -502,6 +502,10 @@ class Test_App extends \Test\TestCase {
['description' => " \t This is a multiline \n test with \n \t some new lines "],
['description' => "This is a multiline test with some new lines"]
],
[
['description' => hex2bin('5065726d657420646520732761757468656e7469666965722064616e732070697769676f20646972656374656d656e74206176656320736573206964656e74696669616e7473206f776e636c6f75642073616e73206c65732072657461706572206574206d657420c3a0206a6f757273206365757820636920656e20636173206465206368616e67656d656e74206465206d6f742064652070617373652e0d0a0d')],
['description' => "Permet de s'authentifier dans piwigo directement avec ses identifiants owncloud sans les retaper et met à jours ceux ci en cas de changement de mot de passe."]
],
[
['not-a-description' => " \t This is a multiline \n test with \n \t some new lines "],
['not-a-description' => " \t This is a multiline \n test with \n \t some new lines "]
@@ -513,9 +517,11 @@ class Test_App extends \Test\TestCase {
* Test app info parser
*
* @dataProvider appDataProvider
* @param array $data
* @param array $expected
*/
public function testParseAppInfo($data, $expected) {
$this->assertEquals($expected, \OC_App::parseAppInfo($data));
public function testParseAppInfo(array $data, array $expected) {
$this->assertSame($expected, \OC_App::parseAppInfo($data));
}
}
+2 -2
View File
@@ -22,10 +22,10 @@
// We only can count up. The 4. digit is only for the internal patchlevel to trigger DB upgrades
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number.
$OC_Version=array(8, 1, 0, 7);
$OC_Version=array(8, 1, 0, 8);
// The human readable string
$OC_VersionString='8.1 RC1';
$OC_VersionString='8.1.0';
// The ownCloud channel
$OC_Channel='git';