Sorted it.
On line 96 of /etc/inc/ipsec.auth-user.php it reads:
$userGroups = getUserGroups($username, $authcfg, array());
Where it should read:
$userGroups = getUserGroups($username, $authcfg, $attributes = array());
To abide by PHP referenced variable.