diff --git a/alliance_auth/settings.py b/alliance_auth/settings.py index 0833b47c..4e869264 100644 --- a/alliance_auth/settings.py +++ b/alliance_auth/settings.py @@ -32,8 +32,17 @@ BROKER_URL = 'amqp://guest:guest@localhost:5672/' CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler" -# Application definition +# EMAIL SETTINGS +# By default uses the python smtpd server +DOMAIN = 'https://the99eve.com' +EMAIL_HOST = 'localhost' +EMAIL_PORT = 1025 +EMAIL_HOST_USER = '' +EMAIL_HOST_PASSWORD = '' +EMAIL_USE_TLS = False +DEFAULT_FROM_EMAIL = 'testing@example.com' +# Application definition INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', @@ -108,7 +117,8 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', 'util.context_processors.alliance_id', 'util.context_processors.alliance_name', - 'util.context_processors.jabber_url' + 'util.context_processors.jabber_url', + 'util.context_processors.domain_url' ) TEMPLATE_DIRS = ( @@ -144,12 +154,12 @@ DEFAULT_ALLIANCE_GROUP = 'AllianceMember' # ALLIANCE INFO ALLIANCE_ID = '0' -ALLIANCE_NAME = 'Some alliance' +ALLIANCE_NAME = 'Somealliance' # Jabber Prosody Info JABBER_URL = "@someaddress.com" OPENFIRE_ADDRESS = "http://someaddress.com:9090/" -OPENFIRE_SECRET_KEY = "somesecret" +OPENFIRE_SECRET_KEY = "somekey" # Mumble settings MUMBLE_SERVER_ID = 1 diff --git a/alliance_auth/urls.py b/alliance_auth/urls.py index b7eb9932..201ed049 100644 --- a/alliance_auth/urls.py +++ b/alliance_auth/urls.py @@ -16,6 +16,13 @@ urlpatterns = patterns('', url(r'^logout_user/', 'authentication.views.logout_user', name='auth_logout_user'), url(r'^register_user/', 'registration.views.register_user_view', name='auth_register_user'), + url(r'^user/password/$', 'django.contrib.auth.views.password_change', name='password_change'), + url(r'^user/password/done/$', 'django.contrib.auth.views.password_change_done', name='password_change_done'), + url(r'^user/password/reset/$', 'django.contrib.auth.views.password_reset', name='password_reset'), + url(r'^user/password/password/reset/done/$', 'django.contrib.auth.views.password_reset_done', name='password_reset_done'), + url(r'^user/password/reset/complete/$', 'django.contrib.auth.views.password_reset_complete', name='password_reset_complete'), + url(r'^user/password/reset/confirm/(?P[0-9A-Za-z_\-]+)/(?P.+)/$', 'django.contrib.auth.views.password_reset_confirm', name='password_reset_confirm'), + # Portal Urls url(r'^dashboard/$', 'portal.views.dashboard_view', name='auth_dashboard'), url(r'^help/$', 'portal.views.help_view', name='auth_help'), diff --git a/templates/public/base.html b/templates/public/base.html index 3c5526ea..63f35c13 100644 --- a/templates/public/base.html +++ b/templates/public/base.html @@ -60,6 +60,10 @@ +
  • +
    Main Navigation
    +
  • +
  • Dashboard
  • @@ -75,6 +79,14 @@
  • Help
  • + +
  • +
    Util
    +
  • +
  • + Change Password +
  • + diff --git a/templates/public/login.html b/templates/public/login.html index 5ef94501..4602dbb2 100644 --- a/templates/public/login.html +++ b/templates/public/login.html @@ -37,10 +37,14 @@
    +
    {% if error %} {% endif %} + + +
    diff --git a/templates/registered/dashboard.html b/templates/registered/dashboard.html index 7e067165..dd5ae11c 100644 --- a/templates/registered/dashboard.html +++ b/templates/registered/dashboard.html @@ -9,7 +9,7 @@ {% if perms.auth.alliance_member %}
    -
    Alliance Announcment:
    +
    Alliance Announcment
    Something something dark side
    @@ -19,7 +19,7 @@ {% for character in characters %} {% ifequal character.character_id authinfo.main_char_id %}
    -
    Main character:
    +
    Main character
    -
    Groups:
    +
    Groups
    diff --git a/templates/registration/password_change_done.html b/templates/registration/password_change_done.html new file mode 100644 index 00000000..39ed5fa1 --- /dev/null +++ b/templates/registration/password_change_done.html @@ -0,0 +1,23 @@ +{% extends "public/base.html" %} +{% load bootstrap %} +{% load i18n static %} + + +{% block title %}{% trans 'Password change' %}{% endblock %} + +{% block content %} +
    +

    Change Password

    +
    +
    +
    +

    + Completed +

    +
    +
    +
    +
    + + +{% endblock %} diff --git a/templates/registration/password_change_form.html b/templates/registration/password_change_form.html new file mode 100644 index 00000000..e6169755 --- /dev/null +++ b/templates/registration/password_change_form.html @@ -0,0 +1,26 @@ +{% extends "public/base.html" %} +{% load bootstrap %} +{% load i18n static %} + + +{% block title %}{% trans 'Password change' %}{% endblock %} + +{% block content %} +
    +

    Change Password

    +
    +
    +
    + + {% csrf_token %} + {{ form|bootstrap }} +
    + + +
    +
    +
    +
    + + +{% endblock %} diff --git a/templates/registration/password_reset_complete.html b/templates/registration/password_reset_complete.html new file mode 100644 index 00000000..611ffd61 --- /dev/null +++ b/templates/registration/password_reset_complete.html @@ -0,0 +1,54 @@ +{% load staticfiles %} +{% load i18n %} +{% load bootstrap %} + + + + + + + + + + + + {{ ALLIANCE_NAME }} - Login + + + + + + + + +
    +
    +
    +
    +

    {% trans 'Password reset complete' %}

    + +

    {% trans "Your password has been set." %}

    + + + + +
    +
    +
    +
    + + diff --git a/templates/registration/password_reset_confirm.html b/templates/registration/password_reset_confirm.html new file mode 100644 index 00000000..4d5a11a2 --- /dev/null +++ b/templates/registration/password_reset_confirm.html @@ -0,0 +1,62 @@ +{% load staticfiles %} +{% load i18n %} +{% load bootstrap %} + + + + + + + + + + + + {{ ALLIANCE_NAME }} - Login + + + + + + + + +
    +
    +
    +
    + {% if validlink %} + + {% csrf_token %} + {{ form |bootstrap }} +
    + +
    + + {% else %} + +

    {% trans 'Password reset unsuccessful' %}

    + +

    {% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}

    + + {% endif %} +
    +
    +
    +
    + + diff --git a/templates/registration/password_reset_done.html b/templates/registration/password_reset_done.html new file mode 100644 index 00000000..00b23811 --- /dev/null +++ b/templates/registration/password_reset_done.html @@ -0,0 +1,53 @@ +{% load staticfiles %} +{% load i18n %} +{% load bootstrap %} + + + + + + + + + + + + {{ ALLIANCE_NAME }} - Login + + + + + + + + +
    +
    +
    +
    +

    {% trans 'Password Reset Success' %}

    + +

    {% trans "We've emailed you instructions for setting your password. You should be receiving them shortly." %}

    + +

    {% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %}

    + +
    +
    +
    +
    + + diff --git a/templates/registration/password_reset_email.html b/templates/registration/password_reset_email.html new file mode 100644 index 00000000..7436df47 --- /dev/null +++ b/templates/registration/password_reset_email.html @@ -0,0 +1,15 @@ +{% load i18n %}{% autoescape off %} +{% blocktrans %}You're receiving this email because you requested a password reset for your +user account.{% endblocktrans %} + +{% trans "Please go to the following page and choose a new password:" %} +{% block reset_link %} +https://the99eve.com{% url 'password_reset_confirm' uidb64=uid token=token %} +{% endblock %} +{% trans "Your username, in case you've forgotten:" %} {{ user.get_username }} + +{% trans "Thanks for using our site!" %} + +{% blocktrans %}The The 99 Percent team{% endblocktrans %} + +{% endautoescape %} diff --git a/templates/registration/password_reset_form.html b/templates/registration/password_reset_form.html new file mode 100644 index 00000000..cb788786 --- /dev/null +++ b/templates/registration/password_reset_form.html @@ -0,0 +1,56 @@ +{% load staticfiles %} +{% load i18n %} +{% load bootstrap %} + + + + + + + + + + + + {{ ALLIANCE_NAME }} - Login + + + + + + + + +
    +
    +
    +
    + + {% csrf_token %} +

    {% trans "Password Reset" %}

    +

    {% trans "Forgotten your password? Enter your email below." %}

    + {{form|bootstrap}} +
    + +
    + +
    +
    +
    +
    + + diff --git a/util/context_processors.py b/util/context_processors.py index e43337f9..1a2cb5f1 100644 --- a/util/context_processors.py +++ b/util/context_processors.py @@ -10,4 +10,8 @@ def alliance_name(request): def jabber_url(request): - return {'JABBER_URL': settings.JABBER_URL} \ No newline at end of file + return {'JABBER_URL': settings.JABBER_URL} + + +def domain_url(request): + return {'DOMAIN': settings.DOMAIN} \ No newline at end of file