Skip to Content Skip to Menu

Send encrypted password to external database

12 years 4 months ago #203312 by sciencefiction
Send encrypted password to external database was created by sciencefiction
Hi

I am testing external queries using cb auto actions that insert newly registered users into external databases. I can sucessfully insert values into the external #_users, #_comprofiler and #_user_usergroup_map tables using the following mysql (mysql for each table has appropriate alterations obviously):

INSERT INTO `****.`*****` (
`id` ,
`name` ,
`username` ,
`email` ,
`password` ,
`usertype` ,
`block` ,
`sendEmail` ,
`registerDate` ,
`lastvisitDate` ,
`activation` ,
`params`
)
VALUES (
NULL , '[name]', '[username]', '

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
12 years 4 months ago #203335 by krileon
Password is encrypted with PHP, you can't do this strictly through MYSQL. You should use a Code action with PHP as its method to register a user using the below API.

www.allmysocials.com/directory/tutorials/item/237-create-users-through-api


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.

12 years 4 months ago #203411 by sciencefiction
Replied by sciencefiction on topic Re: Send encrypted password to external database
Ok thanks. Any tips on how I can go about doing this? I'm not well versed with this stuff. To recap: When a user registers on one site A I need the same user to be registered on site B automatically.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
12 years 4 months ago - 12 years 4 months ago #203431 by krileon
That's a bit different. I believe you'll need to point $_CB_database to your second site using the below.
Code:
if ( is_callable( array( 'JDatabase', 'getInstance' ) ) ) { $driver = $_CB_framework->getCfg( 'dbtype' ); $options = array ( 'driver' => $driver, 'host' => $host, 'user' => $username, 'password' => $password, 'database' => $database, 'prefix' => $prefix ); $_J_database =& JDatabase::getInstance( $options ); if ( JError::isError( $_J_database ) ) { return; } } else { $_J_database = new Database( $host, $username, $password, $database, $prefix, false ); } $_SQL_database = new cbDatabase( $_J_database );

After the above you'd do the registration and instead of using $_CB_database you'd use $_SQL_database.

Sorry, there is no tutorials or assistance with custom development. You'll simply have to keep working with it until you've understood the API and got it working.


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.
Last edit: 12 years 4 months ago by krileon.

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

12 years 3 months ago #204025 by sciencefiction
Replied by sciencefiction on topic Re: Send encrypted password to external database
Thanks, I'll look into that for potential future use. For the time being I solved the issue by using:[cb:userdata field="password" /]

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
12 years 3 months ago #204058 by krileon
Note [password] is plaintext after registration and after login. It has not been encrypted yet. Ensure you're using the appropriate trigger for the encrypted password.


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