# 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. --- administrator/components/com_comprofiler/library/cb/cb.acl.php +++ administrator/components/com_comprofiler/library/cb/cb.acl.php @@ -482,7 +482,36 @@ return $gids[$myId]; } + /** + * Prepare top most GID from array of IDs + * + * @param array $gids + * @return int + */ + function getBackwardsCompatibleGid( $gids ) { + $gids = (array) $gids; + + cbArrayToInts( $gids ); + + $mod = $this->mapGroupNamesToValues( 'Manager' ); + $admin = $this->mapGroupNamesToValues( 'Administrator' ); + $super_admin = $this->mapGroupNamesToValues( 'Superadministrator' ); + + if ( in_array( $super_admin, $gids ) ) { + $gid = $super_admin; + } elseif ( in_array( $admin, $gids ) ) { + $gid = $admin; + } elseif ( in_array( $mod, $gids ) ) { + $gid = $mod; + } else { + $gid = ( empty( $gids ) ? null : $gids[( count( $gids ) - 1 )] ); + } + + return $gid; + } + + /** \ No newline at end of file * Remap literal groups (such as in default values) to the hardcoded CMS values * * @param string|array $name of int|string