I didn't understand what you are proposing.
If i use this if:
Code:
if ( $confirmation == 0 ) {
$user->confirmed = 1;
} else {
$user->confirmed = 0;
}
then its like confirmation == 0 always, because i receive notification e-mail without confirmation link. If i erase this if, or leave as dummy like this:
Code:
if ( $confirmation == 0 ) {
$user->confirmed = 0;
} else {
$user->confirmed = 0;
}
then when i click on verification link (inside the e-mail) i get a wrong verification code message.
I also noticed this:
At the first of registerUser function i write this:
Code:
function registerUser( $fname, $lname, $email, $username, $password, $cb_profiletype, $approve = 0, $confirm = 0 ) {
global $_CB_framework, $_CB_database, $ueConfig, $_PLUGINS;
$approval = ( $approve == 2 ? $ueConfig['reg_admin_approval'] : $approve );
$confirmation = ( $confirm == 2 ? $ueConfig['reg_confirmation'] : $confirm );
$usertype = $_CB_framework->getCfg( 'new_usertype' );
$user = new moscomprofilerUser( $_CB_database );
$user->usertype = ( $usertype ? $usertype : 'Registered' );
$user->gid = $_CB_framework->acl->get_group_id( $user->usertype, 'ARO' );
$user->gids = array( $user->gid );
$user->sendEmail = 0;
$user->registerDate = date( 'Y-m-d H:i:s', $_CB_framework->now() );
$user->name = $fname . ' ' . $lname;
$user->firstname = $fname;
$user->lastname = $lname;
$user->username = $username;
$user->email = $email;
$user->password = $user->hashAndSaltPassword( $password );
$cb_profiletype = "fan-profile";
$user->cb_profiletype = $cb_profiletype;
$user->registeripaddr = cbGetIPlist();
...
...
If i place those 2 lines of coding:
Code:
$cb_profiletype = "fan-profile";
$user->cb_profiletype = $cb_profiletype;
for example after this line:
$user->registeripaddr = cbGetIPlist();
or before this line:
$user->name = $fname . ' ' . $lname;
then i get different responses from Community Builder. (like when i click on confirmation link then i go to a webpage with a message that i haven't got the rights to see the content or i don't receive a confirmation e-mail at all)
So, i don't know if those 2 lines or the position i place them does something in the whole procedure. I actually use those 2 lines in order to put the value: "fan-profile" inside cb_profiletype field during user registration