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
6ccf3150
Commit
6ccf3150
authored
Oct 11, 2016
by
Julian Rother
Browse files
Merged auth-columns user, passwd and param
parent
4fd41f9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
db_schema.sql
View file @
6ccf3150
...
...
@@ -107,14 +107,13 @@ CREATE TABLE IF NOT EXISTS `places` (
);
CREATE
TABLE
IF
NOT
EXISTS
`auth_data`
(
`auth_id`
INTEGER
NOT
NULL
PRIMARY
KEY
AUTOINCREMENT
,
`deleted`
INTEGER
NOT
NULL
DEFAULT
'0'
,
`deleted`
INTEGER
NOT
NULL
DEFAULT
'0'
,
`course_id`
INTEGER
,
`lecture_id`
INTEGER
,
`video_id`
INTEGER
,
`auth_type`
varchar
(
10
),
`auth_param`
varchar
(
127
),
`auth_user`
varchar
(
127
),
`auth_passwd`
varchar
(
127
),
`auth_param2`
varchar
(
127
),
`time_created`
datetime
NOT
NULL
,
`time_updated`
datetime
NOT
NULL
,
`created_by`
INTEGER
DEFAULT
NULL
...
...
server.py
View file @
6ccf3150
...
...
@@ -96,7 +96,7 @@ def checkauth(auths, username=None, password=None):
if
auth
[
'auth_type'
]
==
'public'
:
return
True
elif
auth
[
'auth_type'
]
==
'password'
:
if
auth
[
'auth_
user
'
]
==
username
and
auth
[
'auth_pa
ssword
'
]
==
password
:
if
auth
[
'auth_
param
'
]
==
username
and
auth
[
'auth_pa
ram2
'
]
==
password
:
return
True
elif
auth
[
'auth_type'
]
==
'l2p'
:
if
auth
[
'auth_param'
]
in
session
.
get
(
'l2p_courses'
,
[]):
...
...
@@ -390,7 +390,7 @@ tabs = {
[
'created_by'
,
'time_created'
,
'time_updated'
]),
'featured'
:
(
'featured'
,
'id'
,
[
'title'
,
'text'
,
'internal'
,
'visible'
,
'deleted'
],
[
'created_by'
,
'time_created'
,
'time_updated'
]),
'auth'
:
(
'auth_data'
,
'auth_id'
,
[
'auth_type'
,
'auth_
user
'
,
'auth_pa
sswd
'
,
'deleted'
],
'auth'
:
(
'auth_data'
,
'auth_id'
,
[
'auth_type'
,
'auth_
param
'
,
'auth_pa
ram2
'
,
'deleted'
],
[
'course_id'
,
'lecture_id'
,
'video_id'
,
'created_by'
,
'time_created'
,
'time_updated'
]),
'sorterrorlog'
:
(
'sorterrorlog_data'
,
'id'
,
[
'deleted'
],
[
'time_created'
,
'time_updated'
])
...
...
static/moderator.js
View file @
6ccf3150
...
...
@@ -125,11 +125,11 @@ var moderator = {
if
((
moderator
.
acleditor
.
acls
[
i
][
type
+
'
_id
'
]
==
id
))
{
var
auth
=
{};
auth
.
type
=
moderator
.
acleditor
.
acls
[
i
][
'
auth_type
'
];
auth
.
user
=
moderator
.
acleditor
.
acls
[
i
][
'
auth_
user
'
];
auth
.
pa
ssword
=
moderator
.
acleditor
.
acls
[
i
][
'
auth_pa
sswd
'
];
auth
.
param
=
moderator
.
acleditor
.
acls
[
i
][
'
auth_
param
'
];
auth
.
pa
ram2
=
moderator
.
acleditor
.
acls
[
i
][
'
auth_pa
ram2
'
];
auth
.
id
=
moderator
.
acleditor
.
acls
[
i
][
'
auth_id
'
];
idlist
[
idlist
.
length
]
=
auth
.
id
;
html
+=
'
<option data-auth_id="
'
+
auth
.
id
+
'
">#
'
+
auth
.
id
+
'
'
+
auth
.
type
+
'
'
+
(
auth
.
type
==
"
password
"
?
'
("
'
+
auth
.
user
+
'
":"
'
+
auth
.
pa
ssword
+
'
")
'
:
''
)
+
'
</option>
'
;
html
+=
'
<option data-auth_id="
'
+
auth
.
id
+
'
">#
'
+
auth
.
id
+
'
'
+
auth
.
type
+
'
'
+
(
auth
.
type
==
"
password
"
?
'
("
'
+
auth
.
param
+
'
":"
'
+
auth
.
pa
ram2
+
'
")
'
:
''
)
+
'
</option>
'
;
}
}
html
+=
'
</select>
'
;
...
...
@@ -155,18 +155,18 @@ var moderator = {
var
auth
=
{};
auth
.
type
=
$
(
"
.authtype
"
,
element
.
parentElement
).
val
();
if
(
auth
.
type
==
"
password
"
)
{
auth
.
user
=
$
(
"
.authuser
"
,
element
.
parentElement
).
val
();
auth
.
pa
ssword
=
$
(
"
.authpassword
"
,
element
.
parentElement
).
val
();
auth
.
param
=
$
(
"
.authuser
"
,
element
.
parentElement
).
val
();
auth
.
pa
ram2
=
$
(
"
.authpassword
"
,
element
.
parentElement
).
val
();
}
dict
=
{}
dict
[
'
auth_type
'
]
=
auth
.
type
;
dict
[
'
auth_
user
'
]
=
auth
.
user
;
dict
[
'
auth_pa
sswd
'
]
=
auth
.
pa
ssword
;
dict
[
'
auth_
param
'
]
=
auth
.
param
;
dict
[
'
auth_pa
ram2
'
]
=
auth
.
pa
ram2
;
dict
[
$
(
element
.
parentElement
).
data
(
'
type
'
)
+
'
_id
'
]
=
$
(
element
.
parentElement
).
data
(
'
id
'
);
moderator
.
api
.
add_new
(
dict
,
'
auth
'
,
true
);
var
option
=
$
(
'
<option>
'
,
{
"
text
"
:
auth
.
type
+
'
'
+
(
auth
.
type
==
"
password
"
?
'
("
'
+
auth
.
user
+
'
":"
'
+
auth
.
pa
ssword
+
'
")
'
:
''
)
,
"
text
"
:
auth
.
type
+
'
'
+
(
auth
.
type
==
"
password
"
?
'
("
'
+
auth
.
param
+
'
":"
'
+
auth
.
pa
ram2
+
'
")
'
:
''
)
,
"
data-auth
"
:
JSON
.
stringify
(
auth
)
});
$
(
"
.acllist
"
,
element
.
parentElement
).
append
(
option
);
...
...
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