custom labels for account types

This commit is contained in:
Roland Gruber 2013-09-28 11:46:52 +00:00
parent d6900a27b9
commit d738484948
6 changed files with 57 additions and 3 deletions

View File

@ -1,3 +1,9 @@
December 2013 4.4
- allow to set a custom label for each account type
- LAM Pro:
-> Samba/Shadow: display password change date in self service
25.09.2013 4.3 25.09.2013 4.3
- Custom SSL CA certificates can be setup in LAM main configuration - Custom SSL CA certificates can be setup in LAM main configuration
- Unix user and group support for Samba 4 - Unix user and group support for Samba 4

View File

@ -1297,6 +1297,13 @@ Have fun!
users.</para> users.</para>
</listitem> </listitem>
<listitem>
<para><emphasis role="bold">Custom label:</emphasis> Here you
can set a custom label for the account types. Use this if the
standard label does not fit for you (e.g. enter "Servers" for
hosts).</para>
</listitem>
<listitem> <listitem>
<para><emphasis role="bold">No new entries (LAM Pro <para><emphasis role="bold">No new entries (LAM Pro
only):</emphasis> Use this if you want to prevent that new only):</emphasis> Use this if you want to prevent that new
@ -5554,7 +5561,7 @@ Run slapindex to rebuild the index.
</tr> </tr>
<tr> <tr>
<th align="left" rowspan="4"><inlinemediaobject> <th align="left" rowspan="5"><inlinemediaobject>
<imageobject> <imageobject>
<imagedata fileref="images/schema_samba.png" /> <imagedata fileref="images/schema_samba.png" />
</imageobject> </imageobject>
@ -5587,6 +5594,26 @@ Run slapindex to rebuild the index.
with Unix.</td> with Unix.</td>
</tr> </tr>
<tr>
<td>Last password change (read-only)</td>
<td>Displays the date and time of the user's last password
change.</td>
</tr>
<tr>
<th align="left"><inlinemediaobject>
<imageobject>
<imagedata fileref="images/schema_ssh.png" />
</imageobject>
</inlinemediaobject>Shadow</th>
<td>Last password change (read-only)</td>
<td>Displays the date and time of the user's last password
change (Unix).</td>
</tr>
<tr> <tr>
<td align="left" rowspan="9"><inlinemediaobject> <td align="left" rowspan="9"><inlinemediaobject>
<imageobject> <imageobject>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -161,6 +161,8 @@ $helpArray = array (
"Text" => _('If checked then the user will not be able to create new entries of this account type.')), "Text" => _('If checked then the user will not be able to create new entries of this account type.')),
"263" => array ("Headline" => _("Disallow delete"), "263" => array ("Headline" => _("Disallow delete"),
"Text" => _('If checked then the user will not be able to delete entries of this account type.')), "Text" => _('If checked then the user will not be able to delete entries of this account type.')),
"264" => array ("Headline" => _('Custom label'),
"Text" => _('Here you can overwrite the display name for this account type.')),
// 300 - 399 // 300 - 399
// profile editor, file upload // profile editor, file upload
"301" => array ("Headline" => _("RDN identifier"), "301" => array ("Headline" => _("RDN identifier"),

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2005 - 2006 Roland Gruber Copyright (C) 2005 - 2013 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -73,6 +73,12 @@ function getTypes() {
* @return string type alias * @return string type alias
*/ */
function getTypeAlias($type) { function getTypeAlias($type) {
if (!empty($_SESSION['config'])) {
$typeSettings = $_SESSION['config']->get_typeSettings();
if (!empty($typeSettings['customLabel_' . $type])) {
return $typeSettings['customLabel_' . $type];
}
}
$obj = new $type(); $obj = new $type();
return $obj->getAlias(); return $obj->getAlias();
} }

View File

@ -281,6 +281,15 @@ if (sizeof($activeTypes) > 0) {
$hidden = $typeSettings['hidden_' . $activeTypes[$i]]; $hidden = $typeSettings['hidden_' . $activeTypes[$i]];
} }
$advancedOptionsContent->addElement(new htmlTableExtendedInputCheckbox('hidden_' . $activeTypes[$i], $hidden, _('Hidden'), '261'), true); $advancedOptionsContent->addElement(new htmlTableExtendedInputCheckbox('hidden_' . $activeTypes[$i], $hidden, _('Hidden'), '261'), true);
// custom label
$customLabel = '';
if (isset($typeSettings['customLabel_' . $activeTypes[$i]])) {
$customLabel = $typeSettings['customLabel_' . $activeTypes[$i]];
}
$customLabelInput = new htmlTableExtendedInputField(_('Custom label'), 'customLabel_' . $activeTypes[$i], $customLabel, '264');
$customLabelInput->setFieldSize(40);
$advancedOptionsContent->addElement($customLabelInput);
$advancedOptionsContent->addElement(new htmlSpacer('20px', null));
if (isLAMProVersion() && ($conf->getAccessLevel() == LAMConfig::ACCESS_ALL)) { if (isLAMProVersion() && ($conf->getAccessLevel() == LAMConfig::ACCESS_ALL)) {
// hide button to create new accounts // hide button to create new accounts
$hideNewButton = false; $hideNewButton = false;
@ -375,7 +384,11 @@ function checkInput() {
} }
} }
// set filter // set filter
elseif (substr($key, 0, 7) == "filter_") { elseif (substr($key, 0, strlen('filter_')) == "filter_") {
$typeSettings[$key] = $_POST[$key];
}
// set custom label
elseif (strpos($key, 'customLabel_') === 0) {
$typeSettings[$key] = $_POST[$key]; $typeSettings[$key] = $_POST[$key];
} }
} }