)

core = [
    path(
        'account/login/',
        LoginView.as_view(),
        name='login',
    ),
    path(
        'account/two_factor/setup/',
        SetupView.as_view(),
        name='setup',
    ),
    path(
        'account/two_factor/qrcode/',
        QRGeneratorView.as_view(),
        name='qr',
    ),
    path(
        'account/two_factor/setup/complete/',
        SetupCompleteView.as_view(),
        name='setup_complete',
    ),
    path(
        'account/two_factor/backup/tokens/',
        BackupTokensView.as_view(),
        name='backup_tokens',
    ),
    path(
        'account/two_factor/backup/phone/register/',
        PhoneSetupView.as_view(),
Esempio n. 2
0
# Import django-urls.
from django.urls import path
# Import views.
from . import views
from django.contrib.auth.views import LogoutView
from two_factor.views import DisableView, LoginView, QRGeneratorView, SetupCompleteView, SetupView

# Set app name
app_name = 'account'
# Set url-patterns
urlpatterns = [
    path('', views.UserDetailView.as_view(), name='detail'),
    path('edit/', views.UserEditView.as_view(), name='edit'),
    path('changepassword/', views.change_password, name='change_password'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('login/', LoginView.as_view(), name='login'),
    path('two_factor/setup/', views.SetupView.as_view(), name='two_factor_setup'),
    path('two_factor/qr_code/', QRGeneratorView.as_view(), name='two_factor_qr'),
    path('two_factor/setup/complete/', SetupCompleteView.as_view(), name='two_factor_setup_complete'),
    path('two_factor/backup/tokens/', views.BackupTokensView.as_view(), name='two_factor_backup_tokens'),
    path('two_factor/disable/', DisableView.as_view(), name='two_factor_disable'),
]
Esempio n. 3
0
app_name = 'users'

urlpatterns = [
    path('register/', UserRegisterView.as_view(), name='register'),
    path('<slug:username>/profile/', ProfileView.as_view(), name='profile'),
    path('<slug:username>/profile/update/',
         ProfileUpdateView.as_view(),
         name='profile_update'),
]

# Custom Login, Two-Factor Authentication and Password Reset Processes
urlpatterns += [
    path('login/', UserLoginView.as_view(), name='login'),
    path('two-factor/setup/qr/', UserSetupQRView.as_view(), name='setup'),
    path('two-factor/qrcode/', QRGeneratorView.as_view(), name='qr'),
    path('two-factor/setup/email/',
         UserSetupEmailView.as_view(),
         name='setup_email'),
    path('two-factor/setup/email/token/',
         UserSetupEmailTokenView.as_view(),
         name='setup_email_token'),
    path('logout/', auth_views.LogoutView.as_view(), name='logout'),
    path('password-reset/',
         UserPasswordResetView.as_view(),
         name='password_reset_form'),
    path('password-reset/done/',
         UserPasswordResetDoneView.as_view(),
         name='password_reset_done'),
    path('password-reset-confirm/<uidb64>/<token>/',
         UserPasswordResetConfirmView.as_view(),
Esempio n. 4
0
    # View to kill other sessions with
    url(r'^killsession/(?P<pk>\w+)/',
        RatticSessionDeleteView.as_view(),
        name='kill_session'),

    # Two Factor Views
    url(r'^login/$', RatticTFALoginView.as_view(), name='login'),
    url(r'^two_factor/disable/$',
        RatticTFADisableView.as_view(),
        name='tfa_disable'),
    url(r'^two_factor/backup/$',
        RatticTFABackupTokensView.as_view(),
        name='tfa_backup'),
    url(r'^two_factor/setup/$', RatticTFASetupView.as_view(),
        name='tfa_setup'),
    url(r'^two_factor/qr/$', QRGeneratorView.as_view(), name='tfa_qr'),
)

if settings.GOAUTH2_ENABLED:
    urlpatterns += patterns(
        '',
        url(r'', include('social_auth.urls')),
    )

# URLs we don't want enabled with LDAP
if not settings.LDAP_ENABLED:
    urlpatterns += (url(r'^reset/$',
                        'django.contrib.auth.views.password_reset', {
                            'post_reset_redirect': '/account/reset/done/',
                            'template_name': 'password_reset.html'
                        },
Esempio n. 5
0
    teacher_delete_students, teacher_dismiss_students, teacher_edit_class, teacher_delete_class, \
    teacher_student_reset, teacher_edit_student, teacher_edit_account, teacher_disable_2FA, \
    teacher_print_reminder_cards, teacher_accept_student_request, teacher_reject_student_request, \
    teacher_class_password_reset
from portal.views.teacher.home import teacher_home
from portal.views.email import send_new_users_report

js_info_dict = {
    'packages': ('conf.locale',),
}

two_factor_patterns = [
    url(r'^account/login/$', custom_2FA_login, name='login'),
    url(r'', include('two_factor.urls', 'two_factor')),
    url(r'^account/two_factor/setup/$', SetupView.as_view(), name='setup'),
    url(r'^account/two_factor/qrcode/$', QRGeneratorView.as_view(), name='qr'),
    url(r'^account/two_factor/setup/complete/$', SetupCompleteView.as_view(),
        name='setup_complete'),
    url(r'^account/two_factor/backup/tokens/$', teacher_verified(BackupTokensView.as_view()),
        name='backup_tokens'),
    url(r'^account/two_factor/$', teacher_verified(ProfileView.as_view()), name='profile'),
    url(r'^account/two_factor/disable/$', teacher_verified(DisableView.as_view()), name='disable'),
]


urlpatterns = patterns(
    '',
    url(r'^favicon\.ico$', RedirectView.as_view(url='/static/portal/img/favicon.ico', permanent=True)),

    url(r'^$', home_view, name='home'),
    url(r'^teach/$', teach, name='teach'),
Esempio n. 6
0
    url(r'^$', profile, {}),
    url(r'^newapikey/$', newapikey, {}),
    url(r'^deleteapikey/(?P<key_id>\d+)/$', deleteapikey, {}),

    url(r'^logout/$', 'django.contrib.auth.views.logout', {
        'next_page': settings.RATTIC_ROOT_URL}),

    # View to kill other sessions with
    url(r'^killsession/(?P<pk>\w+)/', RatticSessionDeleteView.as_view(), name='kill_session'),

    # Two Factor Views
    url(r'^login/$', RatticTFALoginView.as_view(), name='login'),
    url(r'^two_factor/disable/$', RatticTFADisableView.as_view(), name='tfa_disable'),
    url(r'^two_factor/backup/$', RatticTFABackupTokensView.as_view(), name='tfa_backup'),
    url(r'^two_factor/setup/$', RatticTFASetupView.as_view(), name='tfa_setup'),
    url(r'^two_factor/qr/$', QRGeneratorView.as_view(), name='tfa_qr'),
)

# URLs we don't want enabled with LDAP
if not settings.LDAP_ENABLED:
    urlpatterns += (
        url(r'^reset/$', 'django.contrib.auth.views.password_reset',
            {
                'post_reset_redirect': '/account/reset/done/',
                'template_name': 'password_reset.html'
            },
            name="password_reset"
        ),

        url(r'^reset/done/$', 'django.contrib.auth.views.password_reset_done', {
            'template_name': 'password_reset_done.html'},
Esempio n. 7
0
core = patterns(
    '',
    url(
        regex=r'^account/login/$',
        view=LoginView.as_view(),
        name='login',
    ),
    url(
        regex=r'^account/two_factor/setup/$',
        view=SetupView.as_view(),
        name='setup',
    ),
    url(
        regex=r'^account/two_factor/qrcode$',
        view=QRGeneratorView.as_view(),
        name='qr',
    ),
    url(
        regex=r'^account/two_factor/setup/complete/$',
        view=SetupCompleteView.as_view(),
        name='setup_complete',
    ),
    url(
        regex=r'^account/two_factor/backup/tokens/$',
        view=BackupTokensView.as_view(),
        name='backup_tokens',
    ),
    url(
        regex=r'^account/two_factor/backup/phone/register/$',
        view=PhoneSetupView.as_view(),
Esempio n. 8
0
    teacher_password_reset,
    password_reset_done,
    student_password_reset,
    password_reset_check_and_confirm,
    custom_2FA_login,
)

from aimmo.urls import HOMEPAGE_REGEX

js_info_dict = {"packages": ("conf.locale",)}

two_factor_patterns = [
    url(r"^account/login/$", custom_2FA_login, name="login"),
    url(r"", include("two_factor.urls", "two_factor")),
    url(r"^account/two_factor/setup/$", SetupView.as_view(), name="setup"),
    url(r"^account/two_factor/qrcode/$", QRGeneratorView.as_view(), name="qr"),
    url(
        r"^account/two_factor/setup/complete/$",
        SetupCompleteView.as_view(),
        name="setup_complete",
    ),
    url(
        r"^account/two_factor/backup/tokens/$",
        teacher_verified(BackupTokensView.as_view()),
        name="backup_tokens",
    ),
    url(
        r"^account/two_factor/$",
        teacher_verified(ProfileView.as_view()),
        name="profile",
    ),
Esempio n. 9
0
    teacher_onboarding_edit_class,
    teacher_print_reminder_cards,
    teacher_student_reset,
    teacher_view_class,
)
from portal.views.teacher.teacher_materials import materials
from portal.views.teacher.teacher_resources import teacher_resources
from portal.views.terms import terms

js_info_dict = {"packages": ("conf.locale", )}

two_factor_patterns = [
    url(r"^account/login/$", LoginView.as_view(), name="login"),
    url(r"", include(two_factor_urls, "two_factor")),
    url(r"^account/two_factor/setup/$", SetupView.as_view(), name="setup"),
    url(r"^account/two_factor/qrcode/$", QRGeneratorView.as_view(), name="qr"),
    url(
        r"^account/two_factor/setup/complete/$",
        SetupCompleteView.as_view(),
        name="setup_complete",
    ),
    url(
        r"^account/two_factor/backup/tokens/$",
        teacher_verified(BackupTokensView.as_view()),
        name="backup_tokens",
    ),
    url(
        r"^account/two_factor/$",
        teacher_verified(ProfileView.as_view()),
        name="profile",
    ),
Esempio n. 10
0
from two_factor.views import QRGeneratorView

urlpatterns = patterns(
    "",
    url(r"^$", profile, {}),
    url(r"^newapikey/$", newapikey, {}),
    url(r"^deleteapikey/(?P<key_id>\d+)/$", deleteapikey, {}),
    url(r"^logout/$", "django.contrib.auth.views.logout", {"next_page": settings.RATTIC_ROOT_URL}),
    # View to kill other sessions with
    url(r"^killsession/(?P<pk>\w+)/", RatticSessionDeleteView.as_view(), name="kill_session"),
    # Two Factor Views
    url(r"^login/$", RatticTFALoginView.as_view(), name="login"),
    url(r"^two_factor/disable/$", RatticTFADisableView.as_view(), name="tfa_disable"),
    url(r"^two_factor/backup/$", RatticTFABackupTokensView.as_view(), name="tfa_backup"),
    url(r"^two_factor/setup/$", RatticTFASetupView.as_view(), name="tfa_setup"),
    url(r"^two_factor/qr/$", QRGeneratorView.as_view(), name="tfa_qr"),
)

# URLs we don't want enabled with LDAP
if not settings.LDAP_ENABLED:
    urlpatterns += (
        url(
            r"^reset/$",
            "django.contrib.auth.views.password_reset",
            {"post_reset_redirect": "/account/reset/done/", "template_name": "password_reset.html"},
            name="password_reset",
        ),
        url(
            r"^reset/done/$",
            "django.contrib.auth.views.password_reset_done",
            {"template_name": "password_reset_done.html"},
Esempio n. 11
0

app_name = "account"

urlpatterns = [
    path("", profile, {}, name="profile"),
    path("newapikey/", newapikey, {}, name="new_api_key"),
    path("deleteapikey/<int:key_id>/", deleteapikey, {}, name="delete_api_key"),
    path("login/", RatticTFALoginView.as_view(), name="login"),
    path("logout/", LogoutView.as_view(), {"next_page": settings.LOGIN_URL}, name="logout",),
    path("killsession/<slug:session_id>/", RatticSessionDeleteView, name="kill_session"),
    path("generate_api_key", RatticTFAGenerateApiKey.as_view(), name="generate_api_key"),
    path("two_factor/disable/", RatticTFADisableView.as_view(), name="tfa_disable"),
    path("two_factor/backup/", RatticTFABackupTokensView.as_view(), name="tfa_backup"),
    path("two_factor/setup/", RatticTFASetupView.as_view(), name="tfa_setup"),
    path("two_factor/qr/", QRGeneratorView.as_view(), name="tfa_qr"),
]

# URLs we don't want enabled with LDAP
if not settings.LDAP_ENABLED and not settings.SSO_ENABLED or settings.DEBUG:
    urlpatterns += [
        path("reset/", PasswordResetView.as_view(), {
            "post_reset_redirect": "/account/reset/done/",
            "template_name": "password_reset.html",
        },
        name="password_reset",),
        path(
            "reset/done/",
            PasswordChangeDoneView.as_view(),
            {"template_name": "password_reset_done.html"},
            name="password_reset_done",