added mailLocalAddress and proxyAddresses as self service fields

This commit is contained in:
Roland Gruber 2019-01-16 20:52:59 +01:00
parent 7403a95104
commit ac936dd34a
4 changed files with 58 additions and 3 deletions

View File

@ -1,5 +1,7 @@
March 2019
- Added YubiKey as 2-factor authentication provider
- LAM Pro:
- New self service fields: Mail routing (Local address) and Windows (Proxy-Addresses)
28.12.2018 6.6
- New import/export in tools menu

View File

@ -685,6 +685,18 @@
<entry/>
</row>
<row>
<entry><inlinemediaobject>
<imageobject>
<imagedata fileref="images/schema_mailAlias.png"/>
</imageobject>
</inlinemediaobject> Mail routing</entry>
<entry>Local address (read-only)</entry>
<entry/>
</row>
<row>
<entry morerows="4"><inlinemediaobject>
<imageobject>
@ -741,7 +753,7 @@
</row>
<row>
<entry morerows="8"><inlinemediaobject>
<entry morerows="9"><inlinemediaobject>
<imageobject>
<imagedata fileref="images/schema_samba.png"/>
</imageobject>
@ -776,6 +788,12 @@
<entry/>
</row>
<row>
<entry>Proxy-Addresses (read-only)</entry>
<entry/>
</row>
<row>
<entry>State</entry>

View File

@ -2,7 +2,7 @@
/*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2004 - 2018 Roland Gruber
Copyright (C) 2004 - 2019 Roland Gruber
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -135,6 +135,10 @@ class inetLocalMailRecipient extends baseModule {
'localAdr' => _('Local address list'),
'host' => _('Mail server')
);
// self service
$return['selfServiceFieldSettings'] = array(
'mailLocalAddress' => _('Local address (read-only)'),
);
return $return;
}
@ -354,6 +358,25 @@ class inetLocalMailRecipient extends baseModule {
return $return;
}
function getSelfServiceOptions($fields, $attributes, $passwordChangeOnly, $readOnlyFields) {
if ($passwordChangeOnly) {
return array(); // no processing as long no LDAP content can be read
}
$return = array();
if (in_array('mailLocalAddress', $fields)) {
$mailLocalAddress = array();
if (isset($attributes['mailLocalAddress'])) {
$mailLocalAddress = $attributes['mailLocalAddress'];
}
array_map('htmlspecialchars', $mailLocalAddress);
$row = new htmlResponsiveRow();
$row->addLabel(new htmlOutputText($this->getSelfServiceLabel('mailLocalAddress', _('Local address'))));
$row->addField(new htmlOutputText(implode('<br>', $mailLocalAddress), false));
$return['mailLocalAddress'] = $row;
}
return $return;
}
}

View File

@ -5,7 +5,7 @@ use LAM\ImageUtils\ImageManipulationFactory;
/*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2013 - 2018 Roland Gruber
Copyright (C) 2013 - 2019 Roland Gruber
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -952,6 +952,7 @@ class windowsUser extends baseModule implements passwordService {
'accountExpires' => _('Account expiration date (read-only)'),
'department' => _('Department'),
'departmentNumber' => _('Department number'),
'proxyAddresses' => _('Proxy-Addresses (read-only)'),
);
// possible self service read-only fields
$return['selfServiceReadOnlyFields'] = array('physicalDeliveryOfficeName', 'telephoneNumber',
@ -2924,6 +2925,17 @@ class windowsUser extends baseModule implements passwordService {
$row->addLabel(new htmlOutputText($this->getSelfServiceLabel('accountExpires', _('Account expiration date'))));
$row->addField(new htmlOutputText($this->formatAccountExpires($attributes)));
$return['accountExpires'] = $row;
if (in_array('proxyAddresses', $fields)) {
$proxyAddresses = array();
if (isset($attributes['proxyAddresses'])) {
$proxyAddresses = $attributes['proxyAddresses'];
}
array_map('htmlspecialchars', $proxyAddresses);
$row = new htmlResponsiveRow();
$row->addLabel(new htmlOutputText($this->getSelfServiceLabel('proxyAddresses', _('Proxy-Addresses'))));
$row->addField(new htmlOutputText(implode('<br>', $proxyAddresses), false));
$return['proxyAddresses'] = $row;
}
return $return;
}