"fixed not working creation, rename and deletion of user- and group-dirs

--> it's done now via hooks from the vfs_home class for all types of vfs"
This commit is contained in:
Ralf Becker 2007-04-29 12:07:43 +00:00
parent 410dadba14
commit 8d5370febe

View File

@ -49,14 +49,14 @@
// delete all acl (and memberships) of group // delete all acl (and memberships) of group
$GLOBALS['egw']->acl->delete_account($account_id); $GLOBALS['egw']->acl->delete_account($account_id);
if(!@rmdir($GLOBALS['egw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['egw']->accounts->id2name($account_id))) // make this information also available in the hook
{ $lid = $GLOBALS['egw']->accounts->id2name($account_id);
$cd = 38;
} $GLOBALS['egw']->hooks->process($GLOBALS['hook_values'] = array(
else 'account_id' => $account_id,
{ 'account_name' => $lid,
$cd = 32; 'location' => 'deletegroup'
} ),False,True); // called for every app now, not only enabled ones)
$GLOBALS['egw']->accounts->delete($account_id); $GLOBALS['egw']->accounts->delete($account_id);
@ -86,18 +86,6 @@
{ {
$GLOBALS['egw']->hooks->single($GLOBALS['hook_values'],$app); $GLOBALS['egw']->hooks->single($GLOBALS['hook_values'],$app);
} }
$basedir = $GLOBALS['egw_info']['server']['files_dir'] . SEP . 'users' . SEP;
if(!@rmdir($basedir . $lid))
{
$cd = 34;
}
else
{
$cd = 29;
}
return True; return True;
} }
@ -145,13 +133,11 @@
} }
$apps->save_repository(); $apps->save_repository();
$basedir = $GLOBALS['egw_info']['server']['files_dir'] . SEP . 'groups' . SEP; $GLOBALS['hook_values'] = $group_info;
$cd = 31; $GLOBALS['egw']->hooks->process($GLOBALS['hook_values']+array(
umask(000); 'location' => 'addgroup'
if(!@mkdir($basedir . $group_info['account_name'], 0707)) ),False,True); // called for every app now, not only enabled ones)
{
$cd = 37;
}
return True; return True;
} }
@ -250,35 +236,16 @@
} }
$apps->save_repository(); $apps->save_repository();
// Set new account_lid, if needed
if($group_info['account_name'] && $old_group_info['account_lid'] <> $group_info['account_name'])
{
$group->data['account_lid'] = $group_info['account_name'];
$group->data['firstname'] = $group_info['account_name'];
$basedir = $GLOBALS['egw_info']['server']['files_dir'] . SEP . 'groups' . SEP;
if(!@rename($basedir . $old_group_info['account_lid'], $basedir . $group_info['account_name']))
{
$cd = 39;
}
else
{
$cd = 33;
}
}
else
{
$cd = 33;
}
$group->set_members($group_info['account_user'],$group_info['account_id']); $group->set_members($group_info['account_user'],$group_info['account_id']);
$GLOBALS['hook_values'] = $group_info;
$GLOBALS['hook_values']['old_name'] = $group->id2name($group_info['account_id']);
// This is down here so we are sure to catch the acl changes // This is down here so we are sure to catch the acl changes
// for LDAP to update the memberuid attribute // for LDAP to update the memberuid attribute
$group->data['account_email'] = $group_info['account_email']; $group->data['account_email'] = $group_info['account_email'];
$group->save_repository(); $group->save_repository();
$GLOBALS['hook_values'] = $group_info;
$GLOBALS['egw']->hooks->process($GLOBALS['hook_values']+array( $GLOBALS['egw']->hooks->process($GLOBALS['hook_values']+array(
'location' => 'editgroup' 'location' => 'editgroup'
),False,True); // called for every app now, not only enabled ones) ),False,True); // called for every app now, not only enabled ones)