Current time: 03-21-2010, 03:53 PM Hello There, Guest! (LoginRegister)


Post Reply 
Login with E-mail and not with username
05-31-2009, 10:21 AM (This post was last modified: 05-31-2009 10:22 AM by Giangy94.)
Post: #1
Login with E-mail and not with username
Hi,
today i'm working about a modification for login into the forum, this modification allows you to login with email and not with username.
In the header_welcomblock_guest I replaced this:
PHP Code:
<!--    lang.username "{$lang->login_username}"
with
PHP Code:
<!--    lang.username "Email"
and in the file functions_user.php i replaced this:
PHP Code:
function user_exists($uid)
{
    global 
$db;
    
    
$query $db->simple_select("users""COUNT(*) as user""uid='".intval($uid)."'", array('limit' => 1));
    if(
$db->fetch_field($query'user') == 1)
    {
        return 
true;
    }
    else
    {
        return 
false;
    }

with this:
PHP Code:
function user_exists($email)
{
    global 
$db;
    
    
$query $db->simple_select("email""COUNT(*) as email""email='".intval($email)."'", array('limit' => 1));
    if(
$db->fetch_field($query'email') == 1)
    {
        return 
true;
    }
    else
    {
        return 
false;
    }


But they don't work Dodgy

http://www.mybbitalia.com
Visit this user's website Find all posts by this user
Quote this message in a reply
05-31-2009, 11:56 AM
Post: #2
RE: Login with E-mail and not with username
Hello,

I have create a plugin for this. Please download the Attachment »emaillogin.php« and copy the file into inc » plugins and activate it. Smile


Attached File(s)
.php  emaillogin.php (Size: 1,007 bytes / Downloads: 26)

IS WebSoft - MyBB Themes, Webdesign and Software
Visit this user's website Find all posts by this user
Quote this message in a reply
05-31-2009, 12:21 PM
Post: #3
RE: Login with E-mail and not with username
hmm, may I ask what are the vantages of logging in with email instead of username?
Find all posts by this user
Quote this message in a reply
05-31-2009, 12:24 PM
Post: #4
RE: Login with E-mail and not with username
its more like vB ... like most of the requests you see here =P

Visit this user's website Find all posts by this user
Quote this message in a reply
05-31-2009, 01:14 PM (This post was last modified: 05-31-2009 01:53 PM by Giangy94.)
Post: #5
RE: Login with E-mail and not with username
I wanted create it to release it...I don't want use it Rolleyes

http://www.mybbitalia.com
Visit this user's website Find all posts by this user
Quote this message in a reply
05-31-2009, 08:43 PM
Post: #6
RE: Login with E-mail and not with username
Why reinventing the wheel?

Also it seems that you don't have experience, you didn't understand what user_exists does exactly, did you study the code? If you look the param is an integer value and not a string...

Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: