plugins/yubikey/auth.php
changeset 2 6edc6ebb3b39
parent 0 9d2c4f04a0d0
child 3 d0fe7acaf0e8
--- 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