summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2010-08-23 17:13:45 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2010-08-23 17:13:45 (GMT)
commitf23b6d1f925eb2243235efdfd4bbd150e8a56340 (patch)
tree19bf5e22aba4b6c987e7ca39d7d8faf0393ac7f3
parent22ae9707b24287f54b4c500221e2df721176c663 (diff)
downloadkolab-webadmin-f23b6d1f925eb2243235efdfd4bbd150e8a56340.tar.gz
kolab/issue4516 (Various logic/spelling fixes for the web admin)
-rw-r--r--ChangeLog10
-rw-r--r--lib/KolabAdmin/Ldap.php1
-rw-r--r--www/admin/administrator/admin.php.in2
-rw-r--r--www/admin/distributionlist/list.php.in8
-rw-r--r--www/admin/domainmaintainer/domainmaintainer.php.in2
-rw-r--r--www/admin/maintainer/maintainer.php.in2
-rw-r--r--www/admin/sharedfolder/sf.php.in4
-rw-r--r--www/admin/user/user.php.in8
8 files changed, 32 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 48a96e8..f98f780 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2010-08-23 Gunnar Wrobel <p@rdus.de>
+ * lib/KolabAdmin/Ldap.php:
+ * www/admin/administrator/admin.php.in:
+ * www/admin/distributionlist/list.php.in:
+ * www/admin/domainmaintainer/domainmaintainer.php.in:
+ * www/admin/maintainer/maintainer.php.in:
+ * www/admin/sharedfolder/sf.php.in:
+ * www/admin/user/user.php.in:
+
+ kolab/issue4516 (Various logic/spelling fixes for the web admin)
+
* kolab-webadmin.spec:
* www/admin/index.php.in:
* www/admin/settings/index.php.in:
diff --git a/lib/KolabAdmin/Ldap.php b/lib/KolabAdmin/Ldap.php
index ac73200..3337465 100644
--- a/lib/KolabAdmin/Ldap.php
+++ b/lib/KolabAdmin/Ldap.php
@@ -507,6 +507,7 @@ class KolabLDAP {
}
}
}
+ return true;
}
// Set deleflag on object, or if $delete_now is
diff --git a/www/admin/administrator/admin.php.in b/www/admin/administrator/admin.php.in
index d62ee8f..d3b5bab 100644
--- a/www/admin/administrator/admin.php.in
+++ b/www/admin/administrator/admin.php.in
@@ -179,6 +179,7 @@ switch( $action ) {
if( $form->isSubmitted() ) {
if( !$form->validate() ) {
$form->setValues();
+ if ($action != "firstsave") fill_form_for_modify( $form, $ldap_object );
$content = $form->outputForm();
} else {
debug("Process...");
@@ -246,6 +247,7 @@ switch( $action ) {
$form->entries['password_0']['value'] = '';
$form->entries['password_1']['value'] = '';
$form->entries['action']['value'] = 'save';
+ $form->entries['uid']['attrs'] = 'readonly';
$content = $form->outputForm();
break;
} else {
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 {
diff --git a/www/admin/domainmaintainer/domainmaintainer.php.in b/www/admin/domainmaintainer/domainmaintainer.php.in
index f88b958..35e6c0c 100644
--- a/www/admin/domainmaintainer/domainmaintainer.php.in
+++ b/www/admin/domainmaintainer/domainmaintainer.php.in
@@ -163,6 +163,8 @@ switch( $action ) {
if( $form->isSubmitted() ) {
if( !$form->validate() ) {
$form->setValues();
+ if ($action != "firstsave")
+ fill_form_for_modify($form, $ldap_object);
$content = $form->outputForm();
} else {
$ldap_object = array();
diff --git a/www/admin/maintainer/maintainer.php.in b/www/admin/maintainer/maintainer.php.in
index 153744b..513040d 100644
--- a/www/admin/maintainer/maintainer.php.in
+++ b/www/admin/maintainer/maintainer.php.in
@@ -176,6 +176,8 @@ switch( $action ) {
if( $form->isSubmitted() ) {
if( !$form->validate() ) {
$form->setValues();
+ if ($action != "firstsave")
+ fill_form_for_modify( $form, $ldap_object );
$content = $form->outputForm();
} else {
debug("Process...");
diff --git a/www/admin/sharedfolder/sf.php.in b/www/admin/sharedfolder/sf.php.in
index 38757dc..79a6645 100644
--- a/www/admin/sharedfolder/sf.php.in
+++ b/www/admin/sharedfolder/sf.php.in
@@ -31,6 +31,7 @@ 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;
+ $form->entries['cn']['attrs'] = 'readonly';
if( in_array('cyrus-userquota',$ldap_object)) {
if (is_array($ldap_object['cyrus-userquota'])) $userquota = $ldap_object['cyrus-userquota'][0];
@@ -40,6 +41,7 @@ function fill_form_for_modify( &$form, &$ldap_object ) {
if (is_array($ldap_object['kolabHomeServer'])) $kolabhomeserver = $ldap_object['kolabHomeServer'][0];
$form->entries['kolabhomeserver']['value'] = $kolabhomeserver;
+ $form->entries['kolabhomeserver']['attrs'] = 'readonly';
if( in_array('kolabFolderType',$ldap_object)) {
if (is_array($ldap_object['kolabFolderType']))
@@ -162,6 +164,8 @@ if( !$errors ) {
case 'save':
if( $form->isSubmitted() ) {
if( !$form->validate() ) {
+ if($action != "firstsave")
+ fill_form_for_modify($form, $ldap_object);
$form->setValues();
$content = $form->outputForm();
} else {
diff --git a/www/admin/user/user.php.in b/www/admin/user/user.php.in
index aa3c455..eeace1d 100644
--- a/www/admin/user/user.php.in
+++ b/www/admin/user/user.php.in
@@ -108,7 +108,7 @@ function checkuniquemail( $form, $key, $value ) {
$ok = true;
}
}
- if(!$ok) return sprintf(_("Email address %1\$s not in domains %2\$s"), $value, join(", ", $domain));
+ if(!$ok) return sprintf(_("Email address %1\$s not in domains %2\$s"), $value, join(", ", $domains));
if( $ldap->countMail( $_SESSION['base_dn'], $value ) > 0 ) {
return _('User, vCard or distribution list with this email address already exists');
@@ -553,7 +553,7 @@ if( $auth->group() == 'user' ) {
apply_attributeaccess( $entries );
}
$form =& new KolabForm( 'user', 'createuser.tpl', $entries );
-/***************** Main action swicth **********************/
+/***************** Main action switch **********************/
switch( $action ) {
case 'firstsave':
debug("adding checkuniquemail to validation");
@@ -562,6 +562,8 @@ switch( $action ) {
case 'save':
if( $form->isSubmitted() ) {
if( !$form->validate() ) {
+ if($action != "firstsave")
+ fill_form_for_modify($form, $ldap_object);
$form->setValues();
$content = $form->outputForm();
} else {
@@ -819,7 +821,7 @@ switch( $action ) {
$heading = _('Create New User');
$blacklist = array('mail');
$form->entries['action']['value'] = 'firstsave';
- $form->outputForm();
+ $content = $form->outputForm();
break;
}
}