summaryrefslogtreecommitdiff
path: root/www/admin/distributionlist/list.php.in
diff options
context:
space:
mode:
Diffstat (limited to 'www/admin/distributionlist/list.php.in')
-rw-r--r--www/admin/distributionlist/list.php.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/www/admin/distributionlist/list.php.in b/www/admin/distributionlist/list.php.in
index 8b38c6b..2ba0398 100644
--- a/www/admin/distributionlist/list.php.in
+++ b/www/admin/distributionlist/list.php.in
@@ -76,6 +76,8 @@ function fill_form_for_modify( &$form, &$ldap_object ) {
if (is_array($ldap_object['cn'])) $cn = $ldap_object['cn'][0];
else $cn = $ldap_object['cn'];
$form->entries['cn']['value'] = $cn;
+ if ($_REQUEST['action'] != "firstsave")
+ $form->entries['cn']['attrs'] = "readonly";
$form->entries['action']['value'] = 'save';
$m = $ldap_object['member'];
@@ -88,7 +90,8 @@ function fill_form_for_modify( &$form, &$ldap_object ) {
debug("internaldn=\"$internaldn\"");
debug("dn=\"$dn\"");
debug("substr=\"".substr( $dn, strlen($dn)-strlen( $internaldn ) )."\"");
- if( substr( $dn, strlen($dn)-strlen( $internaldn ) ) === $internaldn ) {
+ if( substr( $dn, strlen($dn)-strlen( $internaldn ) ) === $internaldn
+ || preg_match("/cn=internal/",$dn) ) {
$form->entries['hidden']['value'] = true;
} else {
$form->entries['hidden']['value'] = false;
@@ -146,10 +149,11 @@ if( !$errors ) {
$content = $form->outputForm();
break;
case 'firstsave':
- $form->entries['cn']['validation'] = 'checkuniquemail';
+ $form->entries['cn']['validation'] = array('notempty', 'checkuniquemail');
case 'save':
if( $form->isSubmitted() ) {
if( !$form->validate() ) {
+ fill_form_for_modify( $form, $ldap_object );
$form->setValues();
$content = $form->outputForm();
} else {