static public function findBySiteLogin($nb_site, $login, $passwd, $active = true)
    {
        $retval = null;

        $nb_site_id = nb_getMixedValue($nb_site, 'nb_site_id');
        if (is_numeric($nb_site_id)) {
            $retval = CNabuUser::buildObjectFromSQL(
                    "select u.*, su.nb_role_id "
                    . "from nb_user u, nb_site_user su "
                   . "where (u.nb_user_login='%login\$s' or lower(u.nb_user_email)=lower('%login\$s')) "
                     . "and u.nb_user_passwd='%passwd\$s' "
                     . ($active ? "and u.nb_user_validation_status='T' " : '')
                     . "and u.nb_user_id=su.nb_user_id "
                     . "and su.nb_site_id=%site_id\$d",
                    array(
                        'login' => $login,
                        'passwd' => CNabuUser::encodePassword($passwd),
                        'site_id' => $nb_site_id
                    )
            );
        }

        return $retval;
    }