Fixed a few bugs with initial deployment
authorDan
Sat, 29 May 2010 04:35:49 -0400
changeset 36 f2aa4bc50d2f
parent 35 03d6287d4a8b
child 37 5e946a3f405b
Fixed a few bugs with initial deployment
plugins/yubikey/corelib.php
--- a/plugins/yubikey/corelib.php	Fri Dec 18 19:29:33 2009 -0500
+++ b/plugins/yubikey/corelib.php	Sat May 29 04:35:49 2010 -0400
@@ -49,7 +49,8 @@
 {
   $api_key = getConfig('yubikey_api_key');
   $api_id  = getConfig('yubikey_api_key_id');
-  if ( !$api_key || !$api_id )
+  // Don't require an API key or user ID to be installed if we're using local YMS
+  if ( !(getConfig('yubikey_use_local_yms', 0) && defined('YMS_INSTALLED')) && (!$api_key || !$api_id) )
   {
     return array(
         'success' => false,
@@ -291,6 +292,8 @@
     list($yk_enabled, $user_flags) = $db->fetchrow_num();
     $db->free_result();
   }
+  $yk_enabled = intval($yk_enabled);
+  $user_flags = intval($user_flags);
   
   $template->add_header('<script type="text/javascript">var yk_reg_require_otp = ' . getConfig('yubikey_reg_require_otp', '0') . '; var yk_user_enabled = ' . $yk_enabled . '; var yk_user_flags = ' . $user_flags . ';</script>');
 }