Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7673135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:26:32+00:00 2026-05-31T16:26:32+00:00

I have this issue, I’m have a user selected in LDAP through ldap search,

  • 0

I have this issue, I’m have a user selected in LDAP through ldap search, giving only the attribute of gid.

    $ldapattributes = array("gidnumber");
    $ldapdn = "o=example";
    $ldapfilter = "(sn=".$ldapuname."*)";
    $ldapbind = ldap_bind($ldapconn, $ldapuname, $ldappass) or trigger_error('Could not bind to '.$ldaphost);
    $sr = ldap_search($ldapconn,$ldapbasedn,$ldapfilter,$ldapattributes);
    var_dump($sr);
    $entry = ldap_get_entries($ldapconn, $sr);
    var_dump($entry);

the result i get from the vardump is:

‘gidnumber’ =>
array
‘count’ => int 1
0 => string ‘1617’ (length=4)

I know 1617 is the number that maps correctly to the group I want to, but, I’d like the text that’s attributed to it elsewhere that says it’s ‘ConfSer’. I haven’t been able to discover where this is, or how I could turn the gid into another filter to acquire the name and information of that particular group (so I can route it through a config file that spits out permissions).

EDIT: I get “CN=Ldaptst2 Majtst,O=example” in the results as well. But Neither of those are actually the group… just the full name.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:26:33+00:00Added an answer on May 31, 2026 at 4:26 pm

    Construct a search filter that will return all entries that have objectClass posixGroup and
    the desired gidNumber, for example,
    (&(objectClass=posixGroup)(gidNumber=<insert-gid-number-here>)). You must also supply a list
    of attributes to return in the search result. Depending on which API used by your code using
    this list of attributes might default to all user attributes. One of the attributes returned
    will be the relative distinguished name of the group, and the search result itself will contain
    the distinguished name of the group, which might be something like: cn=group-of-users,dc=example,dc=com.

    From the command line, this search might be something like:

    ldapsearch -h hostname -p port -b dc=example,dc=com -s sub \
       '(&(objectClass=posixGroup)(gidNumber=<insert-gid-number-here>))' '*'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this issue that appears only when using a webkit browser. Sometimes, when
I have this issue i am writing a array to a file but when
I have this issue with ComboBox that uses IEnumerable<Brush> as ItemsSource; the problem lies
I do not currently have this issue , but you never know, and thought
I already have this issue but I cannot remember how to solved it. (I
Heyy can somebody help me ? i have this issue that still do know
I have this strange issue with my web app. You see, I'm using jQuery
I have this exact issue ASP.net can’t update page from event handler and it's
I have this chronic issue with iPhone UI development where views sometimes seem to
Continuing my problem from yesterday, the Silverlight datagrid I have from this issue is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.