vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need assistance reading plain text password that user registers with (https://vborg.vbsupport.ru/showthread.php?t=170510)

Leonard 02-14-2008 08:33 PM

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

cheesegrits 02-14-2008 09:14 PM

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

Leonard 02-14-2008 09:25 PM

Hugh,

Thanks! :)

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

Cheers mate,

Leo

cheesegrits 02-14-2008 09:35 PM

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

Leonard 02-14-2008 10:02 PM

Haiz that was probably the problem!

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

L.


All times are GMT. The time now is 07:16 AM.

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.01192 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete