forked from extern/egroupware
implemented moving of data to an other account on deleting an account
This commit is contained in:
parent
13cf2edabb
commit
24989686df
@ -68,14 +68,20 @@ class vfs_home_hooks
|
|||||||
*/
|
*/
|
||||||
static function deleteAccount($data)
|
static function deleteAccount($data)
|
||||||
{
|
{
|
||||||
if ($data['new_owner'])
|
|
||||||
{
|
|
||||||
// ToDo: copy content of user-dir to new owner's user-dir
|
|
||||||
|
|
||||||
}
|
|
||||||
// delete the user-directory
|
|
||||||
egw_vfs::$is_root = true;
|
egw_vfs::$is_root = true;
|
||||||
|
if ($data['new_owner'] && ($new_lid = $GLOBALS['egw']->accounts->id2name($data['new_owner'])))
|
||||||
|
{
|
||||||
|
// copy content of user-dir to new owner's user-dir as old-home-$name
|
||||||
|
for ($i=''; file_exists(egw_vfs::PREFIX.($new_dir = '/home/'.$new_lid.'/old-home-'.$data['account_lid'].$i)); $i++);
|
||||||
|
egw_vfs::rename('/home/'.$data['account_lid'],$new_dir);
|
||||||
|
// make the new owner the owner of the dir and it's content
|
||||||
|
egw_vfs::find($new_dir,array(),array('egw_vfs','chown'),$data['new_owner']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// delete the user-directory
|
||||||
egw_vfs::remove('/home/'.$data['account_lid']);
|
egw_vfs::remove('/home/'.$data['account_lid']);
|
||||||
|
}
|
||||||
egw_vfs::$is_root = false;
|
egw_vfs::$is_root = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user