I'm trying to create a custom new user template that includes all the object classes and fields that I need, but for some reason, the onchange autoFills have all stopped working. I have no issue with them on the generic templates.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE template SYSTEM "template.dtd">
<template>
<askcontainer>1</askcontainer>
<description>New User Account</description>
<icon>ldap-user.png</icon>
<invalid>0</invalid>
<rdn>uid</rdn>
<regexp>^ou=People,dc=example,c=com</regexp>
<title>Custom: User Account</title>
<visible>1</visible>
<objectClasses>
<objectClass id="inetOrgPerson"></objectClass>
<objectClass id="posixAccount"></objectClass>
<objectClass id="shadowAccount"></objectClass>
<objectClass id="postfixUser"></objectClass>
</objectClasses>
<attributes>
<attribute id="givenName">
<display>Preferred name</display>
<icon>ldap-uid.png</icon>
<onchange>=autoFill(cn;%givenName% %sn%)</onchange>
<onchange>=autoFill(uid;%givenName%%sn%)</onchange>
<order>1</order>
<page>1</page>
</attribute>
<attribute id="sn">
<display>Last name</display>
<icon>ldap-uid.png</icon>
<onchange>=autoFill(cn;%givenName% %sn%)</onchange>
<onchange>=autoFill(uid;%givenName|0-1/l%%sn/l%)</onchange>
<!-- <onchange>=autoFill(homeDirectory;/home/users/%uid|0-1/l%/%uid%)</onchange> -->
<order>2</order>
<page>1</page>
</attribute>
<attribute id="cn">
<display>Common Name</display>
<icon>ldap-uid.png</icon>
<order>3</order>
<page>1</page>
<spacer>1</spacer>
</attribute>
<attribute id="uid">
<display>User ID</display>
<onchange>=autoFill(homeDirectory;/home/%uid%)</onchange>
<onchange>=autoFill(mail;%uid%@example.com)</onchange>
<order>4</order>
<page>1</page>
</attribute>
<attribute id="uidNumber">
<display>UID Number</display>
<icon>terminal.png</icon>
<order>4</order>
<page>1</page>
<readonly>1</readonly>
<value>=php.GetNextNumber(/;uidNumber)</value>
<spacer>1</spacer>
</attribute>
<attribute id="mail">
<display>Email</display>
<order>5</order>
<onchange>=autoFill(maildrop;%mail)</onchange>
<onchange>=autoFill(mailacceptinggeneralid;%mail)</onchange>
<page>1</page>
</attribute>
<attribute id="maildrop">
<display>Email Recipient</display>
<order>5</order>
<page>1</page>
</attribute>
<attribute id="mailacceptinggeneralid">
<display>Alternative Emails</display>
<order>5</order>
<page>1</page>
<spacer>1</spacer>
</attribute>
<attribute id="homeDirectory">
<display>Home directory</display>
<!-- <onchange>=autoFill(homeDirectory;/home/users/%gidNumber|0-0/T%/%uid|3-%)</onchange> -->
<order>6</order>
<page>1</page>
</attribute>
<attribute id="gidNumber">
<display>GID Number</display>
<!-- <onchange>=autoFill(homeDirectory;/home/users/%gidNumber|0-0/T%/%uid|3-%)</onchange> -->
<order>7</order>
<page>1</page>
<value><![CDATA[=php.PickList(/;(&(objectClass=posixGroup));gidNumber;%cn%;;;;cn)]]></value>
</attribute>
<attribute id="loginShell">
<display>Login shell</display>
<order>9</order>
<page>1</page>
<!-- <value><![CDATA[=php.PickList(/;(&(objectClass=posixAccount));loginShell;%loginShell%;;;;loginShell)]]></value> -->
<type>select</type>
<value id="/bin/sh">/bin/sh</value>
<value id="/bin/bash">/bin/bash</value>
</attribute>
<attribute id="userPassword">
<display>Password</display>
<!-- <helper>
<display>Encryption</display>
<id>enc</id>
<value>=php.PasswordEncryptionTypes()</value>
</helper> -->
<icon>lock.png</icon>
<order>10</order>
<page>1</page>
<post>=php.PasswordEncrypt(%enc%;%userPassword%)</post>
<spacer>1</spacer>
<verify>1</verify>
</attribute>
</attributes>
</template>
I tried commenting out the <regexp>
tag, which got the first couple of attributes' onchanges to work, but further attempts to get any of the others working lead to failure again, and reverting back to the partially working version had all of them failing.
The wiki doco on templates is a bit lacking in detail, with no information about cascading onChange entries being problematic.
Server: phpldapadmin 1.2.2 nginx 1.18.0 Ubuntu 20.4
Client: Chromium Version 87.0.4280.66 (Official Build) Arch Linux (64-bit)