original_string: function ldap_attributes () {
          $moodleattributes = array();
          // If we have custom fields then merge them with user fields.
          $customfields = $this->get_custom_user_profile_fields();
          if (!empty($customfields) && !empty($this->userfields)) {
              $userfields = array_merge($this->userfields, $customfields);
          } else {
              $userfields = $this->userfields;
          }
  
          foreach ($userfields as $field) {
              if (!empty($this->config->{"field_map_$field"})) {
                  $moodleattributes[$field] = core_text::strtolower(trim($this->config->{"field_map_$field"}));
                  if (preg_match('/,/', $moodleattributes[$field])) {
                      $moodleattributes[$field] = explode(',', $moodleattributes[$field]); // split ?
                  }
              }
          }
          $moodleattributes['username'] = core_text::strtolower(trim($this->config->user_attribute));
          $moodleattributes['suspended'] = core_text::strtolower(trim($this->config->suspended_attribute));
          return $moodleattributes;
      }
code: function ldap_attributes () {
          $moodleattributes = array();
          // If we have custom fields then merge them with user fields.
          $customfields = $this->get_custom_user_profile_fields();
          if (!empty($customfields) && !empty($this->userfields)) {
              $userfields = array_merge($this->userfields, $customfields);
          } else {
              $userfields = $this->userfields;
          }
  
          foreach ($userfields as $field) {
              if (!empty($this->config->{"field_map_$field"})) {
                  $moodleattributes[$field] = core_text::strtolower(trim($this->config->{"field_map_$field"}));
                  if (preg_match('/,/', $moodleattributes[$field])) {
                      $moodleattributes[$field] = explode(',', $moodleattributes[$field]); // split ?
                  }
              }
          }
          $moodleattributes['username'] = core_text::strtolower(trim($this->config->user_attribute));
          $moodleattributes['suspended'] = core_text::strtolower(trim($this->config->suspended_attribute));
          return $moodleattributes;
      }
code_tokens: function ldap_attributes ( ) { $ moodleattributes = array ( ) ; // If we have custom fields then merge them with user fields. $ customfields = $ this -> get_custom_user_profile_fields ( ) ; if ( ! empty ( $ customfields ) && ! empty ( $ this -> userfields ) ) { $ userfields = array_merge ( $ this -> userfields , $ customfields ) ; } else { $ userfields = $ this -> userfields ; } foreach ( $ userfields as $ field ) { if ( ! empty ( $ this -> config -> { "field_map_$field" } ) ) { $ moodleattributes [ $ field ] = core_text :: strtolower ( trim ( $ this -> config -> { "field_map_$field" } ) ) ; if ( preg_match ( '/,/' , $ moodleattributes [ $ field ] ) ) { $ moodleattributes [ $ field ] = explode ( ',' , $ moodleattributes [ $ field ] ) ; // split ? } } } $ moodleattributes [ 'username' ] = core_text :: strtolower ( trim ( $ this -> config -> user_attribute ) ) ; $ moodleattributes [ 'suspended' ] = core_text :: strtolower ( trim ( $ this -> config -> suspended_attribute ) ) ; return $ moodleattributes ; }
docstring: Returns user attribute mappings between moodle and LDAP
  
  @return array
docstring_tokens: Returns user attribute mappings between moodle and LDAP