4

According to this, I know that :

A user ID (UID) is a unique positive integer assigned by a Unix-like operating system to each user. Each user is identified to the system by its UID.

When we create a Posix Account user via PHP, we need to set up the uidNumber like the following.

$info['uidNumber'] = 1234;

However, we cannot preset or predict the value since it is unique and we need to change it according to the actual existence of the user who uses the ID. So, can we set this value auto increment and unique in the OpenLDAP system? Or, we should do the auto increment and unique check in PHP logics?


UPDATE 1

After several tests, I found that uidNumber must be unique under the same parent DN. If we try to add a new object with a uidNumber already used under the same parent DN, it will give an error.

So, now the problem becomes how to make it auto increment?

Casper
  • 4,435
  • 10
  • 41
  • 72

0 Answers0