diff --git a/home/__pycache__/views.cpython-313.pyc b/home/__pycache__/views.cpython-313.pyc index 5e21b44..583ee51 100644 Binary files a/home/__pycache__/views.cpython-313.pyc and b/home/__pycache__/views.cpython-313.pyc differ diff --git a/home/static/nw-themes/nw-ryu/nw-images/nw-mails/facebook-logo-gray.png b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/facebook-logo-gray.png new file mode 100644 index 0000000..d5774f4 Binary files /dev/null and b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/facebook-logo-gray.png differ diff --git a/home/static/nw-themes/nw-ryu/nw-images/nw-mails/instagram-logo-gray.png b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/instagram-logo-gray.png new file mode 100644 index 0000000..05842cd Binary files /dev/null and b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/instagram-logo-gray.png differ diff --git a/home/static/nw-themes/nw-ryu/nw-images/nw-mails/nw-mail-body.jpg b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/nw-mail-body.jpg new file mode 100644 index 0000000..fb679eb Binary files /dev/null and b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/nw-mail-body.jpg differ diff --git a/home/static/nw-themes/nw-ryu/nw-images/nw-mails/nw-mail-footer.jpg b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/nw-mail-footer.jpg new file mode 100644 index 0000000..20c00c2 Binary files /dev/null and b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/nw-mail-footer.jpg differ diff --git a/home/static/nw-themes/nw-ryu/nw-images/nw-mails/nw-mail-logo.webp b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/nw-mail-logo.webp new file mode 100644 index 0000000..7886586 Binary files /dev/null and b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/nw-mail-logo.webp differ diff --git a/home/static/nw-themes/nw-ryu/nw-images/nw-mails/twitter-logo-gray.png b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/twitter-logo-gray.png new file mode 100644 index 0000000..e06a35d Binary files /dev/null and b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/twitter-logo-gray.png differ diff --git a/home/static/nw-themes/nw-ryu/nw-images/nw-mails/youtube-logo-gray.png b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/youtube-logo-gray.png new file mode 100644 index 0000000..495069b Binary files /dev/null and b/home/static/nw-themes/nw-ryu/nw-images/nw-mails/youtube-logo-gray.png differ diff --git a/home/templates/auth/activation_invalid.html b/home/templates/auth/activation_invalid.html index 47bef81..fb63f1f 100644 --- a/home/templates/auth/activation_invalid.html +++ b/home/templates/auth/activation_invalid.html @@ -1,3 +1,9 @@ -

Enlace inválido

-

El enlace de activación no es válido o ha expirado.

-Regístrate de nuevo + + + {% include 'partials/head.html' %} + {% include 'partials/header.html' %} + {% include 'partials/video.html' %} + {% include 'partials/activation_invalid.html' %} + {% include 'partials/social.html' %} + {% include 'partials/footer.html' %} + {% include 'partials/final.html' %} \ No newline at end of file diff --git a/home/templates/auth/activation_success.html b/home/templates/auth/activation_success.html index 704440a..b76b55d 100644 --- a/home/templates/auth/activation_success.html +++ b/home/templates/auth/activation_success.html @@ -1,3 +1,9 @@ -

Activación exitosa

-

Tu cuenta ha sido activada correctamente. Ya puedes iniciar sesión.

-Iniciar sesión + + + {% include 'partials/head.html' %} + {% include 'partials/header.html' %} + {% include 'partials/video.html' %} + {% include 'partials/activation_success.html' %} + {% include 'partials/social.html' %} + {% include 'partials/footer.html' %} + {% include 'partials/final.html' %} \ No newline at end of file diff --git a/home/templates/emails/activation.html b/home/templates/emails/activation.html index 3342564..d1ccc39 100644 --- a/home/templates/emails/activation.html +++ b/home/templates/emails/activation.html @@ -1,6 +1,145 @@ -

Bienvenido, {{ username }}

-

Gracias por registrarte en {{ NOMBRE_SERVIDOR }}.

-

Para activar tu cuenta, haz clic en el siguiente enlace:

-ACTIVAR LA CUENTA -

Si el botón no funciona, copia y pega el siguiente enlace en tu navegador:

-

{{ activation_link }}

+ + + + + +
+ + + + +
+ + + + + +
+ + + + +

ACTIVACIÓN DE CUENTA

+ + + + + +
+ + + + +
+ + + + +
+
+ + + + +
+ + + + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bienvenido, {{ username }}

Gracias por crear una cuenta en {{ NOMBRE_SERVIDOR }}.
Para poder empezar a usar tu cuenta, deberás activarla haciendo clic en el botón ACTIVAR LA CUENTA.

Tus datos de cuenta son:

Cuenta: {{ username }}
Contraseña: {{ password }}

Con tu usuario y contraseña podrás entrar a nuestro sitio web y al servidor.

+ + + + +

- Al servidor se debe entrar con nombre de usuario y contraseña. NO con el correo.
- Puedes usar el mismo correo para registrar hasta 10 cuentas en el servidor.
- El usuario del foro es independiente del usuario que acabas de crear. Puedes crear una cuenta para el foro aquí.

ACTIVAR LA CUENTA

Si no puedes activar la cuenta usando el botón, copia y pega en tu navegador siguiente enlace:
{{ activation_link }}



Atentamente, el Equipo de {{ NOMBRE_SERVIDOR }}.

+ + + + +
+ + + + + + + +
+ + + + +
+ + + + + + + +

SÍGUENOS EN

+ + + + + + + +
FbIgTwYt
+ + + + +
+ + + + +

Términos y Condiciones | Política de Reembolso | Política de Privacidad
{{ NOMBRE_SERVIDOR }} © {{ ANIO_ACTUAL }}

diff --git a/home/templates/partials/activation_invalid.html b/home/templates/partials/activation_invalid.html new file mode 100644 index 0000000..ecc08b2 --- /dev/null +++ b/home/templates/partials/activation_invalid.html @@ -0,0 +1,14 @@ +
+
+
+

Activación de cuenta

+
+
+

El enlace de activación es inválido

+
+

Si necesitas ayuda para crear una cuenta, puedes contactar con el equipo de {{ NOMBRE_SERVIDOR }}.

+
+
+
+
+
\ No newline at end of file diff --git a/home/templates/partials/activation_success.html b/home/templates/partials/activation_success.html new file mode 100644 index 0000000..4019d2e --- /dev/null +++ b/home/templates/partials/activation_success.html @@ -0,0 +1,17 @@ +
+
+
+

Activación de cuenta

+
+
+
+

¡Bienvenido a {{ NOMBRE_SERVIDOR }}!

+

La cuenta {{ username }} ha sido activada exitosamente.

+
+

Ya puedes conectar a la página web o empezar a disfrutar del servidor.

+
+
+
+
+
+
\ No newline at end of file diff --git a/home/views.py b/home/views.py index 2c9c4cc..3b410cf 100644 --- a/home/views.py +++ b/home/views.py @@ -19,7 +19,7 @@ from .ac_soap import execute_soap_command from django.utils import timezone from .library_correo import enviar_correo from django.utils.crypto import get_random_string - +from django.conf import settings # Configuración del logger logger = logging.getLogger(__name__) @@ -298,13 +298,22 @@ def register_view(request): if cursor.fetchone()[0] > 0: return JsonResponse({'success': False, 'message': 'El nombre de usuario ya está en uso.'}) - # Validar reclutador - recruiter_id = None + # Validar y obtener recruiter_id + recruiter_id = 0 # Valor por defecto si no se proporciona un reclutador if recruiter: with connections['acore_auth'].cursor() as cursor: cursor.execute("SELECT id FROM account WHERE username = %s", [recruiter]) recruiter_data = cursor.fetchone() - recruiter_id = recruiter_data[0] if recruiter_data else None + if recruiter_data: + recruiter_id = recruiter_data[0] + else: + with connections['acore_characters'].cursor() as char_cursor: + char_cursor.execute("SELECT account FROM characters WHERE name = %s", [recruiter]) + character_data = char_cursor.fetchone() + if character_data: + recruiter_id = character_data[0] + else: + return JsonResponse({'success': False, 'message': 'El reclutador ingresado no existe.'}) # Generar salt y verifier salt = binascii.hexlify(os.urandom(32)).decode('utf-8').upper() @@ -329,20 +338,28 @@ def register_view(request): ) # Enviar correo de activación - activation_link = f"http://localhost:8009/activate-account?act={activation_hash}" + activation_link = f"http://localhost:8009/es/activate-account?act={activation_hash}" context = { 'username': username, + 'password': password, 'activation_link': activation_link, - 'NOMBRE_SERVIDOR': 'Nova WoW' + 'NOMBRE_SERVIDOR': settings.NOMBRE_SERVIDOR } enviar_correo( - subject='Activa tu cuenta en Nova WoW', + subject=f'Activación de la cuenta {username} - {settings.NOMBRE_SERVIDOR}', to_email=email, template='emails/activation.html', context=context ) - return JsonResponse({'success': True, 'message': 'Cuenta creada exitosamente. Revisa tu correo para activarla.'}) + # Preparar el mensaje de respuesta + message = f""" +
+ La cuenta '{username}' ha sido creada.

+ Se ha enviado un enlace de activación al correo {email}. +
+ """ + return JsonResponse({'success': True, 'message': message}) return render(request, 'auth/register.html')