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

Opt out of birthday calendar #6884

Merged
merged 9 commits into from
Dec 12, 2017

Conversation

georgehrke
Copy link
Member

@georgehrke georgehrke commented Oct 20, 2017

fixes #3003

This introduces:

  • the ability for an admin to disable birthday calendars for an entire instance
  • the ability for each user individually to disable their birthday calendar

@georgehrke georgehrke added the 2. developing Work in progress label Oct 20, 2017
@georgehrke georgehrke force-pushed the feature/3003/opt_out_of_birthday_calendar branch 3 times, most recently from ee309ca to 96e6509 Compare October 21, 2017 09:44
@georgehrke georgehrke self-assigned this Nov 7, 2017
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
@georgehrke georgehrke force-pushed the feature/3003/opt_out_of_birthday_calendar branch from 96e6509 to 60c8e26 Compare November 10, 2017 22:05
@georgehrke georgehrke added this to the Nextcloud 13 milestone Nov 10, 2017
…lendar

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
… hooks

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
@georgehrke georgehrke force-pushed the feature/3003/opt_out_of_birthday_calendar branch from e5cff20 to 4d3f33c Compare November 11, 2017 01:17
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
@georgehrke georgehrke force-pushed the feature/3003/opt_out_of_birthday_calendar branch from 4d3f33c to 2b51d84 Compare November 11, 2017 15:17
@georgehrke georgehrke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Nov 11, 2017
return [
'routes' => [
['name' => 'birthday_calendar#enable', 'url' => '/enableBirthdayCalendar', 'verb' => 'POST'],
['name' => 'birthday_calendar#disable', 'url' => '/disableBirthdayCalendar', 'verb' => 'POST'],
Copy link
Member

Choose a reason for hiding this comment

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

Use the same route and POST+DELETE?

Copy link
Member

Choose a reason for hiding this comment

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

If using the same route, it would make more sense to send the enable/disable part in the payload and send everything over POST.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, what's the benefit of using POST+DELETE instead of the two routes in this case?

Copy link
Member

Choose a reason for hiding this comment

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

Deleting something with a POST request just doesn't feel right to me, anyway not very important

@nextcloud nextcloud deleted a comment from codecov bot Nov 14, 2017
@MorrisJobke MorrisJobke mentioned this pull request Dec 8, 2017
28 tasks
@MorrisJobke
Copy link
Member

@georgehrke Where can I find the setting for a user? I haven't spotted it yet.

@rullzer @blizzz Please review.

@georgehrke
Copy link
Member Author

@georgehrke Where can I find the setting for a user? I haven't spotted it yet.

There is no real setting for that (in the server).

When a user deletes their birthday calendar, nextcloud will remember not to generate birthday calendars for that user again.

To enable birthday calendar generation again, the user will have to send a special request to their calendar home: <nc:enable-birthday-calendar xmlns:nc="http://nextcloud.com/ns"/>

We will add a button for that in the calendar app.

@rullzer
Copy link
Member

rullzer commented Dec 11, 2017

We will add a button for that in the calendar app.

👍

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

Lets do this!

@MorrisJobke MorrisJobke merged commit d98dea1 into master Dec 12, 2017
@MorrisJobke MorrisJobke deleted the feature/3003/opt_out_of_birthday_calendar branch December 12, 2017 07:29
@aleprovencio
Copy link

@georgehrke
still don't know for sure how issue the command you suggested, is it appended to the calendar url as in https://my.cloud.com/index.php/apps/calendar/<nc:enable-birthday-calendar xmlns:nc="http://nextcloud.com/ns"/> ?

@georgehrke
Copy link
Member Author

No, <nc:enable-birthday-calendar xmlns:nc="http://nextcloud.com/ns"/> is the request body.
The URL is your calendar-home.

We will add a button for this in the calendar app. Users obviously won't have to send these kind of requests on their own.

@aleprovencio
Copy link

aleprovencio commented Feb 15, 2018

FYI, doing that kinda messed up the contact birthday calendar, then I realized it was due to sync problems. I've deleted it again on NC, deleted in all other synced devices e re-enabled again following your method. Finally it works fine, thank you. The button implementation will be very welcome.

@srwareham
Copy link

srwareham commented Feb 16, 2018

@georgehrke or @aleprovencio, might either of you be able to detail exactly how you send the <nc:enable-birthday-calendar xmlns:nc="http://nextcloud.com/ns"/> message before the button is implemented?

Thanks!

Although I'd still be curious what the answer is to the above, I've found the solution using occ from a shell:

sudo -u www-data /usr/bin/php /var/www/nextcloud/console.php occ dav:sync-birthday-calendar $USER_NAME

Where $USER_NAME is the name of the specific to re-add the birthday calendar for. I found elsewhere that this command was recommended without the username argument, but that approach seems to no longer work.

@aleprovencio
Copy link

Nice to know @srwareham. For doing the trick above you have to live edit the page's html, there are plenty of tools for that.

@kesselb
Copy link
Contributor

kesselb commented Aug 16, 2019

sudo -u www-data /usr/bin/php /var/www/nextcloud/console.php occ dav:sync-birthday-calendar $USER_NAME

Where $USER_NAME is the name of the specific to re-add the birthday calendar for. I found elsewhere that this command was recommended without the username argument, but that approach seems to no longer work.

For newer nextcloud versions it might be required to run php occ maintenance:repair afterwards to register the background job for birthday calendar generation again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable birthday contacts calendar generation for user
8 participants