Project

General

Profile

Bug #2225 » cb.acl.patch

krileon, 24 January 2011 20:49

View differences:

administrator/components/com_comprofiler/library/cb/cb.acl.php
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;
}
/**
* Remap literal groups (such as in default values) to the hardcoded CMS values
*
* @param string|array $name of int|string
(6-6/12)