Skip to content

Commit

Permalink
Allow staff members to create courses.
Browse files Browse the repository at this point in the history
See #3444.
  • Loading branch information
boonebgorges committed Oct 2, 2024
1 parent 12be585 commit affb0d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions wp-content/themes/openlab/buddypress/groups/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

<?php
// re-direct to courses page if user does not have permissions for course creation page
$account_type = openlab_get_user_member_type( get_current_user_id() );
$member_type = cboxol_get_user_member_type( bp_loggedin_user_id() );
$group_type = isset($_GET['type']) ? $_GET['type'] : 'club';
if ('course' === $group_type && !is_super_admin() && $account_type !== "faculty") {
wp_redirect(home_url('courses'));
if ( 'course' === $group_type && ! is_super_admin() && ( ! $member_type || ! $member_type->get_can_create_courses() ) ) {
wp_redirect( home_url( 'courses' ) );
}

global $bp;
Expand Down
4 changes: 2 additions & 2 deletions wp-content/themes/openlab/group-archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
$create_link = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/group-details/?type=' . $group_type . '&new=true';

if ( $group_type === 'course' ) {
$user_type = openlab_get_user_member_type( bp_loggedin_user_id() );
$can_create = ( is_super_admin() || 'faculty' === $user_type );
$member_type = cboxol_get_user_member_type( bp_loggedin_user_id() );
$can_create = ( is_super_admin() || $member_type->get_can_create_courses() );
} elseif ( $group_type === 'portfolio' ) {
$can_create = false;
}
Expand Down

0 comments on commit affb0d1

Please sign in to comment.