# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php +++ components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php @@ -3479,8 +3479,10 @@ $cms_admin = $_CB_framework->acl->mapGroupNamesToValues( 'Superadministrator' ); if ( checkJversion() == 2 ) { $cms_admin_title = 'Super Users'; + $gid_field = 'gid[]'; } else { $cms_admin_title = 'Super Administrator'; + $gid_field = 'gid'; } $canBlockUser = $_CB_framework->check_acl( 'canBlockUsers', $_CB_framework->myUserType() ); $canEmailEvents = ( ( $user->id == 0 ) && ( in_array( $myGid, array( $cms_mod, $cms_admin ) ) ) ) @@ -3489,9 +3491,9 @@ $lists = array(); $user_group = strtolower( $_CB_framework->acl->get_group_name( $user->gid, 'ARO' ) ); if (( $user_group == strtolower( $cms_admin_title ) && $myGid != $cms_admin) || ( $user->id == $_CB_framework->myId() && $myGid == $cms_admin)) { - $lists['gid'] = "gid\" />$cms_admin_title"; + $lists['gid'] = "gid\" />$cms_admin_title"; } else if ( $myGid == $cms_mod && $user->gid == $cms_mod ) { - $lists['gid'] = "gid\" />Administrator"; + $lists['gid'] = "gid\" />Administrator"; } else { // ensure user can't add group higher than themselves if ( checkJversion() <= 0 ) { @@ -3522,9 +3524,19 @@ } } - $lists['gid'] = moscomprofilerHTML::selectList( $gtree, 'gid', 'class="inputbox" size="11" mosReq="0"', 'value', 'text', $user->gid, 2, false ); + if ( checkJversion() == 2 ) { + if ( $user->id ) { + $user_groups = array_values( JFactory::getUser( $user->id )->groups ); + } else { + $user_groups = $user->gid; } + $lists['gid'] = moscomprofilerHTML::selectList( $gtree, $gid_field, 'class="inputbox" size="11" mosReq="0" multiple="multiple"', 'value', 'text', $user_groups, 2, false ); + } else { + $lists['gid'] = moscomprofilerHTML::selectList( $gtree, $gid_field, 'class="inputbox" size="11" mosReq="0"', 'value', 'text', $user->gid, 2, false ); + } + } + // build the html select list $lists['block'] = moscomprofilerHTML::yesnoSelectList( 'block', 'class="inputbox" size="1"', $user->block ); @@ -3657,7 +3669,9 @@ // this is (for now) handled in the core of CB... except params and block/email/approved/confirmed: if ( $_CB_framework->getUi() == 2 ) { - $user->gid = cbGetParam( $postdata, 'gid', 0 ); \ No newline at end of file + $gids = cbGetParam( $postdata, 'gid', 0 ); + $user->gid = ( is_array( $gids ) ? end( $gids ) : $gids ); + $user->gids = ( is_array( $gids ) ? $gids : array( $gids ) ); \ No newline at end of file $user->block = cbGetParam( $postdata, 'block', 0 ); $user->sendEmail = cbGetParam( $postdata, 'sendEmail', 0 ); $user->approved = cbGetParam( $postdata, 'approved', 0 );