<?php
/**
 * Migrates users from Zimbra to Atmail
 *
 * Useage:
 * php migrate-zimbra.php -u [zimbra admin username] -p [zimbra admin password] -n [zimbra server hostname or IP] -f [data file] -d [default password]
 * 
 * data-file should be created by running the bundled get-user-data.sh on the Zimbra server
 *
 * @author Brad Kowalczyk <brad@staff.atmail.com>
 */     
 
require_once(dirname(dirname(dirname(__FILE__))) . "/nfc-bootloader.php");

$usage = "Usage: php migrate-zimbra.php -u [zimbra admin username] -p [zimbra admin password] -n [zimbra server hostname or IP] -f [data file] -d [default password]\n";

$opt = getopt("u:p:n:f:d:h");

if (isset($opt["h"])) {
    die($usage);
}

$adapter = new Atmail_Migrate_Adapter_Zimbra($opt["u"], $opt["p"], $opt["n"], $opt["f"], $opt["d"]);
$migrate = new Atmail_Migrate($adapter, "server");
$migrate->start();
