original_string: function user_exists($username) {
          $extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
  
          // Returns true if given username exists on ldap
          $users = $this->ldap_get_userlist('('.$this->config->user_attribute.'='.ldap_filter_addslashes($extusername).')');
          return count($users);
      }
code: function user_exists($username) {
          $extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
  
          // Returns true if given username exists on ldap
          $users = $this->ldap_get_userlist('('.$this->config->user_attribute.'='.ldap_filter_addslashes($extusername).')');
          return count($users);
      }
code_tokens: function user_exists ( $ username ) { $ extusername = core_text :: convert ( $ username , 'utf-8' , $ this -> config -> ldapencoding ) ; // Returns true if given username exists on ldap $ users = $ this -> ldap_get_userlist ( '(' . $ this -> config -> user_attribute . '=' . ldap_filter_addslashes ( $ extusername ) . ')' ) ; return count ( $ users ) ; }
docstring: Checks if user exists on LDAP
  
  @param string $username
docstring_tokens: Checks if user exists on LDAP