Skip to Content Skip to Menu

[SOLVED] separate registration procedure

  • Ntelos
  • Ntelos
  • OFFLINE
  • Posts: 95
  • Thanks: 4
  • Karma: 0
10 years 11 months ago #235976 by Ntelos
Replied by Ntelos on topic separate registration procedure
Ok, let me attach the registration function that i use in case that helps to find a solution:
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; $cb_profiletype = ",my-profile"; $user->cb_profiletype = $cb_profiletype; $user->email = $email; $user->password = $user->hashAndSaltPassword( $password ); $user->registeripaddr = cbGetIPlist(); if ( $approval == 0 ) { $user->approved = 1; } else { $user->approved = 0; } $user->confirmed = 0; if ( ( $user->confirmed == 1 ) && ( $user->approved == 1 ) ) { $user->block = 0; } else { $user->block = 1; } $_PLUGINS->trigger( 'onBeforeUserRegistration', array( &$user, &$user ) ); if ( $user->store() ) { if ( ( $user->confirmed == 0 ) && ( $confirmation != 0 ) ) { $user->_setActivationCode(); if ( ! $user->store() ) { return false; } } activateUser( $user, 1, 'UserRegistration' ); $_PLUGINS->trigger( 'onAfterUserRegistration', array( &$user, &$user, true ) ); return true; } return false; }

and i call this like this:
Code:
if (isset($_POST['form']['Name']) && isset($_POST['form']['Lastname']) && isset($_POST['form']['email']) && isset($_POST['form']['password'])) { $this->registerUser($_POST['form']['Name'],$_POST['form']['Lastname'],$_POST['form']['email'],$_POST['form']['Name'],$_POST['form']['password'],$_POST['form']['cb_profiletype'],0,0); }

I include the code needed to load CB API externally.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
10 years 11 months ago #235983 by krileon
Replied by krileon on topic separate registration procedure
Compare the confirmation code to the confirmcode stored in _comprofiler database table and see if it matches. Beyond that I've no idea unless something else is setting the confirmation code for whatever reason. The same usage is used in CB Connect and works perfectly fine (see class file and function registerUser).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • Ntelos
  • Ntelos
  • OFFLINE
  • Posts: 95
  • Thanks: 4
  • Karma: 0
10 years 11 months ago #235984 by Ntelos
Replied by Ntelos on topic separate registration procedure
Inside prefix_comprofiler table inside a registered user, all i could find regarding confirmation is a field called "confirmed" and its set to 1. If i click ctrl+f and write confirm its the only field i have

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
10 years 11 months ago #235987 by krileon
Replied by krileon on topic separate registration procedure
Sorry, it should be stored to cbactivation and not confirmcode.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • Ntelos
  • Ntelos
  • OFFLINE
  • Posts: 95
  • Thanks: 4
  • Karma: 0
10 years 11 months ago #236014 by Ntelos
Replied by Ntelos on topic separate registration procedure
Ok, i checked inside prefix_comprofiler table in a registered user and i saw that the cbactivation field is empty (no value)

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
10 years 11 months ago #236037 by krileon
Replied by krileon on topic separate registration procedure
That means $user->_setActivationCode(); isn't being called. Check it's IF statement as it expects $confirmation to be 1 and $user->confirm to be 0. This is so it only fires when confirmation is enabled. Above you're just setting $user->confirmed = 0; and not setting $confirmation. Sense you're always going to have confirmation you can just remove that if statement I guess.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum