Add support for buisnessCategory LDAP field

This commit is contained in:
Daniel Berteaud 2017-12-06 17:36:02 +01:00
parent 3dd640bee9
commit 7d04a7220a
4 changed files with 13 additions and 1 deletions

View File

@ -69,14 +69,16 @@ foreach my $acc (@accounts){
my $initials = $acc->prop('Initials') || '';
my $dshell = $acc->prop('DesktopShell') || '';
my $preferredemail = $acc->prop('PreferredEmail') || '';
my $category = $acc->prop('Category') || '';
$preferredemail = "$user\@$domain" if ($preferredemail eq '');
my $web = $acc->prop('Url') || '';
my (@postalcode,@mobile,@extension,@fax,@titles,@initials,@dshell,@preferredemail,@web) = ();
my (@postalcode,@mobile,@extension,@fax,@titles,@initials,@dshell,@preferredemail,@category,@web) = ();
@postalcode = ($postalcode) unless ($postalcode eq '');
@mobile = ($mobile) unless ($mobile eq '');
@extension = ($extension) unless ($extension eq '');
@fax = ($fax) unless ($fax eq '');
@category = ($category) unless ($category eq '');
foreach ($function1, $function2, $function3, $function4){
push @titles, $_ if ($_ ne '');
}
@ -94,6 +96,7 @@ foreach my $acc (@accounts){
initials => \@initials,
desktopLoginShell => \@dshell,
preferredMail => \@preferredemail,
businessCategory => \@category,
labeledURI => \@web
}
);

View File

@ -63,6 +63,10 @@
<base>COMPANY</base>
<trans>Société</trans>
</entry>
<entry>
<base>CATEGORY</base>
<trans>Catégorie</trans>
</entry>
<entry>
<base>STREET_ADDRESS</base>
<trans>Adresse</trans>

View File

@ -78,6 +78,10 @@ __DATA__
value="get_ldap_value('Company')">
<label>COMPANY</label>
</field>
<field type="text" size="30" id="Category"
value="get_ldap_value('Category')">
<label>CATEGORY</label>
</field>
<field type="text" size="30" id="Street"
value="get_ldap_value('Street')">
<label>STREET_ADDRESS</label>

View File

@ -213,6 +213,7 @@ sub modify_user {
'AltEmail3' => $self->{cgi}->param('AltEmail3'),
'AltEmail4' => $self->{cgi}->param('AltEmail4'),
'PreferredEmail' => $self->{cgi}->param('PreferredEmail'),
'Category' => $self->{cgi}->param('PreferredCategory'),
'Url' => $self->{cgi}->param('Url'),
'Shell' => $self->{cgi}->param('Shell'),
'DesktopShell' => $self->{cgi}->param('DesktopShell'),