# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: Joomla root # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. --- administrator/components/com_comprofiler/library/cb/cb.acl.php +++ administrator/components/com_comprofiler/library/cb/cb.acl.php @@ -970,35 +970,38 @@ $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. "; + } } } - } \ No newline at end of file + } \ No newline at end of file } return $msg;