Project

General

Profile

Bug #2225 » cb.core.patch

krileon, 24 January 2011 17:04

View differences:

components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php
$cms_admin = $_CB_framework->acl->mapGroupNamesToValues( 'Superadministrator' );
if ( checkJversion() == 2 ) {
$cms_admin_title = 'Super Users';
$gid_field = 'gid[]';
} else {
$cms_admin_title = 'Super Administrator';
$gid_field = 'gid';
}
$canBlockUser = $_CB_framework->check_acl( 'canBlockUsers', $_CB_framework->myUserType() );
$canEmailEvents = ( ( $user->id == 0 ) && ( in_array( $myGid, array( $cms_mod, $cms_admin ) ) ) )
......
$lists = array();
$user_group = strtolower( $_CB_framework->acl->get_group_name( $user->gid, 'ARO' ) );
if (( $user_group == strtolower( $cms_admin_title ) && $myGid != $cms_admin) || ( $user->id == $_CB_framework->myId() && $myGid == $cms_admin)) {
$lists['gid'] = "<input type=\"hidden\" mosReq=\"0\" name=\"gid\" value=\"$user->gid\" /><strong>$cms_admin_title</strong>";
$lists['gid'] = "<input type=\"hidden\" mosReq=\"0\" name=\"$gid_field\" value=\"$user->gid\" /><strong>$cms_admin_title</strong>";
} else if ( $myGid == $cms_mod && $user->gid == $cms_mod ) {
$lists['gid'] = "<input type=\"hidden\" mosReq=\"0\" name=\"gid\" value=\"$user->gid\" /><strong>Administrator</strong>";
$lists['gid'] = "<input type=\"hidden\" mosReq=\"0\" name=\"$gid_field\" value=\"$user->gid\" /><strong>Administrator</strong>";
} else {
// ensure user can't add group higher than themselves
if ( checkJversion() <= 0 ) {
......
}
}
$lists['gid'] = moscomprofilerHTML::selectList( $gtree, 'gid', 'class="inputbox" size="11" mosReq="0"', 'value', 'text', $user->gid, 2, false );
if ( checkJversion() == 2 ) {
if ( $user->id ) {
$user_groups = array_values( JFactory::getUser( $user->id )->groups );
} else {
$user_groups = $user->gid;
}
$lists['gid'] = moscomprofilerHTML::selectList( $gtree, $gid_field, 'class="inputbox" size="11" mosReq="0" multiple="multiple"', 'value', 'text', $user_groups, 2, false );
} else {
$lists['gid'] = moscomprofilerHTML::selectList( $gtree, $gid_field, 'class="inputbox" size="11" mosReq="0"', 'value', 'text', $user->gid, 2, false );
}
}
// build the html select list
$lists['block'] = moscomprofilerHTML::yesnoSelectList( 'block', 'class="inputbox" size="1"', $user->block );
......
// this is (for now) handled in the core of CB... except params and block/email/approved/confirmed:
if ( $_CB_framework->getUi() == 2 ) {
$user->gid = cbGetParam( $postdata, 'gid', 0 );
$gids = cbGetParam( $postdata, 'gid', 0 );
$user->gid = ( is_array( $gids ) ? end( $gids ) : $gids );
$user->gids = ( is_array( $gids ) ? $gids : array( $gids ) );
$user->block = cbGetParam( $postdata, 'block', 0 );
$user->sendEmail = cbGetParam( $postdata, 'sendEmail', 0 );
$user->approved = cbGetParam( $postdata, 'approved', 0 );
(1-1/12)