Bug #3310 » 3310-p2.patch
administrator/components/com_comprofiler/library/cb/cb.acl.php | ||
---|---|---|
$this_group = 'Registered';
|
||
$gid = $this->get_group_id( $this_group, 'ARO' );
|
||
|
||
if ( $user_id == $_CB_framework->myId() ) {
|
||
if ( $user_ids == $_CB_framework->myId() ) {
|
||
if ( ! $allow_myself ) {
|
||
$msg .= "You cannot $action Yourself! ";
|
||
$msg .= "You cannot $action Yourself! ";
|
||
}
|
||
} else {
|
||
} else {
|
||
if ( checkJversion() >= 2 ) {
|
||
if ( ! $this->amIaSuperAdmin() ) {
|
||
$userGroups = $this->get_object_groups( $user_ids );
|
||
$myGroups = $this->get_object_groups( $_CB_framework->myId() );
|
||
|
||
$myCBuser = CBuser::getMyInstance();
|
||
$iAmAdmin = ( $myCBuser->authoriseAction( 'core.manage', 'com_users' ) && $myCBuser->authoriseAction( 'core.edit', 'com_users' ) );
|
||
|
||
$exactGids = ! $iAmAdmin;
|
||
$myGids = $this->get_groups_below_me( $_CB_framework->myId(), $exactGids );
|
||
$myGroups = $this->get_object_groups( $_CB_framework->myId() );
|
||
$myGidsTree = $this->get_groups_below_me( $_CB_framework->myId(), true, $exactGids );
|
||
|
||
if ( ( ( array( $gid ) == array_values( $myGroups ) ) && ( ! $iAmAdmin ) )
|
||
|| ( $gid && ( ! in_array( $gid, $myGids ) ) ) ) {
|
||
if ( ( ( array_values( $userGroups ) == array_values( $myGroups ) ) && ( ! $iAmAdmin ) )
|
||
|| ( $user_ids && $userGroups && ( ! array_intersect( $userGroups, $myGidsTree ) ) ) ) {
|
||
$msg .= "You cannot $action a `$this_group`. Only higher-level users have this power. ";
|
||
}
|
||
}
|
||
} else {
|
||
$myGid = $this->get_user_group_id( $_CB_framework->myId() );
|
||
$cms_admins = $this->mapGroupNamesToValues( array( 'Administrator', 'Superadministrator' ) );
|
||
$cms_super_admin = $this->mapGroupNamesToValues( 'Superadministrator' );
|
||
|
||
if ( ( ( $gid == $myGid ) && ! in_array( $myGid, $cms_admins ) ) || ( $gid && ! in_array( $gid, $this->get_group_children_ids( $myGid ) ) ) ) {
|
||
$msg .= "You cannot $action a `$this_group`. Only higher-level users have this power. ";
|
||
$cms_admins = $this->mapGroupNamesToValues( array( 'Administrator', 'Superadministrator' ) );
|
||
$cms_super_admin = $this->mapGroupNamesToValues( 'Superadministrator' );
|
||
|
||
if ( $myGid != $cms_super_admin ) {
|
||
if ( ( ( $gid == $myGid ) && ! in_array( $myGid, $cms_admins ) ) || ( $user_ids && $gid && ! in_array( $gid, $this->get_group_children_ids( $myGid ) ) ) ) {
|
||
$msg .= "You cannot $action a `$this_group`. Only higher-level users have this power. ";
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
return $msg;
|