форум vBSupport.ru > vBulletin > Вопрос — Ответ
  • »
VBsupport перешел с домена .ORG на родной .RU Ура! Пожалуйста, обновите свои закладки - VBsupport.ru
 
 
 
 
hoshemin
Простоузер
Default Изменение алгоритма авторизации
0

Подскажите как мне сделать авторизацию не по логину а по email?
Bot
Yandex Bot Yandex Bot is online now
 
Join Date: 05.05.2005
Реклама на форуме А что у нас тут интересного? =)
 
 
Ghost
Гуру
 
Ghost's Avatar
Default
0

Login via Email
 
 
hoshemin
Простоузер
Default
0

К сожалению не имею лицензии
 
 
AleX
Гость
Default

hoshemin,
Quote:
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. 

Last edited by AleX : 04-22-2009 at 12:52 AM.
 
 
hoshemin
Простоузер
Default
0

А подскажите а где находится файл login.html
 
 
AleX
Гость
Default

hoshemin, это тот же login.php — в корневой папке форума.
 
 
OldEr
Специалист
Master
 
OldEr's Avatar
Default
0

Quote:
Originally Posted by AleX View Post
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.
Хоть бы в тегом цитаты обрамил. = )
 
 
AleX
Гость
Default

Оффтоп
 
 
OldEr
Специалист
Master
 
OldEr's Avatar
Default
0

Оффтоп
 


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




All times are GMT +4. The time now is 10:00 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Loading...