Logo Search packages:      
Sourcecode: lat version File versions  Download package

int lat::ServerData::GetNextGID (  ) [inline]

Gets the next available gidNumber.

Returns:
The next group number

Definition at line 408 of file ServerData.cs.

References lat::LdapServer::Search().

            {
                  List<int> gids = new List<int> ();

                  LdapEntry[] groups = server.Search (server.DirectoryRoot, LdapConnection.SCOPE_SUB, "gidNumber=*", null);
                  foreach (LdapEntry entry in groups) {
                        LdapAttribute a = entry.getAttribute ("gidNumber");
                        gids.Add (int.Parse(a.StringValue));
                  }

                  gids.Sort ();
                  if (gids.Count == 0)
                        return 1000;
                  else
                        return (gids [gids.Count - 1]) + 1;
            }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index