Project

General

Profile

Bug #3157 » 3157_rev1.patch

krileon, 07 February 2012 19:34

View differences:

administrator/components/com_comprofiler/plugin.foundation.php
if ( $user === null ) {
$var = '0';
} elseif ( $field && isset( $user->_cbuser ) ) {
$var = $user->getField( $field, null, 'php', 'none', 'profile', 0, true ); // allow accessing all fields in the if
if ( is_array( $var ) ) {
$var = array_shift( $var );
if ( is_array( $var ) ) {
$var = implode( '|*|', $var );
}
} elseif ( isset( $user->_cbuser->$field ) ) {
// fall-back to the record if it exists:
$var = $user->_cbuser->$field;
if ( strtolower( $field ) == 'viewaccesslevel' ) {
$var = implode( '|*|', $user->getAuthorisedViewLevelsIds() );
} else {
$fieldLower = strtolower( $field );
if ( isset( $user->_cbuser->$fieldLower ) ) {
// second fall-back to the record if it exists:
$var = $user->_cbuser->$fieldLower;
$var = $user->getField( $field, null, 'php', 'none', 'profile', 0, true ); // allow accessing all fields in the if
if ( is_array( $var ) ) {
$var = array_shift( $var );
if ( is_array( $var ) ) {
$var = implode( '|*|', $var );
}
} elseif ( isset( $user->_cbuser->$field ) ) {
// fall-back to the record if it exists:
$var = $user->_cbuser->$field;
} else {
$var = null;
$fieldLower = strtolower( $field );
if ( isset( $user->_cbuser->$fieldLower ) ) {
// second fall-back to the record if it exists:
$var = $user->_cbuser->$fieldLower;
} else {
$var = null;
}
}
}
} else {
(3-3/3)