functional authd/authclient
[ga4php.git] / authserver / usercmd.php
index e58cd65..aad5e3a 100644 (file)
@@ -35,10 +35,22 @@ if(!isset($argv[1])) {
        echo "\tsettoken: settoken <username> <tokenkey> - sets the key (hex) for a token\n";
        echo "\tsettype: settype <username> <tokentype> - sets a token type for a user\n";
        echo "\tgetusers: getusers - gets a list of users\n";
+       echo "\tgetotk: getotk <username> - 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";