diff --git a/class.groups.plugin.php b/class.groups.plugin.php
index a0aa71d..d362c2b 100644
--- a/class.groups.plugin.php
+++ b/class.groups.plugin.php
@@ -603,13 +603,14 @@ public function discussionModel_beforeRecordAdvancedNotification_handler($sender
if($groupName) {
$headline = sprintf('%s: %s', $groupName, $headline);
}
- $data["HeadlineFormat"] = $headline;
+ $data['HeadlineFormat'] = $headline;
+ $data['ActionText'] = 'Open Discussion';
// Format to Html
$message = Gdn::formatService()->renderQuote($discussion['Body'], $discussion['Format']);
// We just converted it to HTML. Make sure everything downstream knows it.
// Taking this HTML and feeding it into the Rich Format for example, would be invalid.
$data['Format'] = 'Html';
- $data["Story"] =
+ $data['Story'] =
'
You are watching the category "' . $categoryName . '", ' .
'which was updated ' . $dateInserted . ' by ' . $author->Name . ':
' .
'
' .
@@ -657,7 +658,8 @@ public function commentModel_beforeRecordAdvancedNotification($sender, $args){
if($groupName) {
$headline = sprintf('%s: %s', $groupName, $headline);
}
- $data["HeadlineFormat"] = $headline;
+ $data['ActionText'] = 'Open Discussion';
+ $data['HeadlineFormat'] = $headline;
// $data["HeadlineFormat"] = 'The new discussion has been posted in the category ' . $categoryName . '.';
// Format to Html
$discussionStory = condense(Gdn_Format::to($discussion['Body'], $discussion['Format']));
@@ -665,7 +667,7 @@ public function commentModel_beforeRecordAdvancedNotification($sender, $args){
// We just converted it to HTML. Make sure everything downstream knows it.
// Taking this HTML and feeding it into the required format for example, would be invalid.
$data['Format'] = 'Html';
- $data["Story"] =
+ $data['Story'] =
'You are watching the discussion "' . $discussionName . '" in the category "' .$categoryName.'" '.
'which was updated ' . $commentDateInserted . ' by ' . $commentAuthor->Name . ':
' .
'
' .
@@ -696,7 +698,8 @@ private function buildEmailGroupLink($group) {
$groupName = $group->Name;
$groupType = ucfirst(self::UI[$group->Type]['TypeName']);
$color = c('Garden.EmailTemplate.ButtonTextColor');
- return sprintf('%s: %s
', $groupType, anchor($groupName, url(GroupsPlugin::GROUP_ROUTE . $group->GroupID, true), '',
+ $url = $group->ChallengeUrl? url($group->ChallengeUrl, true) : url(GroupsPlugin::GROUP_ROUTE . $group->GroupID, true);
+ return sprintf('%s: %s
', $groupType, anchor($groupName, $url, '',
['rel' => 'noopener noreferrer', 'target' => '_blank', 'style' => 'color:' . $color]));
}
return '';
diff --git a/models/class.groupmodel.php b/models/class.groupmodel.php
index 8303bca..7ef8f1e 100644
--- a/models/class.groupmodel.php
+++ b/models/class.groupmodel.php
@@ -1466,12 +1466,16 @@ public function canLeave($group) {
*
*/
public function canManageMembers($group) {
- if((int)$group->Archived === 1) {
+ if(Gdn::session()->UserID == $group->OwnerID) {
+ return true;
+ }
+
+ if((int)$group->Archived == 1) {
return false;
}
+
$groupRole = self::getGroupRoleFor(Gdn::session()->UserID, $group->GroupID);
- if($groupRole == GroupModel::ROLE_LEADER ||
- Gdn::session()->UserID == $group->OwnerID) {
+ if($groupRole == GroupModel::ROLE_LEADER ) {
return true;
}
return false;
@@ -1486,12 +1490,15 @@ public function canInviteNewMember($group) {
$group = $this->getByGroupID($group);
}
- if((int)$group->Archived === 1) {
+ if(Gdn::session()->UserID == $group->OwnerID) {
+ return true;
+ }
+
+ if((int)$group->Archived == 1) {
return false;
}
$groupRole = self::getGroupRoleFor(Gdn::session()->UserID, $group->GroupID);
if($groupRole === GroupModel::ROLE_LEADER ||
- Gdn::session()->UserID === $group->OwnerID ||
Gdn::session()->checkPermission(GroupsPlugin::GROUPS_EMAIL_INVITATIONS_PERMISSION)) {
return true;
}