<?php

require_once 'globals.php';


class cryptPasswordCommand extends CConsoleCommand
{
	public function run($args)
	{


		//var_dump($args);
		
		echo "\n######################################################################";
		echo "\n##                                                                  ##";
		echo "\n##                         Crypt Password                           ##";
		echo "\n##                                                                  ##";
		echo "\n######################################################################";
		echo "\n";
		echo "\n";
		


		//echo array_search('/?', $args) ;
		
		if(count($args) <= 0 || array_search('/?', $args) != FALSE || array_search('-?', $args) != FALSE)
		{
			
			if(count($args) <= 1)
				echo "\n Please specify one or more arguments!";
			
			return 0;
		}
		
		
		echo "Key   = $args[0]\n";
		echo "value = $args[1]\n";
		
		kria_save_secret($args[0],  $args[1]);
		
		echo "\n done";

		
		return 0;
		
	}
	
}
?>