Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Login by username or email Details »»
Login by username or email
Version: 1.00, by Marco van Herwaarden Marco van Herwaarden is offline
Developer Last Online: Dec 2010 Show Printable Version Email this Page

Version: 3.5.0 RC3 Rating:
Released: 09-23-2005 Last Update: Never Installs: 47
Code Changes  
No support by the author.

This code modification was made as part of a request in this thread: https://vborg.vbsupport.ru/showthrea...5&page=1&pp=15

All that it does is allow to use the email address instead of the username to be used to login (username also still works).

Since people where stating that it should be released, well here it goes.

1 File edit:
in file includes/functions_login.php, find:
PHP Code:
    if ($vbulletin->userinfo $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, username, password, salt FROM " TABLE_PREFIX "user WHERE username = '" $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'")) 
and replace by:
PHP Code:
 // Start hack login with mail address (MarcoH64)
//    if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
if (!$vbulletin->userinfo $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, username, password, salt FROM " TABLE_PREFIX "user WHERE username = '" $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
{
$vbulletin->userinfo $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, username, password, salt FROM " TABLE_PREFIX "user WHERE email = '" $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'");
}
if (
$vbulletin->userinfo)
// End hack login with mail address (MarcoH64) 
This will allow logging in with either mail or username.

Download Now

File Type: zip Login with Email Address v1.00.zip (685 Bytes, 317 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 06-21-2006, 07:19 PM
futuredood futuredood is offline
 
Join Date: Jan 2002
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do you change this to ONLY e-mail, and does it work for 3.5.4?
Reply With Quote
  #23  
Old 06-22-2006, 08:02 AM
futuredood futuredood is offline
 
Join Date: Jan 2002
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

to note this works with 3.5.4
Reply With Quote
  #24  
Old 11-29-2006, 08:53 AM
malmazan malmazan is offline
 
Join Date: Feb 2006
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

These days (3.6.4) it is more like:
Loor for :
PHP Code:
if ($vbulletin->userinfo $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " TABLE_PREFIX "user WHERE username = '" $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'")) 
And replace by:

PHP Code:
// Start hack login with mail address (MarcoH64 Marco van Herwaarden)
// original 3 6 4 add infractiongroup ids to original hack    if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
if (!$vbulletin->userinfo $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " TABLE_PREFIX "user WHERE username = '" $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
{
$vbulletin->userinfo $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " TABLE_PREFIX "user WHERE email = '" $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'");
}
if (
$vbulletin->userinfo)
// End hack login with mail address (MarcoH64 Marco van Herwaarden) 
It's the same thing, though "infractiongroupids, " is added to the query list
Reply With Quote
  #25  
Old 04-03-2008, 04:13 PM
OneEyeSleepy OneEyeSleepy is offline
 
Join Date: Sep 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, is there anything similar that can be used for vbulletin v3.6.9?
Reply With Quote
  #26  
Old 04-03-2008, 04:25 PM
Hasann's Avatar
Hasann Hasann is offline
 
Join Date: Aug 2005
Location: Germany
Posts: 897
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Heyy Marco does it work for 3.7.x ?
Reply With Quote
  #27  
Old 04-05-2008, 09:56 AM
abendagar abendagar is offline
 
Join Date: May 2002
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any downside to using

if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "' OR email = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))

Isn't it simpler???
Reply With Quote
  #28  
Old 05-10-2008, 07:38 PM
malmazan malmazan is offline
 
Join Date: Feb 2006
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Hasann View Post
Heyy Marco does it work for 3.7.x ?
It works
Reply With Quote
  #29  
Old 08-14-2008, 05:03 PM
ChrisXX ChrisXX is offline
 
Join Date: Oct 2007
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So let me get this straight, if I just change this...

Code:
    if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
to this...

Code:
    if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE email = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
It will force users to login with their email address, instead of their username?

My goal is to make the username benign, and only for display purposes. The reason is I will be integrating VB in with some other apps that require email, and also use a username but only for display purposes.

Am I correct?

My second question then becomes, if two users have the same display name (for vB, username), will it cause problems? If so, is there a way to rectify that?

Thanks much in advance!
Reply With Quote
  #30  
Old 09-03-2008, 10:25 PM
Arkham's Avatar
Arkham Arkham is offline
 
Join Date: Nov 2001
Location: Toronto, Ontario
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi folks -- long time no see...

Just a quick question: Does this hack still work with the current vB release?
Reply With Quote
  #31  
Old 10-15-2008, 02:30 PM
jerx jerx is offline
 
Join Date: Feb 2006
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works on vb 3.7.3 pl1. This is the code I used:

Code:
// Start hack login with mail address (MarcoH64)
//	if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
	if (!$vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
	{
		$vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE email = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'");
	}
	if ($vbulletin->userinfo)
// End hack login with mail address
Quote:
Originally Posted by abendagar View Post
Any downside to using

if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "' OR email = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))

Isn't it simpler???
That works, too. Are there any differences between both versions, eg performance, security or stability wise?
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 04:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04718 seconds
  • Memory Usage 2,354KB
  • Queries Executed 26 (?)
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
  • (3)bbcode_code
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete