$access = array(); if (!is_array($function_params['lists'])) { $access[$function_params['lists']] = 1; } else { foreach ($function_params['lists'] as $listid) { $access[$listid] = 1; } } $user->GrantListAccess($access); } // Check if we need to grant extra templates access to the user if (isset($function_params['templates'])) { $user->RevokeTemplateAccess(); $access = array(); if (!is_array($function_params['templates'])) { $access[$function_params['templates']] = 1; } else { foreach ($function_params['templates'] as $templateid) { $access[$templateid] = 1; } } $user->GrantTemplateAccess($access); } // Check if we need to grant extra segments access to the user if (isset($function_params['segments'])) {