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
92c7ba51
Commit
92c7ba51
authored
Dec 16, 2009
by
Richard Mansfield
Browse files
Check user is not deleted on form submission (bug #494484)
Signed-off-by:
Richard Mansfield
<
richardm@catalyst.net.nz
>
parent
50329033
Changes
1
Show whitespace changes
Inline
Side-by-side
htdocs/lib/mahara.php
View file @
92c7ba51
...
...
@@ -1346,15 +1346,21 @@ function pieform_validate(Pieform $form, $values) {
throw
new
UserException
(
'Invalid session key'
);
}
// Check to make sure the user has not been suspended, so that they cannot
// Check to make sure the user has not been suspended
or deleted
, so that they cannot
// perform any action
if
(
$USER
)
{
$record
=
get_record_sql
(
'SELECT suspendedctime, suspendedreason
$record
=
get_record_sql
(
'SELECT suspendedctime, suspendedreason
, deleted
FROM {usr}
WHERE id = ?'
,
array
(
$USER
->
get
(
'id'
)));
if
(
$record
&&
$record
->
suspendedctime
)
{
if
(
$record
)
{
if
(
$record
->
suspendedctime
)
{
throw
new
UserException
(
get_string
(
'accountsuspended'
,
'mahara'
,
$record
->
suspendedctime
,
$record
->
suspendedreason
));
}
if
(
$record
->
deleted
)
{
$USER
->
logout
();
throw
new
AccessDeniedException
(
get_string
(
'accountdeleted'
,
'mahara'
));
}
}
}
}
...
...
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