-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
193 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import DomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '广东海洋大学'} | ||
provider = 'gdou' | ||
group = 'gdou' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'gdou' | ||
duration = timedelta(hours=1) | ||
validate_identity = DomainEmailValidator(['stu.gdou.edu.cn']) | ||
|
||
|
||
urlpatterns = [ | ||
path('gdou/login/', LoginView.as_view()), | ||
path('gdou/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import DomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '广东工业大学'} | ||
provider = 'gdut' | ||
group = 'gdut' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'gdut' | ||
duration = timedelta(hours=1) | ||
validate_identity = DomainEmailValidator(['mail2.gdut.edu.cn']) | ||
|
||
|
||
urlpatterns = [ | ||
path('gdut/login/', LoginView.as_view()), | ||
path('gdut/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import DomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '广州大学'} | ||
provider = 'gzhu' | ||
group = 'gzhu' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'gzhu' | ||
duration = timedelta(hours=1) | ||
validate_identity = DomainEmailValidator(['e.gzhu.edu.cn']) | ||
|
||
|
||
urlpatterns = [ | ||
path('gzhu/login/', LoginView.as_view()), | ||
path('gzhu/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import UserRegexAndDomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '上海大学'} | ||
provider = 'shu' | ||
group = 'shu' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'shu' | ||
duration = timedelta(hours=1) | ||
validate_identity = UserRegexAndDomainEmailValidator('shu.edu.cn', r'^(?:[a-z]|_|-|\d){3,50}$') | ||
|
||
|
||
urlpatterns = [ | ||
path('shu/login/', LoginView.as_view()), | ||
path('shu/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import DomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '南方科技大学'} | ||
provider = 'sustech' | ||
group = 'sustech' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'sustech' | ||
duration = timedelta(hours=1) | ||
validate_identity = DomainEmailValidator(['sustech.edu.cn', 'mail.sustech.edu.cn']) | ||
|
||
|
||
urlpatterns = [ | ||
path('sustech/login/', LoginView.as_view()), | ||
path('sustech/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import DomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '厦门理工学院'} | ||
provider = 'xmut' | ||
group = 'xmut' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'xmut' | ||
duration = timedelta(hours=1) | ||
validate_identity = DomainEmailValidator(['s.xmut.edu.cn']) | ||
|
||
|
||
urlpatterns = [ | ||
path('xmut/login/', LoginView.as_view()), | ||
path('xmut/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 4.2.5 on 2023-10-09 07:42 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('user', '0014_user_suspicious_ddl_userlog_suspicious_ddl'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='user', | ||
options={'default_permissions': (), 'permissions': [('full', '管理个人信息'), ('view', '查看个人信息'), ('view_ustc', '查看中国科学技术大学个人信息'), ('view_zju', '查看浙江大学个人信息'), ('view_jlu', '查看吉林大学个人信息'), ('view_nuaa', '查看南京航空航天大学个人信息'), ('view_neu', '查看东北大学个人信息'), ('view_sysu', '查看中山大学个人信息'), ('view_xidian', '查看西安电子科技大学个人信息'), ('view_hit', '查看哈尔滨工业大学个人信息'), ('view_nudt', '查看国防科技大学个人信息'), ('view_fdu', '查看复旦大学个人信息'), ('view_tongji', '查看同济大学个人信息'), ('view_gdou', '查看广东海洋大学个人信息'), ('view_gdut', '查看广东工业大学个人信息'), ('view_gzhu', '查看广州大学个人信息'), ('view_sustech', '查看南方科技大学个人信息'), ('view_xmut', '查看厦门理工学院个人信息'), ('view_shu', '查看上海大学个人信息')]}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters