On a recent post i pointed out the advantages of moving ldap writes to web services. I also stated that we couldn’t make the current interface available but another was on the works. Well, after a few days of coding i now have that interface available on sourceforge.

I named it LUMS (LDAP User Management Service). It basically provides a set of basic API functions (search, add, delete, modify, rename, change password), written in PHP and a strong configuration language. This API can then be used to create web services (or used in any PHP script to say the truth). The language allows the administrator to define ldap object types along with their corresponding attributes. For each attribute a whole bunch of options is available:

  • define it as required, multivalued
  • set the attribute type (string,binary,dn,telephone,mail etc)
  • define the attribute type. Can be user inserted, constant, auto increment, function created
  • allow for attribute uniqueness
  • define extra syntax checking functions

Moreover, pre and post operation functions can be defined while the interface takes care of handling non English char-set attribute values. More information is available in the (small) README and configuration comments. Hope people find it useful. It surely still needs work but it works.

Here’s a small snapshot of the configuration to get a basic idea:

$LUMS_Config[Object][parent][attributes][objectclass][required] = 1;
$LUMS_Config[Object][parent][attributes][objectclass][multivalue] = 1;
$LUMS_Config[Object][parent][attributes][objectclass][valuetype] = ‘constant’;
$LUMS_Config[Object][parent][attributes][objectclass][constant][values][0] = ‘top’;
$LUMS_Config[Object][parent][attributes][objectclass][constant][values][1] = ‘person’;
$LUMS_Config[Object][parent][attributes][objectclass][constant][values][2] = ‘inetOrgPerson’;
$LUMS_Config[Object][parent][attributes][objectclass][constant][values][3] = ‘gsnUser’;
$LUMS_Config[Object][parent][attributes][objectclass][constant][values][4] = ‘organizationalPerson’;
$LUMS_Config[Object][parent][attributes][objectclass][constant][values][5] = ‘umdManagedObject’;
$LUMS_Config[Object][parent][attributes][objectclass][constant][values][6] = ‘eduPerson’;
$LUMS_Config[Object][parent][attributes][objectclass][type] = ‘string’;
$LUMS_Config[Object][parent][attributes][givenname][required] = 1;
$LUMS_Config[Object][parent][attributes][givenname][multivalue] = 0;
$LUMS_Config[Object][parent][attributes][givenname][valuetype] = ‘uservalue’;
$LUMS_Config[Object][parent][attributes][givenname][type] = ‘string’;
$LUMS_Config[Object][parent][attributes][‘givenname;lang-en’][required] = 1;
$LUMS_Config[Object][parent][attributes][‘givenname;lang-en’][multivalue] = 0;
$LUMS_Config[Object][parent][attributes][‘givenname;lang-en’][type] = ‘string’;
$LUMS_Config[Object][parent][attributes][‘givenname;lang-en’][valuetype] = ‘callfunc’;
$LUMS_Config[Object][parent][attributes][‘givenname;lang-en’][callfunction] = ‘LUMS_callfun_gr2en_givenname’;
$LUMS_Config[Object][parent][attributes][uid][required] = 1;
$LUMS_Config[Object][parent][attributes][uid][multivalue] = 0;
$LUMS_Config[Object][parent][attributes][uid][type] = ‘string’;
$LUMS_Confif[Object][parent][attributes][uid][valuetype] = ‘uservalue’;
$LUMS_Config[Object][parent][attributes][uid][unique] = 1;
$LUMS_Config[Object][parent][attributes][uid][unique][base] = ‘ou=people,dc=sch,dc=gr’;
$LUMS_Config[Object][parent][attributes][employeenumber][required] = 1;
$LUMS_Config[Object][parent][attributes][employeenumber][multivalue] = 0;
$LUMS_Config[Object][parent][attributes][employeenumber][type] = ‘integer’;
$LUMS_Config[Object][parent][attributes][employeenumber][valuetype] = ‘autoincrement’;
$LUMS_Config[Object][parent][attributes][employeenumber][autoincrement] [counter] = ’employeenumber.parent’;
$LUMS_Config[Object][parent][attributes][employeenumber][autoincrement] [func] = ‘LUMS_incrementfun_incrementbyone’;

Advertisements