Admin: change delete user home directory back to special case, getting actual file count takes way too long.

This commit is contained in:
nathangray 2019-11-18 14:02:38 -07:00
parent 94a9290776
commit a39d257eac
2 changed files with 11 additions and 8 deletions

View File

@ -302,10 +302,7 @@ class admin_account
{
$entry = lang('Entries');
}
if($counts['total'] && (
// Filemanager is a special case, since the hook is in API
Api\Hooks::exists('deleteaccount', $app) || in_array($app, array('filemanager'))
))
if($counts['total'] && Api\Hooks::exists('deleteaccount', $app))
{
$content['delete_apps'][] = $app;
$sel_options['delete_apps'][] = array(
@ -322,6 +319,16 @@ class admin_account
);
}
}
// Add filemanager home directory in as special case, hook is in the API
if(Api\Vfs::file_exists('/home/'.$GLOBALS['egw']->accounts->id2name($content['account_id'])))
{
$app = 'filemanager';
$sel_options['delete_apps'][] = array(
'value' => $app,
'label' => lang($app) . ': ' . lang('home directory')
);
$content['delete_apps'][] = $app;
}
$tpl = new Etemplate('admin.account.delete');
$tpl->exec('admin_account::delete', $content, $sel_options, array(), $preserve, 2);

View File

@ -1089,10 +1089,6 @@ class Accounts
}
}
// Add filemanager as special case, since most of it is in Api
$files = Vfs::find('/', array('uid' => (int)$account_id, 'limit' => 50));
$counts['filemanager']['total'] = Vfs::$find_total;
return $counts;
}
protected function get_owner_columns()