From 8ac5b3154ce8e9bc499a03ccdf8d8df2ea108ba9 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 27 May 2012 19:20:32 +0000 Subject: [PATCH] allow (un)locking only if write access is allowed --- lam/lib/types/user.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lam/lib/types/user.inc b/lam/lib/types/user.inc index b574a075..62524dc3 100644 --- a/lam/lib/types/user.inc +++ b/lam/lib/types/user.inc @@ -262,11 +262,16 @@ class user extends baseType { } $statusTable .= ''; $tipContent = $statusTable; - $tipContent .= '
"hint" '; - $tipContent .= _('Please click to lock/unlock this account.'); + if (checkIfWriteAccessIsAllowed()) { + $tipContent .= '
"hint" '; + $tipContent .= _('Please click to lock/unlock this account.'); + } $tooltip = "'" . $tipContent . "', TITLE, '" . _('Account status') . "'"; $dialogDiv = $this->buildAccountStatusDialogDiv($unixAvailable, $unixLocked, $sambaAvailable, $sambaLocked, $ppolicyAvailable, $ppolicyLocked); - $onClick = 'onclick="showConfirmationDialog(\'' . _('Change account status') . '\', \'' . _('Ok') . '\', \'' . _('Cancel') . '\', \'lam_accountStatusDialog\', \'inputForm\', \'lam_accountStatusResult\');"'; + $onClick = ''; + if (checkIfWriteAccessIsAllowed()) { + $onClick = 'onclick="showConfirmationDialog(\'' . _('Change account status') . '\', \'' . _('Ok') . '\', \'' . _('Cancel') . '\', \'lam_accountStatusDialog\', \'inputForm\', \'lam_accountStatusResult\');"'; + } return $dialogDiv . 'status   '; }