( ! ) Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/mybb-es.com/inc/plugins/google_seo/redirect.php on line 298
Call Stack
#TimeMemoryFunctionLocation
10.0002378616{main}( ).../showthread.php:0
20.0002403544require_once( '/var/www/mybb-es.com/global.php ).../showthread.php:28
30.00821736136pluginSystem->run_hooks( $hook = 'global_start', $arguments = ??? ).../global.php:100
40.00841736168google_seo_redirect_hook( '' ).../class_plugins.php:142
50.00861736920preg_replace( $pattern = '/\\?([^&?=]+)([=&])/u', $replacement = '&$1$2', $subject = NULL ).../redirect.php:298

( ! ) Deprecated: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/mybb-es.com/inc/plugins/google_seo/redirect.php on line 315
Call Stack
#TimeMemoryFunctionLocation
10.0002378616{main}( ).../showthread.php:0
20.0002403544require_once( '/var/www/mybb-es.com/global.php ).../showthread.php:28
30.00821736136pluginSystem->run_hooks( $hook = 'global_start', $arguments = ??? ).../global.php:100
40.00841736168google_seo_redirect_hook( '' ).../class_plugins.php:142
50.00891737800parse_str( $string = NULL, $result = NULL ).../redirect.php:315
Iniciar sesion con la direccion de email

Iniciar sesion con la direccion de email
Si desea permitir el inicio de sesion de dirección de correo electrónico pero no con el nombre de usuario En tu inc/functions_user.php busca: /** ...

Si desea permitir el inicio de sesion de dirección de correo electrónico pero no con el nombre de usuario
En tu inc/functions_user.php busca:
Código PHP:
/**
 * Checks a password with a supplied username.
 *
 * @param string The username of the user.
 * @param string The plain-text password.
 * @return boolean|array False when no match, array with user info when match.
 */
function validate_password_from_username($username$password)
{
    global 
$db;

    
$query $db->simple_select("users""uid,username,password,salt,loginkey,coppauser,usergroup""LOWER(username)='".$db->escape_string(my_strtolower($username))."'", array('limit' => 1));

    
$user $db->fetch_array($query);
    if(!
$user['uid'])
    {
        return 
false;
    }
    else
    {
        return 
validate_password_from_uid($user['uid'], $password$user);
    }


Y cambia por:
Código PHP:
/**
 * Checks a password with a supplied username.
 *
 * @param string The username of the user.
 * @param string The plain-text password.
 * @return boolean|array False when no match, array with user info when match.
 */
function validate_password_from_username($username$password)
{
    global 
$db;

    
$query $db->simple_select("users""uid,username,email,password,salt,loginkey,coppauser,usergroup""LOWER(email)='".$db->escape_string(my_strtolower($username))."'", array('limit' => 1));

    
$user $db->fetch_array($query);
    if(!
$user['uid'])
    {
        return 
false;
    }
    else
    {
        return 
validate_password_from_uid($user['uid'], $password$user);
    }



Si quieres permitir iniciar sesión con el nombre de usuario o dirección de correo electrónico
En tu inc/functions_user.php busca:
Código PHP:
/**
 * Checks a password with a supplied username.
 *
 * @param string The username of the user.
 * @param string The plain-text password.
 * @return boolean|array False when no match, array with user info when match.
 */
function validate_password_from_username($username$password)
{
    global 
$db;

    
$query $db->simple_select("users""uid,username,password,salt,loginkey,coppauser,usergroup""LOWER(username)='".$db->escape_string(my_strtolower($username))."'", array('limit' => 1));

    
$user $db->fetch_array($query);
    if(!
$user['uid'])
    {
        return 
false;
    }
    else
    {
        return 
validate_password_from_uid($user['uid'], $password$user);
    }


Y cambia por:
Código PHP:
/**
 * Checks a password with a supplied username.
 *
 * @param string The username of the user.
 * @param string The plain-text password.
 * @return boolean|array False when no match, array with user info when match.
 */
function validate_password_from_username($username$password)
{
    global 
$db;

    
$query $db->simple_select("users""uid,username,email,password,salt,loginkey,coppauser,usergroup""LOWER(username)='".$db->escape_string(my_strtolower($username))."' OR LOWER(email)='".$db->escape_string(my_strtolower($username))."'", array('limit' => 1));

    
$user $db->fetch_array($query);
    if(!
$user['uid'])
    {
        return 
false;
    }
    else
    {
        return 
validate_password_from_uid($user['uid'], $password$user);
    }



Para ambas
En tu inc/functions_user.php busca:
Código PHP:
/**
 * Checks if $username already exists in the database.
 *
 * @param string The username for check for.
 * @return boolean True when exists, false when not.
 */
function username_exists($username)
{
        global 
$db;

        
$query $db->simple_select("users""COUNT(*) as user""LOWER(username)='".$db->escape_string(my_strtolower($username))."'", array('limit' => 1));

        if(
$db->fetch_field($query'user') == 1)
        {
                return 
true;
        }
        else
        {   
                return 
false;
        }


Y cambia por:
Código PHP:
/**
 * Checks if $username already exists in the database.
 *
 * @param string The username for check for.
 * @return boolean True when exists, false when not.
 */
function username_exists($username)
{
    global 
$db;

    
$query $db->simple_select("users""COUNT(*) as user,email,username""LOWER(username)='".$db->escape_string(my_strtolower($username))."' OR LOWER(email)='".$db->escape_string(my_strtolower($username))."'", array('limit' => 1));

    if(
$db->fetch_field($query'user') == 1)
    {
        return 
true;
    }
    else
    {
        return 
false;
    }


Creditos: Dylan M.
:)
cool!
el de ambas esta genial!
Gracias Dano ;D
Awesome!! Gracias por compartir con todos nosotros.
Cuando realizas el paso 1 "o" 2 es opcional (uno solo de los 2) y el 3ro es para ambas
:)
Yo utilize este paso..


(16 Oct, 2011, 12:02 pm)Cluster escribió: Para ambas
En tu inc/functions_user.php busca:
Código PHP:
/**
 * Checks if $username already exists in the database.
 *
 * @param string The username for check for.
 * @return boolean True when exists, false when not.
 */
function username_exists($username)
{
        global 
$db;

        
$query $db->simple_select("users""COUNT(*) as user""LOWER(username)='".$db->escape_string(my_strtolower($username))."'", array('limit' => 1));

        if(
$db->fetch_field($query'user') == 1)
        {
                return 
true;
        }
        else
        {   
                return 
false;
        }


Y cambia por:
Código PHP:
/**
 * Checks if $username already exists in the database.
 *
 * @param string The username for check for.
 * @return boolean True when exists, false when not.
 */
function username_exists($username)
{
    global 
$db;

    
$query $db->simple_select("users""COUNT(*) as user,email,username""LOWER(username)='".$db->escape_string(my_strtolower($username))."' OR LOWER(email)='".$db->escape_string(my_strtolower($username))."'", array('limit' => 1));

    if(
$db->fetch_field($query'user') == 1)
    {
        return 
true;
    }
    else
    {
        return 
false;
    }


Ya que quiero que se pueda Iniciar Sesion tanto con su Correo como con su Nombre de Usuario, pero no me funciona... O estoy utilizando el Equivocado..??

Excelente tutorial, +1.
Infraworld ocupas usar esa + la segunda
:)
(17 Oct, 2011, 5:27 pm)Cluster escribió: Infraworld ocupas usar esa + la segunda

Gracias Amigo, Me Funciono Perfecto.. +1Rep.