<?php
include_once('tiki-setup.php');
include_once('lib/trackers/trackerlib.php');
if (empty($_REQUEST['group'])) {
	$smarty->assign('msg', tra('You must specify a group'));
	$smarty->display("error.tpl");
	die;
}
if (!($tracker = $userlib->get_usertrackerid($_REQUEST['group']))) {
	$smarty->assign('msg', tra('The group has no user tracker'));
	$smarty->display("error.tpl");
	die;
}
	
$trackerId = $tracker['usersTrackerId'];
$fieldId = $tracker['usersFieldId'];

$users = $userlib->get_group_users($_REQUEST['group']);
$ok = 0;
$error = 0;
foreach ($users as $u) {
	if (!($itemId = $trklib->get_item_id($trackerId, $fieldId, $u))) {
		$info = $userlib->get_user_info($u);
		echo "$u has no tracker - created ".date('r', $info['created'])."<br />";
		++$error;
	} else
		++$ok;
}
echo "$ok users have a usertracker. $error users have no usertracker";
?>