X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=authserver%2Fusercmd.php;h=aad5e3a14da552e76cc146c4ab98cdb20c3681ca;hp=e58cd65c385ba1d39ec38bc9694b92851a4693b4;hb=34cbcba6d0f7c0a92c849545712cc5ce7ec03f97;hpb=07e42724b584df5d317a72b0e0ed1bafbc744b8f diff --git a/authserver/usercmd.php b/authserver/usercmd.php index e58cd65..aad5e3a 100644 --- a/authserver/usercmd.php +++ b/authserver/usercmd.php @@ -35,10 +35,22 @@ if(!isset($argv[1])) { echo "\tsettoken: settoken - sets the key (hex) for a token\n"; echo "\tsettype: settype - sets a token type for a user\n"; echo "\tgetusers: getusers - gets a list of users\n"; + echo "\tgetotk: getotk - gets the OTK png for a key\n"; return 0; } switch($argv[1]) { + case "getotk": + $val = $myAC->getOtkPng($argv[2]); + if($val === false) { + echo "Failure\n"; + } else { + $hand = fopen("val.png", "w"); + fwrite($hand, $val); + fclose($hand); + echo "In val.png\n"; + } + break; case "auth": if($myAC->authUserToken($argv[2], $argv[3])==1) { echo "Pass!\n";