summaryrefslogtreecommitdiff
path: root/apps/um/views/pages/users/individual.json.php
blob: c3dee50ed7510d5b5e8a50e858ed406bbd6973fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php global $VARS, $CONTACT_METHODS;
$t = $VARS['template'];
$users = $VARS['users'];
$username = $VARS['username'];

$json = array();

foreach ($users as $user_obj) {
	$user_json = array();
	$user_json['username'] = $user_obj->getName();
	$user_json['uid'] = $user_obj->getUID();
	foreach ($CONTACT_METHODS as $method) {
		$field = $method->addr_slug;
		$user_json[$field] = $user_obj->getConf($field);
	}
	foreach ($VARS['config_options'] as $groupname=>$options) {
		foreach ($options as $option) {
			$fieldname = $option[0];
			$fieldlabel = $option[1];
			$fieldtype = $option[2];
			$user_json[$fieldname] = $user_obj->getConf($fieldname);
		}
	}
	$json[] = $user_json;
}

echo json_encode($json);