Back to vBulletin 3.6 Add-ons

Login via Email
Mod Version: 1.00, by Till

This modification is in the archives.
vB Version: 3.6.7 Rating: (0 vote - 0 average) Installs: 8
Released: 11 Jul 2007 Last Update: Never Downloads: 1
Not Supported  

Ok, basically I wanted to allow users to login via email. This is cheap and straight to the point, so feel free to add to this.

Unfortunately I could not find a hook to use for this, so I hacked my login.html.

PHP Code:
if ($_POST['do'] == 'login')
{
    
$vbulletin->input->clean_array_gpc('p', array(
        
'vb_login_username' => TYPE_STR,
        
'vb_login_password' => TYPE_STR,
        
'vb_login_md5password' => TYPE_STR,
        
'vb_login_md5password_utf' => TYPE_STR,
        
'postvars' => TYPE_STR,
        
'cookieuser' => TYPE_BOOL,
        
'logintype' => TYPE_STR,
        
'cssprefs' => TYPE_STR,
    ));
    
    if (isset(
$_POST['vb_login_username'])) {
        
$status eregi(
                
"^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,5})$",
                
$vbulletin->GPC['vb_login_username']
        );
        if (
$status !== FALSE) { 
            
$query "SELECT username FROM vb3_user WHERE email = '%s'";
            
$query sprintf($query$vbulletin->GPC['vb_login_username']);

            
$_resp $db->query_read($query);
            
$_user $db->fetch_row($_resp);
            
$_user = (string) @$_user[0];
            
            if (empty(
$_user) === FALSE) {
                
$_POST['vb_login_username'] = $_user;
            }
            
//var_dump($_user, $vbulletin->GPC['vb_login_username']);
            //exit;
        
}
    }

     
// can the user login?
     // to be continued. 

Hope this helps someone.

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2025