Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to directly set the expireDate on a new (link)share #18651

Merged
merged 2 commits into from
Aug 30, 2015

Conversation

rullzer
Copy link
Contributor

@rullzer rullzer commented Aug 29, 2015

As requested by @PVince81 in #14808 and again in #18631 (comment) ;)

Now it is possible to directly set the expiration date on shares.

TODO:

  • Update documentations

Since this extends the API we now properly parse the date. We only
accept valid ISO 8601 Dates (YYYY-MM-DD).

Currently this only works for link shares (it is just ignored for other
shares). Since we do not have user/group/federated expiring shares yet.

* Tests added
@rullzer rullzer added this to the 8.2-current milestone Aug 29, 2015
@ghost
Copy link

ghost commented Aug 29, 2015

🚀 Test PASSed.🚀
chuck

@karlitschek
Copy link
Contributor

sweeet 👍

*/
private static function parseDate($expireDate) {
if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $expireDate) === 0) {
throw new \Exception();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add exception message "Invalid date" ?

@PVince81
Copy link
Contributor

Works 👍, tested with this pyocclient branch: owncloud/pyocclient#120

@PVince81
Copy link
Contributor

@rullzer can you fix the comments/strings, then feel free to merge

@SergioBertolinSG
Copy link
Contributor

👍 It is working fine.

* Added more intergration tests
@rullzer rullzer force-pushed the ocs_share_create_with_expire branch from 21b996e to 2aff11c Compare August 30, 2015 08:32
@scrutinizer-notifier
Copy link

A new inspection was created.

@ghost
Copy link

ghost commented Aug 30, 2015

🚀 Test PASSed.🚀
chuck

@PVince81
Copy link
Contributor

Raised doc ticket here: owncloud-archive/documentation#1615

PVince81 pushed a commit that referenced this pull request Aug 30, 2015
Allow to directly set the expireDate on a new (link)share
@PVince81 PVince81 merged commit 045f8cc into master Aug 30, 2015
@PVince81 PVince81 deleted the ocs_share_create_with_expire branch August 30, 2015 08:50
@PVince81
Copy link
Contributor

Now I wonder whether we should backport this.

Anyway, API consumers (like pyocclient) will have to work with older OC servers that don't have this API implemented.

@rullzer
Copy link
Contributor Author

rullzer commented Aug 30, 2015

@PVince81 yeah not trivial. But clients will need to handle it properly anyway.

Since if sopmebody is still on 8.0.3 is should also work. So I do not think this has to be backported. Clients can check on version number. So that is probably simpler.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants