<?php
/*
* Copyright (c) 2009-2010 ATMAIL. All rights reserved
* See http://atmail.com/license.php for license agreement
*/

/*
* CalDAV test
*
*/
include ('../../library/Atmail/CalDav/caldav-client.php');
include ('../../library/Atmail/CalDav/caldav-support.php');

if($argc != 5)
	die("This utility will create fake accounts to test the calendar server.\nUsage: caldav_purge.php mysql_url mysql_table mysql_user amount\n");

print("=== CalDAV Client Populate ===\n");

$username=$argv[3];
$password=readline("password:");
$database=$argv[2];

mysql_connect($argv[1],$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

for($count = 0; $count < $argv[4]; $count ++)
{
	$name = 'easytest' . $count . '@test.com';
	$query = "INSERT INTO UserSession (Account, Password) VALUES ('$name', 'test')";
	mysql_query($query);
}

mysql_close();
