Project

General

Profile

Bug #2246 » 2246b.patch

krileon, 26 January 2011 16:19

View differences:

components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php
$user->confirmed = cbGetParam( $postdata, 'confirmed', 0 );
}
if ( checkJversion() == 2 ) {
unset( $user->params );
//FIXME //TODO but overriden again later, so do it here: return true; // params is done in the bind()
}
if ( ( $_CB_framework->getUi() == 2 )
|| ( ( isset( $ueConfig['frontend_userparams'] ) ) ? ( $ueConfig['frontend_userparams'] == 1 ) : in_array( $_CB_framework->getCfg( "frontend_userparams" ), array( '1', null) ) ) )
{
......
$params = cbGetParam( $_POST, 'params', null ); //TBD: verify if stripslashes is needed here: it might be needed...leaving as is for now.
if ( $params != null ) {
if ( is_array( $params ) ) {
$txt = array();
if ( checkJversion() == 2 ) {
$registry = new JRegistry( $params );
$value = $registry->toArray();
} else {
$txt = array();
foreach ( $params as $k => $v) {
$txt[] = $k . '=' . $v;
$txt[] = $k . '=' . $v;
}
$value = implode( "\n", $txt );
$value = implode( "\n", $txt );
}
if ( ( (string) $user->params ) !== (string) $value ) {
$this->_logFieldUpdate( $field, $user, $reason, $user->params, $value );
}
......
$juser =& JUser::getInstance();
}
if ( checkJversion() == 2 ) {
$result = array(); //FIXME //TODO find way for j1.6
$result = array();
jimport( 'joomla.form.form' );
JForm::addFormPath( JPATH_ADMINISTRATOR . '/components/com_users/models/forms' );
$form = JForm::getInstance( 'com_users.params', 'user', array( 'load_data' => true ) );
$params = $juser->getParameters( true )->toArray();
if ( $params ) foreach ( $params as $k => $v ) {
$form->setValue( $k, 'params', $v );
}
$fields = $form->getFieldset( 'settings' );
if ( $fields ) foreach ( $fields as $field ) {
$admin_field = ( strpos( $field->name, 'admin' ) || strpos( $field->name, 'help' ) );
if ( ( $admin_field && ( $juser->authorise( 'canManageUsers' ) || ( ! $user->id ) ) ) || ( ! $admin_field ) ) {
$result[] = array( $field->label, $field->input, $field->description, $field->name );
}
}
} else {
$params =& $juser->getParameters( true );
// $result = $params->render( 'params' );
(2-2/2)