vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Login by username or email (https://vborg.vbsupport.ru/showthread.php?t=96832)

futuredood 06-21-2006 07:19 PM

how do you change this to ONLY e-mail, and does it work for 3.5.4?

futuredood 06-22-2006 08:02 AM

to note this works with 3.5.4

malmazan 11-29-2006 08:53 AM

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

OneEyeSleepy 04-03-2008 04:13 PM

Hi, is there anything similar that can be used for vbulletin v3.6.9?

Hasann 04-03-2008 04:25 PM

Heyy Marco does it work for 3.7.x ?

abendagar 04-05-2008 09:56 AM

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???

malmazan 05-10-2008 07:38 PM

Quote:

Originally Posted by Hasann (Post 1482108)
Heyy Marco does it work for 3.7.x ?

It works

ChrisXX 08-14-2008 05:03 PM

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!

Arkham 09-03-2008 10:25 PM

Hi folks -- long time no see...

Just a quick question: Does this hack still work with the current vB release?

jerx 10-15-2008 02:30 PM

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 (Post 1483454)
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?


All times are GMT. The time now is 04:32 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.01177 seconds
  • Memory Usage 1,754KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete