Skip to content
  • Nigel McNie's avatar
    Prevent role changing in groups if the user is the only admin. Add some... · 031a981c
    Nigel McNie authored
    Prevent role changing in groups if the user is the only admin. Add some functions to abstract role changing.
    
    This patch adds:
    
     * group_is_only_admin($group, $user)
     * group_can_change_role($group, $user, $newrole)
     * group_change_role($group, $user, $newrole)
    
    These functions are used on changerole.php, and also on the member listing page to prevent showing the change role link if the user is the only admin in the group.
    
    If the user has no roles that they can change to and changerole.php is visited, it will redirect back to the member listing with an informational message.
    031a981c