Skip to content
GitLab
Menu
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
73b2c1a2
Commit
73b2c1a2
authored
Mar 19, 2008
by
Nigel McNie
Browse files
Use user_can_access_group() to check whether the user viewing a view is allowed to upload feedback.
This lets admins, etc. upload feedback too.
parent
d6596676
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/view/view.php
View file @
73b2c1a2
...
@@ -32,6 +32,7 @@ define('SECTION_PAGE', 'view');
...
@@ -32,6 +32,7 @@ define('SECTION_PAGE', 'view');
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
require
(
get_config
(
'libroot'
)
.
'view.php'
);
require
(
get_config
(
'libroot'
)
.
'view.php'
);
require
(
'group.php'
);
$viewid
=
param_integer
(
'id'
);
$viewid
=
param_integer
(
'id'
);
$new
=
param_boolean
(
'new'
);
$new
=
param_boolean
(
'new'
);
...
@@ -52,12 +53,8 @@ $heading .= ' ' . get_string('by', 'view') . ' <a href="' . get_config('wwwroot'
...
@@ -52,12 +53,8 @@ $heading .= ' ' . get_string('by', 'view') . ' <a href="' . get_config('wwwroot'
$tutorfilefeedbackformrow
=
''
;
$tutorfilefeedbackformrow
=
''
;
$submittedgroup
=
$view
->
get
(
'submittedto'
);
$submittedgroup
=
(
int
)
$view
->
get
(
'submittedto'
);
if
(
$submittedgroup
if
(
$submittedgroup
&&
(
user_can_access_group
(
$submittedgroup
)
&
GROUP_MEMBERSHIP_TUTOR
))
{
&&
record_exists
(
'group_member'
,
'group'
,
$submittedgroup
,
'member'
,
$USER
->
get
(
'id'
),
'tutor'
,
1
))
{
// The user is a tutor of the group that this view has
// The user is a tutor of the group that this view has
// been submitted to, and is entitled to upload an additional
// been submitted to, and is entitled to upload an additional
// file when submitting feedback.
// file when submitting feedback.
...
...
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