Commit 3e78c4b2 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Fix up various form submission warnings

parent 00ce9fd9
......@@ -837,7 +837,7 @@ function password_validate(Pieform $form, $values, $username, $institution) {
}
// No Mike, that's a _BAD_ Mike! :)
if ($values['password1'] == 'mike01' || $values['password'] == 'mike012') {
if ($values['password1'] == 'mike01' || $values['password1'] == 'mike012') {
if (!$form->get_property('jsform')) {
die_info('<img src="'
. theme_get_image_url('images/sidebox1_corner_botright.gif')
......@@ -889,11 +889,13 @@ function pieform_validate(Pieform $form, $values) {
// Check to make sure the user has not been suspended, so that they cannot
// perform any action
$record = get_record_sql('SELECT suspendedctime, suspendedreason
FROM ' . get_config('dbprefix') . 'usr
WHERE id = ?', array($USER->get('id')));
if ($record->suspendedctime) {
throw new UserException(get_string('accountsuspended', 'mahara', $record->suspendedctime, $record->suspendedreason));
if ($USER) {
$record = get_record_sql('SELECT suspendedctime, suspendedreason
FROM ' . get_config('dbprefix') . 'usr
WHERE id = ?', array($USER->get('id')));
if ($record && $record->suspendedctime) {
throw new UserException(get_string('accountsuspended', 'mahara', $record->suspendedctime, $record->suspendedreason));
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment