} elseif (isFormSent()) {
// Try the login (see inc/libs/user_functions.php)
$url = doUserLogin(postRequestElement('id'), postRequestElement('password'));
-} elseif ((isPostRequestElementSet('new_pass')) && (isset($userid))) {
+} elseif ((isPostRequestElementSet('new_pass')) && (!empty($userid))) {
// Try the userid/email lookup (see inc/libs/user_functions.php)
$errorCode = doNewUserPassword(postRequestElement('email'), $userid);
}