Comment 0 for bug 1636854

Revision history for this message
Kevin Rickis (rdx565) wrote :

Hi

I'm trying a clean install of Mahara 16.10.0 and I'm getting this error.

Parse error: syntax error, unexpected ''login_submitted'' (T_CONSTANT_ENCAPSED_STRING) in /mnt/data1/www/m1610.edictdev.co.uk/httpdocs/auth/lib.php on line 1443

Looking at the code I think there might have been a copy and paste error as you cannot check for empty('login_submitted'). My guess is that it should be $values?

Function below.

Kevin

/**
 * Called when the login form is being validated during submission.
 * Checks the user and password fields are filled in.
 *
 * @param object $form The Pieform form object
 * @param array $values The submitted values
 */
function login_validate(Pieform $form, $values) {
    if (!empty('login_submitted')) {
        if (empty($values['login_username']) || empty($values['login_password'])) {
            $form->set_error(null, get_string('loginfailed'));
        }
    }
}