plugins/yubikey/corelib.php
changeset 19 3a791f3f4b91
parent 18 dd8c53454f31
child 20 5a359c7ebc48
equal deleted inserted replaced
18:dd8c53454f31 19:3a791f3f4b91
   199 function yubikey_verify_timestamp($timestamp)
   199 function yubikey_verify_timestamp($timestamp)
   200 {
   200 {
   201   $tolerance = intval(getConfig('yubikey_api_ts_tolerance', 150));
   201   $tolerance = intval(getConfig('yubikey_api_ts_tolerance', 150));
   202   
   202   
   203   $now = time();
   203   $now = time();
   204   $timestamp = preg_replace('/Z[0-9]{3}$/', '', $timestamp);
   204   $timestamp = preg_replace('/Z[0-9]{3,5}$/', '', $timestamp);
   205   $timestamp_seconds = strtotime($timestamp);
   205   $timestamp_seconds = strtotime($timestamp);
   206 
   206 
   207   if ( !$timestamp || !$now )
   207   if ( !$timestamp || !$now )
   208   {
   208   {
   209     return false;
   209     return false;