52 Posts
paulbr
11 years ago
0
Topic

The standard group at seblod when a new user registered is 8 (super user).
It would be better if the default comes from the user configuration (Joomla).
For this, the file "plugins / cck_field / jform_usergroups / jform_usergroups.php" must be changed.

In the function onCCK_FieldPrepareForm

change:

    if ( $config['client'] == 'admin' && ! $config['pk'] && !$value ) {
       $value     =   array( 8 );
     } elseif ( $value && is_string( $value ) && strpos( $value, ',' ) !== false ) {
       $value   =   explode( ',', $value );
     }

to:
    if ( $config['client'] == 'admin' && ! $config['pk'] && !$value ) {
       $userconfig = JComponentHelper::getParams('com_users');
       $defaultUserGroup = $userconfig->get('new_usertype', 2);
       $value     =   array( $defaultUserGroup );
     } elseif ( $value && is_string( $value ) && strpos( $value, ',' ) !== false ) {
       $value   =   explode( ',', $value );
     }

Now the default group can be changed using the Joomla user configuration.

Regards
-Paul

Get a Book for SEBLOD