Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
User expired
tcexam_uibk
Commits
53fdfaff
Commit
53fdfaff
authored
Apr 05, 2017
by
Ewald
Browse files
corrections to decrease database traffic
parent
e19bfeee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
shared/code/tce_functions_authorization.php
shared/code/tce_functions_authorization.php
+4
-4
No files found.
shared/code/tce_functions_authorization.php
100755 → 100644
View file @
53fdfaff
...
...
@@ -189,7 +189,7 @@ function F_isAuthorizedUser($table, $field_id_name, $value_id, $field_user_id) {
$field_user_id
=
F_escape_sql
(
$db
,
$field_user_id
);
$user_id
=
intval
(
$_SESSION
[
'session_user_id'
]);
// check for administrator
if
(
defined
(
'K_AUTH_
ADMINISTRATOR
'
)
AND
(
$_SESSION
[
'session_user_level'
]
>=
K_AUTH_
ADMINISTRATOR
))
{
if
(
defined
(
'K_AUTH_
BACKOFFICE
'
)
AND
(
$_SESSION
[
'session_user_level'
]
>=
K_AUTH_
BACKOFFICE
))
{
return
true
;
}
// check for original author
...
...
@@ -209,7 +209,7 @@ function F_isAuthorizedUser($table, $field_id_name, $value_id, $field_user_id) {
}
if
((
$author_id
>
1
)
AND
(
F_count_rows
(
K_TABLE_USERGROUP
.
' LEFT JOIN '
.
K_TABLE_GROUPS
.
' ON usrgrp_group_id = group_id
WHERE usrgrp_user_id = '
.
$user_id
.
'
AND group_type = \'B\'
WHERE usrgrp_user_id = '
.
$user_id
.
'
LIMIT 1'
)
>
0
))
{
return
true
;
}
...
...
@@ -229,11 +229,11 @@ function F_getAuthorizedUsers($user_id) {
$str
=
''
;
// string to return
$user_id
=
intval
(
$user_id
);
$sql1
=
'SELECT usrgrp_group_id FROM '
.
K_TABLE_USERGROUP
.
' LEFT JOIN '
.
K_TABLE_GROUPS
.
' ON usrgrp_group_id = group_id
WHERE usrgrp_user_id = '
.
$user_id
.
' AND group_type = \'B\' '
;
WHERE usrgrp_user_id = '
.
$user_id
.
' AND group_type = \'B\'
AND group_id > 1
'
;
$sql
=
'SELECT tb.usrgrp_user_id
FROM '
.
K_TABLE_USERGROUP
.
' AS ta, '
.
K_TABLE_USERGROUP
.
' AS tb
WHERE ta.usrgrp_group_id=tb.usrgrp_group_id
AND ta.usrgrp_group_id IN ('
.
$sql1
.
')'
;
AND ta.usrgrp_group_id IN ('
.
$sql1
.
')'
;
if
(
$r
=
F_db_query
(
$sql
,
$db
))
{
while
(
$m
=
F_db_fetch_array
(
$r
))
{
$str
.
=
$m
[
0
]
.
','
;
...
...
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