Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
28cdc7d7
Commit
28cdc7d7
authored
Jan 18, 2007
by
Martyn Smith
Committed by
Martyn Smith
Jan 18, 2007
Browse files
Fix view access stuff
parent
8f7d8877
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/mahara.php
View file @
28cdc7d7
...
...
@@ -951,7 +951,7 @@ function can_view_view($view_id, $user_id=null) {
$view_record
=
array
(
'access'
=>
array
()
);
log_debug
(
'Can you look at this view? (you are user '
.
$user_id
.
')'
);
log_debug
(
'Can you look at this view? (you are user '
.
$user_id
.
' trying to look at view '
.
$view_id
.
')'
);
foreach
(
$view_data
as
$row
)
{
$view_record
[
'title'
]
=
$row
->
title
;
...
...
@@ -1042,8 +1042,8 @@ function can_view_view($view_id, $user_id=null) {
'
.
$prefix
.
'view_access_usr a
WHERE
a.view=? AND a.usr=?
AND a.startdate < ?
AND a.stopdate > ?
AND
(
a.startdate < ?
OR a.startdate IS NULL )
AND
(
a.stopdate > ?
OR a.stopdate IS NULL )
LIMIT 1'
,
array
(
$view_id
,
$user_id
,
$dbnow
,
$dbnow
)
)
...
...
@@ -1062,8 +1062,8 @@ function can_view_view($view_id, $user_id=null) {
INNER JOIN '
.
$prefix
.
'usr_group_member m ON g.id = m.grp
WHERE
a.view=? AND m.member=?
AND a.startdate < ?
AND a.stopdate > ?
AND
(
a.startdate < ?
OR a.startdate IS NULL )
AND
(
a.stopdate > ?
OR a.stopdate IS NULL )
LIMIT 1'
,
array
(
$view_id
,
$user_id
,
$dbnow
,
$dbnow
)
)
...
...
@@ -1082,8 +1082,8 @@ function can_view_view($view_id, $user_id=null) {
INNER JOIN '
.
$prefix
.
'community_member m ON c.id=m.community
WHERE
a.view=? AND m.member=?
AND a.startdate < ?
AND a.stopdate > ?
AND
(
a.startdate < ?
OR a.startdate IS NULL )
AND
(
a.stopdate > ?
OR a.stopdate IS NULL )
AND ( a.tutoronly = 0 OR m.tutor = 1 )
LIMIT 1'
,
array
(
$view_id
,
$user_id
,
$dbnow
,
$dbnow
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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