from django.conf.urls import patterns, url
from auth_pack.views import ajax_login, ajax_registration, activate, registration_complete, activate_complete, ChangePasswordView


def auth_pack_urls(login_params={}, registration_params={}, changepass_params={},
        activate_complete_params={}, registration_complete_params={}):
    return patterns('',
        url(r'login/$', ajax_login, login_params, name='login'),
        url(r'registration/complete/$', registration_complete, registration_complete_params, name='registration_complete'),
        url(r'registration/$', ajax_registration, registration_params, name='registration'),
        url(r'activate/complete/$', activate_complete, activate_complete_params, name='activate_complete'),
        url(r'activate/(?P<activation_key>\w+)/$', activate, name='activate'),
        url(r'changepass/$', ChangePasswordView.as_view(**changepass_params), name='change_password'),
        url(r'logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),
    )
