Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-14-2008, 08:33 PM
Leonard Leonard is offline
 
Join Date: Dec 2001
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need assistance reading plain text password that user registers with

Hi all,

Here's an interesting problem.

Because of the requirements of this company I'm working for, whenever a user registers on our forum, it checks if the user already has a company account. If one doesn't exist, it creates a new account on a separate database. Account passwords on this database are plain text.

I have created a plugin at the hook point "register_addmember_complete".

The actual PHP code in register.php is using the variable $vbulletin->gpc['password']

When I try to call this variable from within my plug-in, it comes out blank.

e.g. $mypassword = $vbulletin->gpc['password'];
results in a blank $mypassword.

Does anyone know how I can get access to the plain text password that a user enters, from the "register_addmember_complete" hookpoint?

Best,

Leo
Reply With Quote
  #2  
Old 02-14-2008, 09:14 PM
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'll have to do this:

PHP Code:
define('DISABLE_PASSWORD_CLEARING',1); 
... in your config.php. This is not set by default, which means the md5hash() javascript routine clears the clear text password form data so only the md5 version is sent over the wire. But you may define it yourself, as per this comment in global.php:

PHP Code:
// you may define this if you don't want the password in the login box to be zapped onsubmit; good for integration
$show['nopasswordempty'] = defined('DISABLE_PASSWORD_CLEARING') ? 0// this nees to be an int for the templates 
Although the comment is a little misleading, as it really applies to anywhere a password is submitted from the browser, like during registration or when changing passwords, not just on login.

Will you have to worry about syncronizing passwords between the corporate db and vB? i.e. if they change their vB password, will you need to update the corporate db, and vice versa? Or is it just a one off thing during registration?

-- hugh
Reply With Quote
  #3  
Old 02-14-2008, 09:25 PM
Leonard Leonard is offline
 
Join Date: Dec 2001
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hugh,

Thanks!

Note: $vbulletin->gpc['password'] is still null, but $_POST['password'] is intact.

Cheers mate,

Leo
Reply With Quote
  #4  
Old 02-14-2008, 09:35 PM
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you mean $vbulletin->GPC['password']? Variable names are case sensitive. It should be OK, as it's included in the clean_array_gpc() call in the register code.

-- hugh
Reply With Quote
  #5  
Old 02-14-2008, 10:02 PM
Leonard Leonard is offline
 
Join Date: Dec 2001
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Haiz that was probably the problem!

Argh. Staring at this code too long....

L.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:58 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07584 seconds
  • Memory Usage 2,200KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete