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
32c6b250
Commit
32c6b250
authored
Jun 14, 2013
by
Jason Bau
Committed by
Joe Blaylock
Jun 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn off Agreement to Terms of Service for Stanford shib
As stipulated by Stanford's office of general counsel
parent
3f810add
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletions
+21
-1
common/djangoapps/external_auth/views.py
+5
-0
common/djangoapps/student/views.py
+11
-1
lms/templates/register.html
+5
-0
No files found.
common/djangoapps/external_auth/views.py
View file @
32c6b250
...
@@ -239,8 +239,13 @@ def signup(request, eamap=None):
...
@@ -239,8 +239,13 @@ def signup(request, eamap=None):
'extauth_email'
:
eamap
.
external_email
,
'extauth_email'
:
eamap
.
external_email
,
'extauth_username'
:
username
,
'extauth_username'
:
username
,
'extauth_name'
:
eamap
.
external_name
,
'extauth_name'
:
eamap
.
external_name
,
'ask_for_tos'
:
True
,
}
}
# Can't have terms of service for Stanford users, according to Stanford's Office of General Counsel
if
settings
.
MITX_FEATURES
[
'AUTH_USE_SHIB'
]
and
(
'stanford'
in
eamap
.
external_domain
):
context
[
'ask_for_tos'
]
=
False
# detect if full name is blank and ask for it from user
# detect if full name is blank and ask for it from user
context
[
'ask_for_fullname'
]
=
eamap
.
external_name
.
strip
()
==
''
context
[
'ask_for_fullname'
]
=
eamap
.
external_name
.
strip
()
==
''
...
...
common/djangoapps/student/views.py
View file @
32c6b250
...
@@ -613,6 +613,10 @@ def create_account(request, post_override=None):
...
@@ -613,6 +613,10 @@ def create_account(request, post_override=None):
js
[
'field'
]
=
'honor_code'
js
[
'field'
]
=
'honor_code'
return
HttpResponse
(
json
.
dumps
(
js
))
return
HttpResponse
(
json
.
dumps
(
js
))
# Can't have terms of service for Stanford users, according to Stanford's Office of General Counsel
if
settings
.
MITX_FEATURES
.
get
(
"AUTH_USE_SHIB"
)
and
DoExternalAuth
and
(
"stanford"
in
eamap
.
external_domain
):
pass
else
:
if
post_vars
.
get
(
'terms_of_service'
,
'false'
)
!=
u'true'
:
if
post_vars
.
get
(
'terms_of_service'
,
'false'
)
!=
u'true'
:
js
[
'value'
]
=
"You must accept the terms of service."
.
format
(
field
=
a
)
js
[
'value'
]
=
"You must accept the terms of service."
.
format
(
field
=
a
)
js
[
'field'
]
=
'terms_of_service'
js
[
'field'
]
=
'terms_of_service'
...
@@ -623,7 +627,13 @@ def create_account(request, post_override=None):
...
@@ -623,7 +627,13 @@ def create_account(request, post_override=None):
# TODO: Confirm e-mail is not from a generic domain (mailinator, etc.)? Not sure if
# TODO: Confirm e-mail is not from a generic domain (mailinator, etc.)? Not sure if
# this is a good idea
# this is a good idea
# TODO: Check password is sane
# TODO: Check password is sane
for
a
in
[
'username'
,
'email'
,
'name'
,
'password'
,
'terms_of_service'
,
'honor_code'
]:
required_post_vars
=
[
'username'
,
'email'
,
'name'
,
'password'
,
'terms_of_service'
,
'honor_code'
]
if
settings
.
MITX_FEATURES
.
get
(
"AUTH_USE_SHIB"
)
and
DoExternalAuth
and
(
"stanford"
in
eamap
.
external_domain
):
# Can't have terms of service for Stanford users, according to Stanford's Office of General Counsel
required_post_vars
=
[
'username'
,
'email'
,
'name'
,
'password'
,
'honor_code'
]
for
a
in
required_post_vars
:
if
len
(
post_vars
[
a
])
<
2
:
if
len
(
post_vars
[
a
])
<
2
:
error_str
=
{
'username'
:
'Username must be minimum of two characters long.'
,
error_str
=
{
'username'
:
'Username must be minimum of two characters long.'
,
'email'
:
'A properly formatted e-mail is required.'
,
'email'
:
'A properly formatted e-mail is required.'
,
...
...
lms/templates/register.html
View file @
32c6b250
...
@@ -231,11 +231,16 @@
...
@@ -231,11 +231,16 @@
<ol
class=
"list-input"
>
<ol
class=
"list-input"
>
<li
class=
"field-group"
>
<li
class=
"field-group"
>
% if has_extauth_info is UNDEFINED or ask_for_tos :
<div
class=
"field required checkbox"
id=
"field-tos"
>
<div
class=
"field required checkbox"
id=
"field-tos"
>
<input
id=
"tos-yes"
type=
"checkbox"
name=
"terms_of_service"
value=
"true"
required
aria-required=
"true"
/>
<input
id=
"tos-yes"
type=
"checkbox"
name=
"terms_of_service"
value=
"true"
required
aria-required=
"true"
/>
<label
for=
"tos-yes"
>
I agree to the
<a
href=
"${marketing_link('TOS')}"
class=
"new-vp"
>
Terms of Service
</a></label>
<label
for=
"tos-yes"
>
I agree to the
<a
href=
"${marketing_link('TOS')}"
class=
"new-vp"
>
Terms of Service
</a></label>
</div>
</div>
% endif
<div
class=
"field required checkbox"
id=
"field-honorcode"
>
<div
class=
"field required checkbox"
id=
"field-honorcode"
>
<input
id=
"honorcode-yes"
type=
"checkbox"
name=
"honor_code"
value=
"true"
/>
<input
id=
"honorcode-yes"
type=
"checkbox"
name=
"honor_code"
value=
"true"
/>
<
%
<
%
...
...
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