You are here

function auth0_pipeListToArray in Auth0 Single Sign On 7.2

2 calls to auth0_pipeListToArray()
auth0_update_fields in ./auth0.module
auth0_update_roles in ./auth0.module
Updates the $user->roles of a user based on the auth0 role mappings

File

./auth0.module, line 520

Code

function auth0_pipeListToArray($mapping_list_txt, $make_item0_lowercase = FALSE) {
  $result_array = array();
  $mappings = preg_split('/[\\n\\r]+/', $mapping_list_txt);
  foreach ($mappings as $line) {
    if (count($mapping = explode('|', trim($line))) == 2) {
      $item_0 = $make_item0_lowercase ? drupal_strtolower(trim($mapping[0])) : trim($mapping[0]);
      $result_array[] = array(
        $item_0,
        trim($mapping[1]),
      );
    }
  }
  return $result_array;
}