Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
aa46b95e
Commit
aa46b95e
authored
Oct 09, 2016
by
Julian Rother
Browse files
Basic integration of video permission errors into player page (
#48
)
parent
bc071d3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
aa46b95e
...
...
@@ -129,8 +129,8 @@ def authdescr(auths):
return
'rwth'
,
'Nur für RWTH-Angehörige verfügbar'
if
l2p_courses
:
if
password
:
return
'
rwth
'
,
'Nur für Teilnehmer der Veranstaltung und Nutzer mit Passwort verfügbar'
return
'
rwth
'
,
'Nur für Teilnehmer der Veranstaltung verfügbar'
return
'
l2p
'
,
'Nur für Teilnehmer der Veranstaltung und Nutzer mit Passwort verfügbar'
return
'
l2p
'
,
'Nur für Teilnehmer der Veranstaltung verfügbar'
if
password
:
return
'password'
,
'Nur für Nutzer mit Passwort verfügbar'
return
'public'
,
'Öffentlich verfügbar'
...
...
@@ -295,12 +295,22 @@ def lecture(id):
WHERE videos.lecture_id = ? AND (? OR videos.visible)
ORDER BY formats.prio DESC
'''
,
lecture
[
'course_id'
],
lecture
[
'id'
],
ismod
())
auths
=
query
(
'SELECT auth.* FROM auth WHERE (auth.lecture_id = ? OR auth.course_id = ?)'
,
lecture
[
'id'
],
lecture
[
'course_id'
])
if
not
videos
:
flash
(
'Zu dieser Vorlesung wurden noch keine Videos veröffentlicht!'
)
course
=
query
(
'SELECT * FROM courses WHERE id = ? AND (? OR (visible AND listed))'
,
lecture
[
'course_id'
],
ismod
())[
0
]
if
not
course
:
return
render_endpoint
(
'course'
,
'Diese Veranstaltung existiert nicht!'
),
404
chapters
=
query
(
'SELECT * FROM chapters WHERE lecture_id = ? AND NOT deleted AND (? OR visible) ORDER BY time ASC'
,
id
,
ismod
())
if
not
checkauth
(
auths
):
mode
,
text
=
authdescr
(
auths
)
if
mode
==
'rwth'
:
flash
(
text
+
'. <a target="_blank" href="'
+
url_for
(
'start_rwthauth'
)
+
'">Hier authorisieren</a>.'
)
elif
mode
==
'l2p'
:
flash
(
text
+
'. <a target="_blank" href="'
+
url_for
(
'start_l2pauth'
)
+
'">Hier authorisieren</a>.'
)
else
:
flash
(
text
+
'.'
)
return
render_template
(
'embed.html'
if
request
.
endpoint
==
'embed'
else
'lecture.html'
,
course
=
course
,
lecture
=
lecture
,
videos
=
videos
,
chapters
=
chapters
)
...
...
@@ -436,6 +446,7 @@ def auth(): # For use with nginx auth_request
AND (? OR (courses.visible AND lectures.visible AND videos.visible))
ORDER BY auth.video_id DESC, auth.lecture_id DESC, auth.course_id DESC'''
,
url
,
ismod
())
if
not
videos
:
return
"Not allowed"
,
403
auth
=
request
.
authorization
...
...
templates/base.html
View file @
aa46b95e
...
...
@@ -106,7 +106,7 @@
<div
class=
"col-xs-12 col-md-offset-{{ page_border }} col-md-{{ 12-(2*page_border) }}"
>
{% endif %}
{% for msg in get_flashed_messages() %}
<div
class=
"hidden-print alert alert-danger"
role=
"alert"
>
{{ msg }}
</div>
<div
class=
"hidden-print alert alert-danger"
role=
"alert"
>
{{ msg
|safe
}}
</div>
{% endfor %}
{% for msg in get_announcements(min_announcement_level) if (not request.cookies['alert-info-'+msg.id|string]) %}
<div
class=
"hidden-print alert alert-{{levels.get(msg.level, ('info', ''))[0]}}"
role=
"alert"
>
...
...
Write
Preview
Supports
Markdown
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