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

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

Gets the next available uidNumber.

Returns:
The next user number

Definition at line 428 of file ServerData.cs.

References lat::LdapServer::Search().

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

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

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

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index