With a little side of applesauce...

Sunday, January 28, 2007

phpLDAPadmin - custom object templates

I have just found the power of the phpLDAPadmin templates. They have separated the object creation templates into the:

/usr/share/phpldapadmin/templates/

directory, (on ubuntu), and you can copy and modify any of those templates to create your own. I needed to be able to create groupOfNames objects, so I came up with this template:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE template SYSTEM "template.dtd">
<template>
<title>User Group</title>
<!-- <regexp>^ou=.*,</regexp> -->
<icon>images/ou.png</icon>
<description>New groupOfNames</description>
<askcontainer>1</askcontainer>
<rdn>cn</rdn>
<visible>1</visible>

<objectclasses>
<objectclass id="groupOfNames"></objectclass>
</objectclasses>

<attributes>
<attribute id="cn">
<display>Group</display>
<order>1</order>
<page>1</page>
</attribute>
<attribute id="member">
<display>member</display>
<hint></hint>
<order>2</order>
<page>1</page>
<spacer>1</spacer>
</attribute>
<attribute id="memberUid">
<array>10</array>
<display>Users</display>
<helper>
<location>side</location>
</helper>
<hidden>0</hidden>
<order>3</order>
<page>1</page>
</attribute>
</attributes>
</template>

This page in the phpLDAPadmin wiki helped me to get started:
http://wiki.phpldapadmin.info/tiki-index.php?page=en.doc.CreatingTemplates&bl

No comments: