fixed about deleting of accounts:

- prevent deleting of own account (as in admin)
- return for accounts account_id and _lid as the sql class does
- do not redirect to admin.uiaccounts.delete_user if no account_id set, as I deletes the current user ;-)
This commit is contained in:
Ralf Becker 2006-06-14 16:53:14 +00:00
parent 6d3833d0ed
commit ac102085ac
3 changed files with 12 additions and 1 deletions

View File

@ -466,10 +466,16 @@ class bocontacts extends socontacts
} }
$owner = $contact['owner']; $owner = $contact['owner'];
// allow the user to edit his own account
if (!$owner && $needed == EGW_ACL_EDIT && $contact['account_id'] == $this->user) if (!$owner && $needed == EGW_ACL_EDIT && $contact['account_id'] == $this->user)
{ {
return true; return true;
} }
// dont allow to delete own account (as admin handels it too)
if (!$owner && $needed == EGW_ACL_DELETE && $contact['account_id'] == $this->user)
{
return false;
}
return ($this->grants[$owner] & $needed) && return ($this->grants[$owner] & $needed) &&
(!$contact['private'] || ($this->grants[$owner] & EGW_ACL_PRIVATE) || in_array($owner,$this->memberships)); (!$contact['private'] || ($this->grants[$owner] & EGW_ACL_PRIVATE) || in_array($owner,$this->memberships));
} }

View File

@ -78,6 +78,10 @@ class so_ldap
* @var array * @var array
*/ */
var $schema2egw = array( var $schema2egw = array(
'posixaccount' => array(
'account_id' => 'uidnumber',
'account_lid' => 'uid',
),
'inetorgperson' => array( 'inetorgperson' => array(
'n_fn' => 'cn', 'n_fn' => 'cn',
'n_given' => 'givenname', 'n_given' => 'givenname',

View File

@ -271,7 +271,8 @@ class uicontacts extends bocontacts
{ {
$Ok = $this->delete($id); $Ok = $this->delete($id);
} }
elseif (count($checked) == 1) // delete single account --> redirect to admin // delete single account --> redirect to admin
elseif (count($checked) == 1 && $contact['account_id'])
{ {
$GLOBALS['egw']->redirect_link('/index.php',array( $GLOBALS['egw']->redirect_link('/index.php',array(
'menuaction' => 'admin.uiaccounts.delete_user', 'menuaction' => 'admin.uiaccounts.delete_user',