<?php

function fusioncore_users(&$raw_data) {

    $users = array();

    if (isset($raw_data['users'])) {

        $users = $raw_data['users'];

    } else if (isset($raw_data['userlist'])) {

        $users = $raw_data['userlist']['user'];

        if ($raw_data['userlist']['recordcount'] == 1)
            $users = array($users);
    }

    return array('users' => $users);
}

function nls_users(&$raw_data) {

	$users = array();

	foreach ($raw_data as $index => $data) {
		$users[$data['id']] = $data['username'];
	}

	return array('nls_users' => $users);
}