summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2010-06-28 13:50:22 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2010-06-28 13:50:22 (GMT)
commitd0bba9609cd6d4dc7fc1704f428ce57bedcfa9dc (patch)
tree844605b2435d5ba561158a71c27e24e710c0b474
parentcecaf3973b3741f3542c7909df98a53c331a9cac (diff)
downloadkolab-webadmin-d0bba9609cd6d4dc7fc1704f428ce57bedcfa9dc.tar.gz
kolab/issue606 (It is not possible to register people with middlename correctly)
-rw-r--r--ChangeLog7
-rw-r--r--php/admin/templates/createuser.tpl8
-rw-r--r--www/admin/user/user.php.in12
3 files changed, 25 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 565a61a..98f09de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-28 Gunnar Wrobel <p@rdus.de>
+
+ * www/admin/user/user.php.in:
+
+ kolab/issue606 (It is not possible to register people with
+ middlename correctly)
+
2010-05-21 Mathieu Parent <math.parent@gmail.com>
* php/admin/locale/*/LC_MESSAGES/messages.po, www/admin/settings/index.php.in:
diff --git a/php/admin/templates/createuser.tpl b/php/admin/templates/createuser.tpl
index 1eaf291..0433351 100644
--- a/php/admin/templates/createuser.tpl
+++ b/php/admin/templates/createuser.tpl
@@ -17,6 +17,11 @@
<td>{tr msg="Required"}</td>
</tr>
<tr>
+ <td>{tr msg="Middle Name"}</td>
+ <td><input name="middlename" type="text" value="" size="50" onfocus="javascript:this.select()" /></td>
+ <td></td>
+</tr>
+<tr>
<td>{tr msg="Last Name"}</td>
<td><input name="lastname" type="text" value="" size="50" onfocus="javascript:this.select()" /></td>
<td>{tr msg="Required"}</td>
@@ -37,7 +42,8 @@
<td>{tr msg="Required, non volatile"}</td>
</tr>
<tr>
- <td>{tr msg="Title"}</td><td><input name="title_0" type="text" value="" size="50" onfocus="javascript:this.select()" /></td>
+ <td>{tr msg="Title"}</td>
+ <td><input name="title_0" type="text" value="" size="50" onfocus="javascript:this.select()" /></td>
<td></td>
</tr>
<tr>
diff --git a/www/admin/user/user.php.in b/www/admin/user/user.php.in
index 81d50d1..6788d85 100644
--- a/www/admin/user/user.php.in
+++ b/www/admin/user/user.php.in
@@ -273,11 +273,14 @@ function fill_form_for_modify( &$form, $dn, &$ldap_object ) {
if (is_array($ldap_object['cn'])) $cn = $ldap_object['cn'][0];
else $cn = $ldap_object['cn'];
if ($cn && $sn) $givenname = KolabLDAP::getGivenName($cn, $sn);
+ if (is_array($ldap_object['initials'])) $initials = $ldap_object['initials'][0];
+ else $initials = $ldap_object['initials'];
if (is_array($ldap_object['mail'])) $mail = $ldap_object['mail'][0];
else $mail = $ldap_object['mail'];
if (is_array($ldap_object['uid'])) $uid = $ldap_object['uid'][0];
else $uid = $ldap_object['uid'];
if(array_key_exists('givenname',$form->entries)) $form->entries['givenname']['value'] = $givenname;
+ if(array_key_exists('initials',$form->entries)) $form->entries['initials']['value'] = $initials;
if(array_key_exists('sn',$form->entries)) $form->entries['sn']['value'] = $sn;
if(array_key_exists('password_0',$form->entries)) $form->entries['password_0']['value'] = '';
if(array_key_exists('password_1',$form->entries)) $form->entries['password_1']['value'] = '';
@@ -446,6 +449,7 @@ if ($action == "create") {
$entries = array( 'givenname' => array( 'name' => _('First Name'),
'validation' => 'notempty',
'comment' => _('Required') ),
+ 'initials' => array( 'name' => _('Middle Name')),
'sn' => array( 'name' => _('Last Name'),
'validation' => 'notempty',
'comment' => _('Required') ),
@@ -517,8 +521,9 @@ if( $auth->group() == 'admin' || $auth->group() == 'maintainer' || $auth->group(
'validation' => 'checkquota');
} else {
$entries['givenname']['attrs'] = 'readonly';
- $entries['sn']['attrs'] = 'readonly';
$entries['givenname']['comment'] = '';
+ $entries['initials']['attrs'] = 'readonly';
+ $entries['sn']['attrs'] = 'readonly';
$entries['sn']['comment'] = '';
$entries['alias']['attrs'] = 'readonly';
$entries['kolabdelegate']['attrs'] = 'readonly';
@@ -565,6 +570,11 @@ switch( $action ) {
$ldap_object['sn'] = trim($_POST['sn']);
$ldap_object['cn'] = trim($_POST['givenname']).' '.$ldap_object['sn'];
$ldap_object['givenName'] = trim($_POST['givenname']);
+ if (!empty($_POST['initials'])) {
+ $ldap_object['initials'] = trim($_POST['initials']);
+ } else {
+ $ldap_object['initials'] = array();
+ }
if( !empty( $_POST['password_0'] ) ) {
$ldap_object['userPassword'] = ssha( $_POST['password_0'], gensalt());
if( $action == 'save' && $auth->dn() == $dn ) {