Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9fb44e3
add propagator batching
icewind1991 May 20, 2016
cc67ad4
use propagator batching in the scanner
icewind1991 May 26, 2016
11900ba
add tests for propagator batching
icewind1991 Jun 2, 2016
fce19d2
fix mtime propagation on sqlite
icewind1991 Jun 2, 2016
1b5368b
Wrap publicwebdav in sharePermission mask
rullzer Jun 6, 2016
7c040c0
Show the path relative to the requesting user
rullzer Jun 7, 2016
2e2ece7
Fix unit tests
rullzer Jun 7, 2016
72c5535
Extend unit tests
rullzer Jun 7, 2016
c5a6c8b
Use array_merge when reading cached groups members
Jun 8, 2016
fbdec59
Extract CLASS property from calendar object and store it in the database
DeepDiver1975 Apr 19, 2016
f013cfc
Add migration step
DeepDiver1975 Apr 19, 2016
287e417
Bump dav app version and fix variable rename
DeepDiver1975 May 31, 2016
369c3b5
Implement classification migration as repair step
DeepDiver1975 May 31, 2016
082f456
Added unit testing for the migration step
DeepDiver1975 May 31, 2016
bfcd1dc
Filter confidential calendar objects in shared calendars
DeepDiver1975 May 31, 2016
cf06b17
Use the correct realm for basic authentication - fixes #23427
DeepDiver1975 Jun 9, 2016
7d51fd0
Add repair step to clean old calendar/contact shares
rullzer Jun 8, 2016
1399e87
DAV now returns file name with Content-Disposition header
Jun 9, 2016
232d735
Do not leak the login name - fixes #25047
DeepDiver1975 Jun 9, 2016
059778b
Add unit test for LDAP multi group caching
Jun 9, 2016
e8a66f8
[tx-robot] updated from transifex
Jun 10, 2016
7b3dc80
Check 2FA state for raw php files too
ChristophWurst Jun 10, 2016
5435455
Merge pull request #25043 from owncloud/webdav-download-mimetype
Jun 10, 2016
6660488
Merge pull request #25048 from owncloud/email-login-leak
Jun 10, 2016
67c3a97
Merge pull request #25046 from owncloud/fix-the-realm
Jun 10, 2016
d81dac2
Merge pull request #25025 from owncloud/clear_old_calendar_shares
Jun 10, 2016
1abe5b0
Merge pull request #25024 from owncloud/ldap-cachedgroupsbymember
Jun 10, 2016
c45b7b0
Allow empty host when installing on oracle via CLI (#25034)
butonic Jun 10, 2016
68c3b23
Merge pull request #24080 from owncloud/support-calendar-class-property
Jun 10, 2016
a0d8702
Merge pull request #25051 from owncloud/2fa-raw-php-files
Jun 10, 2016
1b66db7
Repair job to fix permissions for avatars
rullzer May 30, 2016
6022528
Add not-null columns for oracle
nickvergessen Jun 2, 2016
28d9ad2
Empty string is null on oracle
rullzer Jun 3, 2016
77caa0e
Use capped cache for encryption's user access list
Jun 10, 2016
c668588
map oracle driver options to params (#23938)
butonic Jun 10, 2016
57b999f
Merge pull request #24990 from owncloud/fix_24868
Jun 10, 2016
372213b
Add developer documentation, website and bug to the applist (#25041)
nickvergessen Jun 10, 2016
c14198b
fetchall appconfig entries (#23835)
butonic Jun 10, 2016
ffb2838
Merge pull request #25055 from owncloud/enc-cappedcache-getaccesslist
Jun 10, 2016
14fde66
Merge pull request #25003 from owncloud/fix_ocs_path_response
Jun 10, 2016
21de838
Merge pull request #24898 from owncloud/avatar_repair
Jun 10, 2016
52a0c93
Merge pull request #24863 from owncloud/propagator-batching
Jun 10, 2016
42c66ef
Merge branch 'master' of https://github.com/owncloud/core into downst…
blizzz Jun 11, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion apps/comments/l10n/bg_BG.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
OC.L10N.register(
"comments",
{
"Type in a new comment..." : "Напиши нов коментар...",
"Delete comment" : "Изтрий коментар",
"Cancel" : "Отказ",
"Edit comment" : "Редактирай коментра",
"[Deleted user]" : "[Изтрит потребител]",
"Comments" : "Коментари",
"No other comments available" : "Няма други коментари",
"More comments..." : "Още коментари...",
"Save" : "Запазване",
"Comment" : "Коментар"
"Allowed characters {count} of {max}" : "Позволени символи {count} от {max}",
"{count} unread comments" : "{count} нечетени коментари",
"Comment" : "Коментар",
"<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Коментари</strong> на файлове <em>(винаги изписвани в stream-а)</em>",
"You commented" : "Вие коментирахте"
},
"nplurals=2; plural=(n != 1);");
13 changes: 12 additions & 1 deletion apps/comments/l10n/bg_BG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{ "translations": {
"Type in a new comment..." : "Напиши нов коментар...",
"Delete comment" : "Изтрий коментар",
"Cancel" : "Отказ",
"Edit comment" : "Редактирай коментра",
"[Deleted user]" : "[Изтрит потребител]",
"Comments" : "Коментари",
"No other comments available" : "Няма други коментари",
"More comments..." : "Още коментари...",
"Save" : "Запазване",
"Comment" : "Коментар"
"Allowed characters {count} of {max}" : "Позволени символи {count} от {max}",
"{count} unread comments" : "{count} нечетени коментари",
"Comment" : "Коментар",
"<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Коментари</strong> на файлове <em>(винаги изписвани в stream-а)</em>",
"You commented" : "Вие коментирахте"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
6 changes: 6 additions & 0 deletions apps/dav/appinfo/database.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ CREATE TABLE calendarobjects (
<type>text</type>
<length>255</length>
</field>
<field>
<comments>0 - public, 1 - private, 2 - confidential</comments>
<name>classification</name>
<type>integer</type>
<default>0</default>
</field>
<index>
<name>calobjects_index</name>
<unique>true</unique>
Expand Down
7 changes: 6 additions & 1 deletion apps/dav/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<description>ownCloud WebDAV endpoint</description>
<licence>AGPL</licence>
<author>owncloud.org</author>
<version>0.2.4</version>
<version>0.2.5</version>
<default_enable/>
<types>
<filesystem/>
Expand All @@ -20,4 +20,9 @@
<background-jobs>
<job>OCA\DAV\CardDAV\Sync\SyncJob</job>
</background-jobs>
<repair-steps>
<post-migration>
<job>OCA\DAV\Migration\Classification</job>
</post-migration>
</repair-steps>
</info>
9 changes: 3 additions & 6 deletions apps/dav/appinfo/v1/publicwebdav.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,16 @@

$share = $authBackend->getShare();
$owner = $share->getShareOwner();
$isWritable = $share->getPermissions() & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE);
$isReadable = $share->getPermissions() & \OCP\Constants::PERMISSION_READ;
$fileId = $share->getNodeId();

if (!$isReadable) {
return false;
}

if (!$isWritable) {
\OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {
return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => \OCP\Constants::PERMISSION_READ + \OCP\Constants::PERMISSION_SHARE));
});
}
\OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE));
});

OC_Util::setupFS($owner);
$ownerView = \OC\Files\Filesystem::getView();
Expand Down
10 changes: 10 additions & 0 deletions apps/dav/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@
use OCA\DAV\Connector\Sabre\Principal;
use OCA\DAV\DAV\GroupPrincipalBackend;
use OCA\DAV\HookManager;
use OCA\DAV\Migration\Classification;
use \OCP\AppFramework\App;
use OCP\AppFramework\IAppContainer;
use OCP\Contacts\IManager;
use OCP\IUser;
use Sabre\VObject\Reader;
use Symfony\Component\EventDispatcher\GenericEvent;

class Application extends App {
Expand Down Expand Up @@ -106,6 +108,14 @@ public function __construct (array $urlParams=array()) {
$g
);
});

$container->registerService('OCA\DAV\Migration\Classification', function ($c) {
/** @var IAppContainer $c */
return new Classification(
$c->query('CalDavBackend'),
$c->getServer()->getUserManager()
);
});
}

/**
Expand Down
90 changes: 65 additions & 25 deletions apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet;
use Sabre\DAV;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\PropPatch;
use Sabre\HTTP\URLUtil;
use Sabre\VObject\DateTimeParser;
use Sabre\VObject\Reader;
use Sabre\VObject\RecurrenceIterator;
use Sabre\VObject\Recur\EventIterator;

/**
* Class CalDavBackend
Expand All @@ -61,6 +62,10 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
*/
const MAX_DATE = '2038-01-01';

const CLASSIFICATION_PUBLIC = 0;
const CLASSIFICATION_PRIVATE = 1;
const CLASSIFICATION_CONFIDENTIAL = 2;

/**
* List of CalDAV properties, and how they map to database field names
* Add your own properties by simply adding on to this array.
Expand Down Expand Up @@ -395,10 +400,10 @@ function createCalendar($principalUri, $calendarUri, array $properties) {
*
* Read the PropPatch documentation for more info and examples.
*
* @param \Sabre\DAV\PropPatch $propPatch
* @param PropPatch $propPatch
* @return void
*/
function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) {
function updateCalendar($calendarId, PropPatch $propPatch) {
$supportedProperties = array_keys($this->propertyMap);
$supportedProperties[] = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp';

Expand Down Expand Up @@ -484,7 +489,7 @@ function deleteCalendar($calendarId) {
*/
function getCalendarObjects($calendarId) {
$query = $this->db->getQueryBuilder();
$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'componenttype'])
$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'componenttype', 'classification'])
->from('calendarobjects')
->where($query->expr()->eq('calendarid', $query->createNamedParameter($calendarId)));
$stmt = $query->execute();
Expand All @@ -499,6 +504,7 @@ function getCalendarObjects($calendarId) {
'calendarid' => $row['calendarid'],
'size' => (int)$row['size'],
'component' => strtolower($row['componenttype']),
'classification'=> (int)$row['classification']
];
}

Expand All @@ -524,7 +530,7 @@ function getCalendarObjects($calendarId) {
function getCalendarObject($calendarId, $objectUri) {

$query = $this->db->getQueryBuilder();
$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype'])
$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification'])
->from('calendarobjects')
->where($query->expr()->eq('calendarid', $query->createNamedParameter($calendarId)))
->andWhere($query->expr()->eq('uri', $query->createNamedParameter($objectUri)));
Expand All @@ -542,6 +548,7 @@ function getCalendarObject($calendarId, $objectUri) {
'size' => (int)$row['size'],
'calendardata' => $this->readBlob($row['calendardata']),
'component' => strtolower($row['componenttype']),
'classification'=> (int)$row['classification']
];
}

Expand All @@ -559,7 +566,7 @@ function getCalendarObject($calendarId, $objectUri) {
*/
function getMultipleCalendarObjects($calendarId, array $uris) {
$query = $this->db->getQueryBuilder();
$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype'])
$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification'])
->from('calendarobjects')
->where($query->expr()->eq('calendarid', $query->createNamedParameter($calendarId)))
->andWhere($query->expr()->in('uri', $query->createParameter('uri')))
Expand All @@ -579,6 +586,7 @@ function getMultipleCalendarObjects($calendarId, array $uris) {
'size' => (int)$row['size'],
'calendardata' => $this->readBlob($row['calendardata']),
'component' => strtolower($row['componenttype']),
'classification' => (int)$row['classification']
];

}
Expand Down Expand Up @@ -618,6 +626,7 @@ function createCalendarObject($calendarId, $objectUri, $calendarData) {
'componenttype' => $query->createNamedParameter($extraData['componentType']),
'firstoccurence' => $query->createNamedParameter($extraData['firstOccurence']),
'lastoccurence' => $query->createNamedParameter($extraData['lastOccurence']),
'classification' => $query->createNamedParameter($extraData['classification']),
'uid' => $query->createNamedParameter($extraData['uid']),
])
->execute();
Expand Down Expand Up @@ -657,6 +666,7 @@ function updateCalendarObject($calendarId, $objectUri, $calendarData) {
->set('componenttype', $query->createNamedParameter($extraData['componentType']))
->set('firstoccurence', $query->createNamedParameter($extraData['firstOccurence']))
->set('lastoccurence', $query->createNamedParameter($extraData['lastOccurence']))
->set('classification', $query->createNamedParameter($extraData['classification']))
->set('uid', $query->createNamedParameter($extraData['uid']))
->where($query->expr()->eq('calendarid', $query->createNamedParameter($calendarId)))
->andWhere($query->expr()->eq('uri', $query->createNamedParameter($objectUri)))
Expand All @@ -667,6 +677,23 @@ function updateCalendarObject($calendarId, $objectUri, $calendarData) {
return '"' . $extraData['etag'] . '"';
}

/**
* @param int $calendarObjectId
* @param int $classification
*/
public function setClassification($calendarObjectId, $classification) {
if (!in_array($classification, [
self::CLASSIFICATION_PUBLIC, self::CLASSIFICATION_PRIVATE, self::CLASSIFICATION_CONFIDENTIAL
])) {
throw new \InvalidArgumentException();
}
$query = $this->db->getQueryBuilder();
$query->update('calendarobjects')
->set('classification', $query->createNamedParameter($classification))
->where($query->expr()->eq('id', $query->createNamedParameter($calendarObjectId)))
->execute();
}

/**
* Deletes an existing calendar object.
*
Expand Down Expand Up @@ -1086,10 +1113,10 @@ function createSubscription($principalUri, $uri, array $properties) {
* Read the PropPatch documentation for more info and examples.
*
* @param mixed $subscriptionId
* @param \Sabre\DAV\PropPatch $propPatch
* @param PropPatch $propPatch
* @return void
*/
function updateSubscription($subscriptionId, DAV\PropPatch $propPatch) {
function updateSubscription($subscriptionId, PropPatch $propPatch) {
$supportedProperties = array_keys($this->subscriptionPropertyMap);
$supportedProperties[] = '{http://calendarserver.org/ns/}source';

Expand Down Expand Up @@ -1280,14 +1307,15 @@ protected function addChange($calendarId, $objectUri, $operation) {
* @param string $calendarData
* @return array
*/
protected function getDenormalizedData($calendarData) {
public function getDenormalizedData($calendarData) {

$vObject = Reader::read($calendarData);
$componentType = null;
$component = null;
$firstOccurence = null;
$lastOccurence = null;
$firstOccurrence = null;
$lastOccurrence = null;
$uid = null;
$classification = self::CLASSIFICATION_PUBLIC;
foreach($vObject->getComponents() as $component) {
if ($component->name!=='VTIMEZONE') {
$componentType = $component->name;
Expand All @@ -1299,47 +1327,59 @@ protected function getDenormalizedData($calendarData) {
throw new \Sabre\DAV\Exception\BadRequest('Calendar objects must have a VJOURNAL, VEVENT or VTODO component');
}
if ($componentType === 'VEVENT' && $component->DTSTART) {
$firstOccurence = $component->DTSTART->getDateTime()->getTimeStamp();
$firstOccurrence = $component->DTSTART->getDateTime()->getTimeStamp();
// Finding the last occurrence is a bit harder
if (!isset($component->RRULE)) {
if (isset($component->DTEND)) {
$lastOccurence = $component->DTEND->getDateTime()->getTimeStamp();
$lastOccurrence = $component->DTEND->getDateTime()->getTimeStamp();
} elseif (isset($component->DURATION)) {
$endDate = clone $component->DTSTART->getDateTime();
$endDate->add(DateTimeParser::parse($component->DURATION->getValue()));
$lastOccurence = $endDate->getTimeStamp();
$lastOccurrence = $endDate->getTimeStamp();
} elseif (!$component->DTSTART->hasTime()) {
$endDate = clone $component->DTSTART->getDateTime();
$endDate->modify('+1 day');
$lastOccurence = $endDate->getTimeStamp();
$lastOccurrence = $endDate->getTimeStamp();
} else {
$lastOccurence = $firstOccurence;
$lastOccurrence = $firstOccurrence;
}
} else {
$it = new RecurrenceIterator($vObject, (string)$component->UID);
$it = new EventIterator($vObject, (string)$component->UID);
$maxDate = new \DateTime(self::MAX_DATE);
if ($it->isInfinite()) {
$lastOccurence = $maxDate->getTimeStamp();
$lastOccurrence = $maxDate->getTimeStamp();
} else {
$end = $it->getDtEnd();
while($it->valid() && $end < $maxDate) {
$end = $it->getDtEnd();
$it->next();

}
$lastOccurence = $end->getTimeStamp();
$lastOccurrence = $end->getTimeStamp();
}

}
}

if ($component->CLASS) {
$classification = CalDavBackend::CLASSIFICATION_PRIVATE;
switch ($component->CLASS->getValue()) {
case 'PUBLIC':
$classification = CalDavBackend::CLASSIFICATION_PUBLIC;
break;
case 'CONFIDENTIAL':
$classification = CalDavBackend::CLASSIFICATION_CONFIDENTIAL;
break;
}
}
return [
'etag' => md5($calendarData),
'size' => strlen($calendarData),
'componentType' => $componentType,
'firstOccurence' => is_null($firstOccurence) ? null : max(0, $firstOccurence),
'lastOccurence' => $lastOccurence,
'uid' => $uid,
'etag' => md5($calendarData),
'size' => strlen($calendarData),
'componentType' => $componentType,
'firstOccurence' => is_null($firstOccurrence) ? null : max(0, $firstOccurrence),
'lastOccurence' => $lastOccurrence,
'uid' => $uid,
'classification' => $classification
];

}
Expand Down
Loading