PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.10.0
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.10.0
2.11.0 2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 All 78 releases
← All changes | app/Models/User.php +15 -1 2.8.02.10.0 View file →
@@ -224,13 +224,26 @@
224 224 return $this->belongsToMany(Course::class, 'fcom_space_user', 'user_id', 'space_id')
225 225 ->withPivot([ 'role', 'created_at' ]);
226 226 }
227 227
228 + /**
229 + * @deprecated 2.8.2 Use notificationPreferences() - preferences no longer live
230 + * in fcom_notification_users.
231 + */
228 232 public function notificationSubscriptions()
229 233 {
230 234 return $this->hasMany(NotificationSubscription::class, 'user_id');
231 235 }
232 236
237 + /**
238 + * Explicit notification preference overrides across every channel.
239 + * Recipient selection for email fan-outs is driven off this relation.
240 + */
241 + public function notificationPreferences()
242 + {
243 + return $this->hasMany(NotificationPreference::class, 'user_id', 'ID');
244 + }
245 +
233 246 public function space_pivot()
234 247 {
235 248 return $this->belongsTo(SpaceUserPivot::class, 'ID', 'user_id')->withoutGlobalScopes();
236 249 }
@@ -550,8 +563,9 @@
550 563 $hasDocuments = defined('FLUENT_COMMUNITY_PRO') && Arr::get($space->settings, 'document_library') == 'yes';
551 564 $hasMediaGallery = defined('FLUENT_COMMUNITY_PRO') && Arr::get($space->settings, 'media_gallery') == 'yes';
552 565
553 566 $isRestrictedPost = Arr::get($space->settings, 'restricted_post_only') == 'yes';
567 + $isVerifiedPostOnly = Arr::get($space->settings, 'verified_post_only') == 'yes';
554 568
555 569 $documentAccess = Arr::get($space->settings, 'document_access');
556 570 $mediaAccess = Arr::get($space->settings, 'media_access');
557 571
@@ -595,9 +609,9 @@
595 609 $permissions['can_view_media'] = false;
596 610 }
597 611 } elseif ($role == 'member' || $role == 'student') {
598 612 $permissions = [
599 - 'can_create_post' => $isRestrictedPost ? false : true,
613 + 'can_create_post' => $isRestrictedPost ? false : (!$isVerifiedPostOnly || $this->isVerified()),
600 614 'registered' => true,
601 615 'can_view_posts' => true,
602 616 'can_view_members' => $space->canViewMembers($this),
603 617 'can_comment' => true,