# 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. --- components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php +++ components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php @@ -3674,11 +3674,6 @@ $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) ) ) ) { @@ -3686,11 +3681,16 @@ $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 ); } @@ -3718,7 +3718,28 @@ $juser =& JUser::getInstance(); } if ( checkJversion() == 2 ) { - $result = array(); //FIXME //TODO find way for j1.6 \ No newline at end of file + $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 ); + } + } \ No newline at end of file } else { $params =& $juser->getParameters( true ); // $result = $params->render( 'params' );