Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
5a2f157f
Commit
5a2f157f
authored
Dec 01, 2018
by
XuYS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新登录页跳转
parent
f5030721
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
22 deletions
+25
-22
cms/djangoapps/contentstore/views/public.py
+25
-22
No files found.
cms/djangoapps/contentstore/views/public.py
View file @
5a2f157f
...
@@ -39,29 +39,32 @@ def login_page(request):
...
@@ -39,29 +39,32 @@ def login_page(request):
"""
"""
Display the login form.
Display the login form.
"""
"""
csrf_token
=
csrf
(
request
)[
'csrf_token'
]
if
request
.
user
.
is_authenticated
():
if
(
settings
.
FEATURES
[
'AUTH_USE_CERTIFICATES'
]
and
return
redirect
(
'/home/'
)
ssl_get_cert_from_request
(
request
)):
else
:
# SSL login doesn't require a login view, so redirect
csrf_token
=
csrf
(
request
)[
'csrf_token'
]
# to course now that the user is authenticated via
if
(
settings
.
FEATURES
[
'AUTH_USE_CERTIFICATES'
]
and
# the decorator.
ssl_get_cert_from_request
(
request
)):
next_url
=
request
.
GET
.
get
(
'next'
)
# SSL login doesn't require a login view, so redirect
if
next_url
:
# to course now that the user is authenticated via
return
redirect
(
next_url
)
# the decorator.
else
:
next_url
=
request
.
GET
.
get
(
'next'
)
return
redirect
(
'/course/'
)
if
next_url
:
if
settings
.
FEATURES
.
get
(
'AUTH_USE_CAS'
):
return
redirect
(
next_url
)
# If CAS is enabled, redirect auth handling to there
else
:
return
redirect
(
reverse
(
'cas-login'
))
return
redirect
(
'/course/'
)
if
settings
.
FEATURES
.
get
(
'AUTH_USE_CAS'
):
# If CAS is enabled, redirect auth handling to there
return
redirect
(
reverse
(
'cas-login'
))
return
render_to_response
(
return
render_to_response
(
'login.html'
,
'login.html'
,
{
{
'csrf'
:
csrf_token
,
'csrf'
:
csrf_token
,
'forgot_password_link'
:
"//{base}/login#forgot-password-modal"
.
format
(
base
=
settings
.
LMS_BASE
),
'forgot_password_link'
:
"//{base}/login#forgot-password-modal"
.
format
(
base
=
settings
.
LMS_BASE
),
'platform_name'
:
configuration_helpers
.
get_value
(
'platform_name'
,
settings
.
PLATFORM_NAME
),
'platform_name'
:
configuration_helpers
.
get_value
(
'platform_name'
,
settings
.
PLATFORM_NAME
),
}
}
)
)
def
howitworks
(
request
):
def
howitworks
(
request
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment