Skip to Content Skip to Menu

[SOLVED] PHP Code Trigger is Causing Plain Text Password

10 years 7 months ago - 10 years 6 months ago #242399 by prestoproducts
Here is the trigger I have found that is causing the issue:
Code:
$fname = rawurlencode('[firstname]'); $lname = rawurlencode('[lastname]'); $address1 = rawurlencode('[cb_addressline1]'); $address2 = rawurlencode('[cb_addressline2]'); $city = rawurlencode('[cb_city]'); $state = rawurlencode('[cb_state]'); $zipcode = rawurlencode('[cb_zip]'); $altmember_id = '[user_id]'; $enroll_date = rawurlencode(date('m/d/Y')); $offer_code = rawurlencode('[cb_enteryourpromocodeifyouhaveone]'); $lati = '-41.0292'; $longi = '0.00'; $emailaddress = rawurlencode('[email]'); $phone = rawurlencode('[cb_primaryphone]'); $altphone = rawurlencode('[cb_secondaryphone]'); $zip4 = rawurlencode('[cb_zip4]'); $curl = curl_init(); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curl, CURLOPT_TIMEOUT, 30); curl_setopt($curl, CURLOPT_URL, 'https://mysite.com/script.php?type=ENROLL&website_id=TEST&fname='.$fname.'&mname&lname='.$lname.'&address1='.$address1.'&address2='.$address2.'&city='.$city.'&state='.$state.'&zipcode='.$zipcode.'&zip4='.$zip4.'&altmember_id='.$altmember_id.'&enroll_date='.$enroll_date.'&last_profile_update='.$last_profile_update.'&offer_code='.$offer_code.'&account_mask&lati='.$lati.'&longi='.$longi.'&emailaddress='.$emailaddress.'&phone='.$phone.'&altphone='.$altphone.''); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $Response = curl_exec($curl); curl_close($curl); $user = cbUser::getUserDataInstance( '[user_id]' ); $user->set( 'cb_rdcno', $Response ); $user->store();


Ultimately it enrolls the user in the master database and then sends the response to the cb_rdcno field. When I disable the trigger I see the password is hashed. The only trigger I am using is:

onAfterUserRegistration

method: PHP(create_function)
silent return.

Any idea why the password is getting changed when I am storing the user value?
Last edit: 10 years 6 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 7 months ago #242407 by krileon
Set password to null and it should work fine. Null values are ignored. Example as follows.

$user->set( 'password', null );


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.
The following user(s) said Thank You: prestoproducts

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

10 years 6 months ago #243602 by prestoproducts
Replied by prestoproducts on topic PHP Code Trigger is Causing Plain Text Password
Thanks that fixed it :)

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

Moderators: beatnantkrileon
Powered by Kunena Forum