Project

General

Profile

2720-pt2.patch

krileon, 14 October 2011 09:59 PM

View differences:

components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php
3615 3615
				$lists['gid']				=	"<input type=\"hidden\" name=\"gid\" value=\"$user->gid\" /><strong>Administrator</strong>";
3616 3616
			} else {
3617 3617
				// ensure user can't add group higher than themselves
3618
				if ( checkJversion() <= 0 ) {
3619
					$my_groups 				=	$_CB_framework->acl->get_object_groups( 'users', $_CB_framework->myId(), 'ARO' );
3620
				} else {
3621
					$aro_id					=	$_CB_framework->acl->get_object_id( 'users', $_CB_framework->myId(), 'ARO' );
3622
					$my_groups 				=	$_CB_framework->acl->get_object_groups( $aro_id, 'ARO' );
3623
				}
3618
				$gtree						=	$_CB_framework->acl->get_groups_below_me();
3624 3619

  
3625
				if ( is_array( $my_groups ) && ( count( $my_groups ) > 0 ) ) {
3626
					$ex_groups				=	$_CB_framework->acl->get_group_children( $my_groups[0], 'ARO', 'RECURSE' );
3627
					if ( $ex_groups === null ) {
3628
						$ex_groups			=	array();		// mambo fix
3629
					}
3630
				} else {
3631
					$ex_groups				=	array();
3632
				}
3633
	
3634
				$gtree						=	$_CB_framework->acl->get_group_children_tree( null, 'USERS', false );
3635
	
3636
				// remove users 'above' me
3637
				$i							=	0;
3638
				while ( $i < count( $gtree ) ) {
3639
					if ( in_array( $gtree[$i]->value, $ex_groups ) ) {
3640
						array_splice( $gtree, $i, 1 );
3641
					} else {
3642
						$i++;
3643
					}
3644
				}
3645

  
3646 3620
				if ( checkJversion() == 2 ) {
3647 3621
					$lists['gid']			=	moscomprofilerHTML::selectList( $gtree, 'gid[]', 'class="inputbox" size="11" multiple="multiple"', 'value', 'text', $user->gids, 2, false );
3648 3622
				} else {