# HG changeset patch # User Dan # Date 1235629185 18000 # Node ID 6edc6ebb3b39d4131ce04a6bf80dd0143ad58a57 # Parent 86d41fd204a09a9dc448cc62c9eeab41a44f88ea Minor: if input OTP is empty and password looks like OTP, now copies password to OTP in memory and treats password field as OTP. Will require patch in Enano trunk to work for html login. diff -r 86d41fd204a0 -r 6edc6ebb3b39 plugins/yubikey/auth.php --- a/plugins/yubikey/auth.php Thu Feb 26 01:13:25 2009 -0500 +++ b/plugins/yubikey/auth.php Thu Feb 26 01:19:45 2009 -0500 @@ -19,6 +19,12 @@ $auth_log_prefix = ( $level >= USER_LEVEL_CHPREF ) ? 'admin_' : ''; + // Sort of a hack: if the password looks like an OTP and the OTP field is empty, use the password as the OTP + if ( empty($userdata['yubikey_otp']) && preg_match('/^[cbdefghijklnrtuv]{44}$/', $userdata['password'] ) ) + { + $userdata['yubikey_otp'] = $userdata['password']; + } + if ( !empty($userdata['username']) ) { // get flags