gs.group.member.leave.base
¶
Author: | Michael JasonSmith |
---|---|
Contact: | Michael JasonSmith <mpj17@onlinegroups.net> |
Date: | 2015-06-26 |
Organization: | GroupServer.org |
Copyright: | This document is licensed under a Creative Commons Attribution-Share Alike 4.0 International License by OnlineGroups.net. |
The gs.group.member.leave.base
product provides the code
deals with group members leaving GroupServer groups, whether
voluntarily or as the result of an administrator’s action. It
provides a page (Leave page) that allows a member to leave a
group, the email notification that are sent out when a member
leaves a group (Notifications), and the code for handling
the removal of a person from a group (gs.group.member.leave.base API).
Contents:
Leave page¶
The Leave page, leave.html
, is in the groups
context. It is necessary for this page to be outside the
group context, otherwise the former member would get a
Permission Denied after he or she left a secret group.
Rather than simply providing a button that removes the member from the group, the Leave page presents the user a choice for reducing the amount of email. The hypothesis is that members often leave because they get overwhelmed by email. Giving the member the choice of going onto Topics digest or Web only may reduce the numbers leaving.
Notifications¶
Two notifications are provided by this product: you have left
and member has left. Both are sent by the leave_group()
function.
You have left¶
This notification tells the former member that he or she has left. It is sent from the Support email address, which is quite important: if it comes from the group that has been left then it is (highly) likely to be marked as spam.
The notification is provided by
gs-group-member-leave-notification.html
in the group
context.
Member has left¶
This notification is sent to the group administrators telling them that the member has left.
The notification is provided by
gs-group-member-leave-left.html
in the group context.
gs.group.member.leave.base
API¶
The published API for the gs.group.member.leave.base
product consists of the GroupLeaver
class and the
leave_group()
function.
-
class
gs.group.member.leave.base.
GroupLeaver
(groupInfo, userInfo)¶ Handle leaving a group.
Parameters: - groupInfo (
Products.GSGroup.interfaces.IGSGroupInfo
) – The group the member should leave - userInfo (
Products.CustomUserFolder.intefaces.IGSUserInfo
) – The member leaving the group.
-
removeMember
()¶ Remove a member from a group
Returns: A description of what occurred. Return type: str The
GroupLeaver.removeMember()
method removes the member from the group, and clears the positions that they may have had in the group: moderator, group administrator, participation coach, and moderated member.The email settings of the member are left unchanged.
Todo
posting member, and email settings should be cleared?
- groupInfo (
-
gs.group.member.leave.base.
leave_group
(groupInfo, userInfo, request)¶ Utility function to remove someone from a group.
Parameters: - groupInfo (
Products.GSGroup.interfaces.IGSGroupInfo
) – The group the member should leave - userInfo (
Products.CustomUserFolder.intefaces.IGSUserInfo
) – The member leaving the group. - request (
zope.publisher.interfaces.browser.IBrowserRequest
) – The current browser request.
The
leave_group()
function- Removes the member from a group,
- Sends a notification (Notifications) to the member that they have left, and
- Sends a notification to all the administrators that the member has left the group.
- groupInfo (
Example¶
The code is not as sophisticated as the Joining User code. The
GroupLeaver
is instantiated, and the
GroupLeaver.removeMember()
method is called.
leaver = GroupLeaver(self.groupInfo, self.loggedInUser)
leaver.removeMember()
More useful is the leave_group()
utility function, which is
used by the user-interfaces to remove a person from a group and
people that the member has left.
leave_group(self.groupInfo, userInfo, self.request)
Changelog¶
5.1.0 (2016-04-10)¶
- Switching the opening salutation in the notifications from Dear to Hello
- Added internationalisation support
- Following the members-info class to gs.group.member.base
- Handing the corner-case of someone leaving when the group administrator lacks a verified email address
5.0.1 (2015-06-25)¶
- Dealing with odd profiles that are but are not in a group
5.0.0 (2015-06-15)¶
- Renaming the product gs.group.member.leave.base
- Moving the list command and related notifications to gs.group.member.leave.command
- Fixing a link in the Member left notification
4.0.1 (2015-01-30)¶
- Fixing the group-URL and email address in the
mailto:
of the Not a member notification
4.0.0 (2014-09-03)¶
- Adding an HTML form of the You have left notification
- Adding an HTML form of the Member has left notification
- Adding a list command
- Refactor
leave_group
into a function - Further PEP-8 OCD changes.
- Refactor
3.0.3 (2014-07-11)¶
- Following
gs.content.form
togs.content.form.base
3.0.2 (2013-10-09)¶
- Switching to the new
del_group
method of the ucstom user. - Using the correct Home icon.
3.0.1 (2013-08-09)¶
- Updating the license and copyright.
3.0.0 (2013-05-20)¶
- Moving the leave-link to
gs.group.member.info
. - Adding breadcrumbs, and bringing the page up-to-date with the current style.
- Further (PEP-8) code cleanup.
2.0.3 (2012-09-20)¶
- Minor (PEP-8) code cleanup, thanks to Ninja-IDE
2.0.2 (2012-07-12)¶
- Switching the Leave page to be full-page.
2.0.1 (2012-06-22)¶
- Update to the SQL Alchemy
2.0.0 (2012-02-24)¶
- Fixing the auditor, and adding the group leave event
- Tidying the Leave page, and fixing the
__init__
of theLeaver
1.0.4 (2011-05-23)¶
- Updating the Leave page to use the standard message content-provider
- Changing the permissions on the Leave link.
1.0.3 (2010-10-07)¶
- Following the radio button to its new home.
1.0.2 (2010-09-23)¶
- Bug fixes
- New
version.py
- Tweaks to logging and notification
- Moved utility from
gs.group.member.manage
, and it now checks for membership
1.0.1 (2010-08-12)¶
- Minor white-space update.
1.0.0 (2010-07-30)¶
- Created new product for leaving a group
- Moved the group-leaving-auditor from Products.GSGroupMember
Indices and tables¶
Resources¶
- Documentation: http://groupserver.readthedocs.io/projects/gsgroupmemberleavebase/
- Code repository: https://github.com/groupserver/gs.group.member.leave.base/
- Questions and comments to http://groupserver.org/groups/development
- Report bugs at https://redmine.iopen.net/projects/groupserver