$username = ''; } if (array_key_exists('otp', $_REQUEST)) { $otp = $_REQUEST['otp']; } else { $otp = ''; } if (array_key_exists('password', $_REQUEST)) { $password = $_REQUEST['password']; } else { $password = ''; } $attemptsLeft = NULL; if ($type == 'otp' && !empty($username) && !empty($otp)) { // attempt tiqr otp login $result = sspmod_authTiqr_Auth_Tiqr::processManualLogin($userId, $otp, $state[sspmod_authTiqr_Auth_Tiqr::SESSIONKEYID]); if ($result == "OK") { $url = SimpleSAML_Module::getModuleURL('authTiqr/complete.php'); SimpleSAML_Utilities::redirect($url, array('AuthState' => $authState)); exit; } else { $errorCode = "wrongotp"; if (strpos($result, ":") !== false) { $elems = explode(":", $result); $attemptsLeft = $elems[1]; } } } elseif ($type == 'userpass' && !empty($username) && !empty($password)) { // attempt user-password login $errorCode = sspmod_authTiqr_Auth_Source_TiqrUserPass::handleUserPassLogin($authStateId, $username, $password); } else {