From 9571dfe29ddf7dc2aeaf63f00048b11f6ce61350 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 8 Feb 2012 18:09:21 +0000 Subject: [PATCH] do not always change cn and loginShell in self service --- lam/lib/modules/posixAccount.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index 599d0dde..e28081c4 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -2158,7 +2158,7 @@ class posixAccount extends baseModule implements passwordService { if (!get_preg($_POST['posixAccount_cn'], 'cn')) { $return['messages'][] = $this->messages['cn'][0]; } - else { + else if (!isset($attributes['cn']) || ($attributes['cn'][0] != $_POST['posixAccount_cn'])) { $return['mod']['cn'][0] = $_POST['posixAccount_cn']; } } @@ -2168,7 +2168,8 @@ class posixAccount extends baseModule implements passwordService { } if (in_array('loginShell', $fields)) { $shelllist = getshells(); // list of all valid shells - if (in_array($_POST['posixAccount_loginShell'], $shelllist)) { + if (in_array($_POST['posixAccount_loginShell'], $shelllist) + && (!isset($attributes['loginShell']) || ($attributes['loginShell'][0] != $_POST['posixAccount_loginShell']))) { $return['mod']['loginShell'][0] = $_POST['posixAccount_loginShell']; } }