Skip to content
Closed
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f318ea4
Initial commit of Share API changes
May 6, 2013
43db159
More crazy rewriting
May 24, 2013
64534df
Merge branch 'master' into share
Jun 5, 2013
ede16a4
Merge branch 'master' into share
Jul 2, 2013
76af3ad
Another snapshot of the share changes
Jul 7, 2013
cfd4aa4
Merge branch 'master' into share
Jul 7, 2013
11f81b9
Add check for valid permissions and expiration time for update
Jul 8, 2013
5cbf16f
Correct Alessandro's name in the header
Jul 8, 2013
6c03722
Return instead of break 2
Jul 8, 2013
b747f40
Fix database xml
Jul 8, 2013
2863824
Fix database tests
Jul 8, 2013
28713c6
Change delete query to try to work with other databases
Jul 9, 2013
b7bcf3f
Rename classes to avoid confusion
Jul 9, 2013
e376ec0
Rename files from last commit
Jul 9, 2013
a92b78a
Emit hooks in share backend in scope \OC\Share
Jul 9, 2013
c8c30fb
Add UserWatcher for listening to user delete hook
Jul 10, 2013
b7a5651
Rename test variable for consistency
Jul 10, 2013
718aa51
Merge branch 'master' into share
Jul 10, 2013
ddcdfd9
Make ShareManager extend ForwardingEmitter
Jul 10, 2013
b999037
Add tests for emitting hooks in ShareBackend and fix when update emit…
Jul 10, 2013
24b253d
Fix case in class name
Jul 15, 2013
9967b7b
Add getShareById method to ShareManager
Jul 18, 2013
c835212
Update docs to show that arrays are arrays of Share objects
Jul 18, 2013
ea04c3d
Modify ShareBackend tests to facilitate reuse
Jul 18, 2013
65ac5b7
Make some of the exceptions more verbose
Jul 18, 2013
9e089f4
Remove searchForPotentialShareWiths from ShareManager and ShareBacken…
Jul 22, 2013
0763b70
Merge branch 'master' into share
Jul 24, 2013
f922c66
Fix searchForPotentialShareWiths for user sharetype
Jul 25, 2013
5b346ca
Use group manager class in user share type
Jul 25, 2013
9402d9b
Use group manager class in group share type
Jul 26, 2013
a9d5f3f
Add shareOwner parameter to searchForPotentialShareWiths method to en…
Jul 27, 2013
f30775b
Fix UserWatcher for share backend without user share type
Jul 30, 2013
ffb17f0
Add display name properties and toAPI method to Share object
Jul 30, 2013
5d38ccf
Set display names for Share objects in share types
Jul 30, 2013
0bb874f
Add docs to UserWatcher
Jul 30, 2013
375ccbf
Fix doc in Share test
Jul 30, 2013
28bf7ac
Fix docs for ShareBackend
Jul 31, 2013
55f444b
Fix docs for ShareManager
Jul 31, 2013
f06ac6d
Add ItemTargetMachine class and use it in the share types
Jul 31, 2013
856b152
Fix docs in IShareType
Jul 31, 2013
13a0fde
Add GroupWatcher
Aug 1, 2013
3427159
Fix clear query for other database backends
Aug 2, 2013
1bc7f40
Merge branch 'master' into share
Aug 2, 2013
d40b055
Use actual getters and setters for Share object
Aug 3, 2013
f8df649
Fix link tests
Aug 3, 2013
a4eb979
Add getItemTypePlural method to ShareBackend for the RESTful API
Aug 5, 2013
7fdce9b
Add Share type to parameter for areValidPermissions in ShareBackend
Aug 5, 2013
fda99c4
Use getShareBackends method rather than the field in ShareManager
Aug 5, 2013
aa3c1a0
Change CollectionShareBackend into an interface
Aug 5, 2013
b9ad9ba
Change searchForChildren to searchForParentCollections in ICollection…
Aug 6, 2013
cd1f4bf
Don't pass table name to insertid for Oracle
Aug 7, 2013
7f4fbc5
Add addType method to Share from App Framework
Aug 9, 2013
10c641c
Move temp TokenMachine class outside because the autoloader is having…
Aug 9, 2013
a3aace4
Fix AdvancedShareFactory namespace in share types
Aug 9, 2013
c6be03f
Unset isShareWithUser filter in common share type
Aug 9, 2013
69310fc
Merge branch 'master' into share
Aug 9, 2013
1020cec
Check if method exists for fromParams and fromRow constructors in Share
Aug 19, 2013
b8c2a74
Add updater for old shares
Aug 19, 2013
5a09cf2
Merge branch 'master' into share
Aug 19, 2013
ff2bcec
Emit old sharing hooks
Aug 20, 2013
bd26e0a
Perform update only once
Aug 21, 2013
1321158
Smarter share updater to handle reshares
Aug 22, 2013
40da889
Be more careful with variables in getHookArray
Aug 22, 2013
bd1399f
Fix searchForParents
Aug 22, 2013
9562357
Remove unused variable
Aug 22, 2013
018a64b
Always use search method through Group Manager, fixes #4201
Aug 22, 2013
c1829d2
Merge branch 'master' into share
Aug 27, 2013
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
193 changes: 193 additions & 0 deletions db_structure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,199 @@

</table>

<table>

<name>*dbprefix*shares</name>

<declaration>

<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<length>4</length>
</field>

<field>
<name>share_type_id</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>32</length>
</field>

<field>
<name>share_owner</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>

<field>
<name>share_with</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>64</length>
</field>

<field>
<name>item_type</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>

<field>
<name>item_owner</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>

<field>
<name>item_source</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>64</length>
</field>

<field>
<name>item_target</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>250</length>
</field>

<field>
<name>permissions</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>1</length>
</field>

<field>
<name>share_time</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>4</length>
</field>

<field>
<name>expiration_time</name>
<type>integer</type>
<default></default>
<notnull>false</notnull>
<length>4</length>
</field>

</declaration>

</table>

<table>

<name>*dbprefix*shares_groups</name>

<declaration>

<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>4</length>
</field>

<field>
<name>uid</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>

<field>
<name>item_target</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>250</length>
</field>

</declaration>

</table>

<table>

<name>*dbprefix*shares_links</name>

<declaration>

<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>4</length>
</field>

<field>
<name>token</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>250</length>
</field>

<field>
<name>password</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>250</length>
</field>

</declaration>

</table>

<table>

<name>*dbprefix*shares_parents</name>

<declaration>

<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>4</length>
</field>

<field>
<name>parent_id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>4</length>
</field>

</declaration>

</table>

<table>

<name>*dbprefix*jobs</name>
Expand Down
49 changes: 49 additions & 0 deletions lib/share/advancedsharefactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* ownCloud
*
* @author Michael Gapczynski
* @copyright 2013 Michael Gapczynski [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 library. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OC\Share;

/**
* An alternative to ShareFactory that can reduce the number of queries to create a Share entity
* Setups JOINs in the share queries to retrieve additional properties for the Share entity
* The columns specified in getColumns() will be returned in the $row passed to mapToShare($row)
*/
abstract class AdvancedShareFactory extends ShareFactory {

/**
* Get JOIN(s) to app table(s)
* @return string
*
* Example: JOIN `*PREFIX*table1` ON `*PREFIX*share`.`item_source` = `*PREFIX*table1`.`id`
*
*/
abstract public function getJoins();

/**
* Get app table column(s)
* @return string
*
* Example: `*PREFIX*table1`.`id`, `*PREFIX*table1`.`name`
*
*/
abstract public function getColumns();

}
30 changes: 30 additions & 0 deletions lib/share/exception/invalidexpirationtimeexception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* ownCloud
*
* @author Michael Gapczynski
* @copyright 2013 Michael Gapczynski [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 library. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OC\Share\Exception;

class InvalidExpirationTimeException extends \Exception {

public function __construct($message) {
parent::__construct($message);
}

}
30 changes: 30 additions & 0 deletions lib/share/exception/invaliditemexception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* ownCloud
*
* @author Michael Gapczynski
* @copyright 2013 Michael Gapczynski [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 library. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OC\Share\Exception;

class InvalidItemException extends \Exception {

public function __construct($message) {
parent::__construct($message);
}

}
30 changes: 30 additions & 0 deletions lib/share/exception/invalidpermissionsexception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* ownCloud
*
* @author Michael Gapczynski
* @copyright 2013 Michael Gapczynski [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 library. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OC\Share\Exception;

class InvalidPermissionsException extends \Exception {

public function __construct($message) {
parent::__construct($message);
}

}
30 changes: 30 additions & 0 deletions lib/share/exception/invalidshareexception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* ownCloud
*
* @author Michael Gapczynski
* @copyright 2013 Michael Gapczynski [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 library. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OC\Share\Exception;

class InvalidShareException extends \Exception {

public function __construct($message) {
parent::__construct($message);
}

}
Loading