MyBB Community Forums

Full Version: Sign-up without entering password and e-mail twice
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Anyone ever figure this out?
You'll need to remove the validator from the field; I'll make the jQuery convert only check the confirmation if it exists.

As for the backend, you'll need a plugin to automatically populate the confirmation field with the original.
you mean remove username validation? or do i misunderstand?
Here's how you do it:

In the member_register template, remove the 'email2' validator field and remove the 'match_field' option from the email validator field.

<!--
	regValidator = new FormValidator('registration_form');
	regValidator.register('username', 'notEmpty', {failure_message:'{$lang->js_validator_no_username}'});
	regValidator.register('email', 'regexp', {regexp:'^([a-zA-Z0-9_\\.\\+\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$', failure_message:'{$lang->js_validator_invalid_email}'});
{$validator_extra}
	regValidator.register('username', 'ajax', {url:'xmlhttp.php?action=username_availability', loading_message:'{$lang->js_validator_checking_username}'}); // needs to be last
// -->

Then unfortunately you have a core edit; member.php line 700 (ish). You need to do the same thing and remove the match_field options and the 'password2' validator field.

Then you're just after a plugin that populates the values on register (hooking into member_do_register_start?).
thanks man!

who wants to make me the plugin? haha
Simple.

$plugins->add_hook('member_do_register_start', 'pluginname_do_register');

function pluginname_do_register()
{
	global $mybb;

	$mybb->input['email2'] = $mybb->input['email'];
	$mybb->input['password2'] = $mybb->input['password'];
}

If that doesn't work, CBA. Toungue
I don't even know what to do with that, man! Toungue
Sheesh! Shy

New PHP file in the ./inc/plugins directory, call it skipvalidator.php. Add and save:

<?php
if(!defined('IN_MYBB'))
{
	die('Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.');
}

if(THIS_SCRIPT != 'member.php' && !defined('IN_ADMINCP'))
{
	return false;
}

$plugins->add_hook('member_do_register_start', 'skipvalidator_do_register');

function skipvalidator_info()
{
	return array(
		'name' => 'Skip Validator',
		'description' => 'A plugin to skip confirmation of passwords and emails',
		'website' => 'http://xekko.co.uk',
		'author' => 'Tomm',
		'authorsite' => 'http://xekko.co.uk',
		'version' => '1.0',
		'guid' => '',
		'compatibility' => '*'
	);
}

function skipvalidator_do_register()
{
    global $mybb;

    $mybb->input['email2'] = $mybb->input['email'];
    $mybb->input['password2'] = $mybb->input['password'];
}
P.S. Maybe use Patches to do the core edits so upgrades are easier?
Thanks man. You're the best as always.
Pages: 1 2