Hi,

I have configured phpldapadmin 1.2.2 and created templates for both
creation and modification of shadow account. I need some help in making the
shadowLastChange automatically updated when a new account is created or
password is changed.

Attached with this mail are the two templates.

any help on is greatly appreciated.

Regards,
Vishy
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE template SYSTEM "template.dtd">

<template>
<askcontainer>1</askcontainer>
<description>New Mail User</description>
<icon>ldap-user.png</icon>
<invalid>0</invalid>
<rdn>uid</rdn>
<regexp>^ou=users,</regexp>
<title>Mail User</title>
<visible>1</visible>

<objectClasses>
<objectClass id="person"></objectClass>
<objectClass id="inetOrgPerson"></objectClass>
<objectClass id="organizationalPerson"></objectClass>
<objectClass id="myMailUser"></objectClass>
<objectClass id="posixAccount"></objectClass>
<objectClass id="shadowAccount"></objectClass>
</objectClasses>

<attributes>
<attribute id="uid">
	<display>Login Name</display>
	<onchange>=autoFill(mail;%u...@concordemotors.com)</onchange>
	<onchange>=autoFill(gecos;%uid%)</onchange>
	<icon>ldap-uid.png</icon>
	<order>1</order>
	<spacer>1</spacer>
</attribute>

<!--
<attribute id="gecos">
	<display>Login Name</display>
	<icon>ldap-uid.png</icon>
	<order>1</order>
	<spacer>1</spacer>
</attribute>
-->

<attribute id="givenName">
	<display>First Name</display>
	<onchange>=autoFill(cn;%givenName% %sn%)</onchange>
	<!--<onchange>=autoFill(uid;%givenName|0-1/l%%sn/l%)</onchange>-->
	<order>2</order>
	<spacer>1</spacer>
</attribute>

<attribute id="sn">
	<display>Surname / Initials</display>
	<onchange>=autoFill(cn;%givenName% %sn%)</onchange>
	<!--<onchange>=autoFill(uid;%givenName|0-1/l%%sn/l%)</onchange>-->
	<order>3</order>
	<spacer>1</spacer>
</attribute>

<attribute id="cn">
	<display>Full Name</display>
	<icon>ldap-uid.png</icon>
	<order>4</order>
	<spacer>1</spacer>
</attribute>

<attribute id="mail">
	<display>Email</display>
	<icon>mail.png</icon>
	<order>5</order>
</attribute>

<attribute id="uidNumber">
	<display>UID Number</display>
	<!--<icon>terminal.png</icon>-->
	<order>6</order>
	<page>1</page>
	<readonly>1</readonly>
	<value>=php.GetNextNumber(/;uidNumber)</value>
</attribute>

<attribute id="gidNumber">
	<display>GID Number</display>
	<order>7</order>
	<page>1</page>
	<value>1000</value>
</attribute>

<attribute id="shadowMax">
	<display>Password Validity (in days)</display>
	<order>8</order>
	<spacer>1</spacer>
	<value>30</value>
</attribute>

<attribute id="shadowWarning">
	<display>Password Change Warning (days before expiry)</display>
	<order>9</order>
	<spacer>1</spacer>
	<value>5</value>
</attribute>

<attribute id="shadowLastChange">
	<display>Password Last Changed (in days since 01 Jan 1970)</display>
	<order>10</order>
	<spacer>1</spacer>
</attribute>

<attribute id="title">
	<display>Designation</display>
	<order>11</order>
	<spacer>1</spacer>
	<type>select</type>
		<value id="t1">Manager</value>
		<value id="t2">Sr. Manager</value>
		<value id="t3">Sales Manager</value>
	</attribute>

<attribute id="homeDirectory">
	<display>Home Directory</display>
	<order>14</order>
	<page>1</page>
	<value>/dev/null</value>
</attribute>

<attribute id="loginShell">
	<display>Login Shell</display>
	<order>15</order>
	<page>1</page>
	<value>/sbin/nologin</value>
</attribute>

<attribute id="userPassword">
	<display>Password</display>
        <helper>
                <default>md5crypt</default>
                <id>enc</id>
                <!-- <location>side</location> commented due to error -->
                <value>md5crypt</value>
                <value>md5</value>
        </helper>
	<icon>lock.png</icon>
	<order>16</order>
	<page>1</page>
	<post>=php.PasswordEncrypt(%enc%;%userPassword%)</post>
	<spacer>1</spacer>
	<verify>1</verify>
</attribute>

</attributes>

</template>

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE template SYSTEM "template.dtd">

<template>
<description>Mail User</description>
<icon>ldap-user.png</icon>
<invalid>0</invalid>
<rdn>uid</rdn>
<noleaf>1</noleaf>
<title>Mail User</title>
<visible>1</visible>

<objectClasses>
<objectClass id="person"></objectClass>
<objectClass id="inetOrgPerson"></objectClass>
<objectClass id="organizationalPerson"></objectClass>
<objectClass id="myMailUser"></objectClass>
<objectClass id="posixAccount"></objectClass>
<objectClass id="shadowAccount"></objectClass>
</objectClasses>

<attributes>

<attribute id="uid">
	<display>Login Name</display>
	<onchange>=autoFill(mail;%u...@concordemotors.com)</onchange>
	<onchange>=autoFill(gecos;%uid%)</onchange>
	<icon>ldap-uid.png</icon>
	<order>1</order>
	<spacer>1</spacer>
</attribute>

<!--
<attribute id="gecos">
	<display>Login Name</display>
	<icon>ldap-uid.png</icon>
	<order>1</order>
	<spacer>1</spacer>
</attribute>
-->

<attribute id="givenName">
	<display>First Name</display>
	<onchange>=autoFill(cn;%givenName% %sn%)</onchange>
	<!--<onchange>=autoFill(uid;%givenName|0-1/l%%sn/l%)</onchange>-->
	<order>2</order>
	<spacer>1</spacer>
</attribute>

<attribute id="sn">
	<display>Surname / Initials</display>
	<onchange>=autoFill(cn;%givenName% %sn%)</onchange>
	<!--<onchange>=autoFill(uid;%givenName|0-1/l%%sn/l%)</onchange>-->
	<order>3</order>
	<spacer>1</spacer>
</attribute>

<attribute id="cn">
	<display>Full Name</display>
	<icon>ldap-uid.png</icon>
	<order>4</order>
	<spacer>1</spacer>
</attribute>

<attribute id="mail">
	<display>Email ID</display>
	<icon>mail.png</icon>
	<order>5</order>
</attribute>

<attribute id="uidNumber">
	<display>UID Number</display>
	<!--<icon>terminal.png</icon>-->
	<order>6</order>
	<page>1</page>
	<readonly>1</readonly>
	<value>=php.GetNextNumber(/;uidNumber)</value>
</attribute>

<attribute id="gidNumber">
	<display>GID Number</display>
	<order>7</order>
	<page>1</page>
	<value>1000</value>
</attribute>

<attribute id="shadowMax">
	<display>Password Validity (in days)</display>
	<order>8</order>
	<spacer>1</spacer>
	<value>30</value>
</attribute>

<attribute id="shadowWarning">
	<display>Password Change Warning (days before expiry)</display>
	<order>9</order>
	<spacer>1</spacer>
	<value>5</value>
</attribute>

<attribute id="shadowLastChange">
	<display>Password Last Changed (in days since 01 Jan 1970)</display>
	<order>10</order>
	<spacer>1</spacer>
</attribute>

<attribute id="title">
	<display>Designation</display>
	<order>11</order>
	<spacer>1</spacer>
	<type>select</type>
		<value id="t1">Manager</value>
		<value id="t2">Sr. Manager</value>
		<value id="t3">Sales Manager</value>
	</attribute>

<attribute id="homeDirectory">
	<display>Home directory</display>
	<order>14</order>
	<page>1</page>
	<value>/dev/null</value>
</attribute>

<attribute id="loginShell">
	<display>Login shell</display>
	<order>15</order>
	<page>1</page>
	<value>/sbin/nologin</value>
</attribute>

<attribute id="userPassword">
	<display>Password</display>
        <helper>
                <default>md5crypt</default>
                <id>enc</id>
                <location>side</location>
                <value>md5crypt</value>
                <value>md5</value>
        </helper>
	<icon>lock.png</icon>
	<order>16</order>
	<page>1</page>
	<post>=php.PasswordEncrypt(%enc%;%userPassword%)</post>
	<spacer>1</spacer>
	<verify>1</verify>
</attribute>

</attributes>

</template>

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
phpldapadmin-users mailing list
phpldapadmin-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/phpldapadmin-users

Reply via email to