two factor authentication essental elements

This commit is contained in:
Andy Miller
2017-08-25 16:20:57 -06:00
parent c2f81fd26d
commit 8658466e8d
322 changed files with 5904 additions and 892 deletions

View File

@@ -0,0 +1,15 @@
<?php
namespace RobThree\Auth\Providers\Time;
class ConvertUnixTimeDotComTimeProvider implements ITimeProvider
{
public function getTime() {
$json = @json_decode(
@file_get_contents('http://www.convert-unix-time.com/api?timestamp=now')
);
if ($json === null || !is_int($json->timestamp))
throw new \TimeException('Unable to retrieve time from convert-unix-time.com');
return $json->timestamp;
}
}