From f160c697e4fb5add0d1523f38756fd21301c2e39 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 22 Jul 2019 11:49:57 -0600 Subject: [PATCH] Admin - When deleting a user, separately list apps that cannot handle it through hook --- admin/inc/class.admin_account.inc.php | 11 ++++++++++- admin/inc/class.admin_ui.inc.php | 2 +- admin/templates/default/account.delete.xet | 15 ++++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/admin/inc/class.admin_account.inc.php b/admin/inc/class.admin_account.inc.php index 161cfe6066..9443d905c4 100644 --- a/admin/inc/class.admin_account.inc.php +++ b/admin/inc/class.admin_account.inc.php @@ -292,6 +292,7 @@ class admin_account } $sel_options = array(); + $readonlys = array(); $preserve = $content; // Get a count of entries owned by the user @@ -303,7 +304,7 @@ class admin_account { $entry = lang('Entries'); } - if($counts['total']) + if($counts['total'] && Api\Hooks::exists('deleteaccount', $app)) { $content['delete_apps'][] = $app; $sel_options['delete_apps'][] = array( @@ -311,6 +312,14 @@ class admin_account 'label' => lang($app) . ': ' . $counts['total'] . ' '.$entry ); } + else if ($counts['total']) + { + // These ones don't support the needed hook + $content['counts'][] = array( + 'app' => $app, + 'count' => $counts['total'] . ' '.$entry + ); + } } $tpl = new Etemplate('admin.account.delete'); $tpl->exec('admin_account::delete', $content, $sel_options, array(), $preserve, 2); diff --git a/admin/inc/class.admin_ui.inc.php b/admin/inc/class.admin_ui.inc.php index 1b55a63fd2..e8ab14ac45 100644 --- a/admin/inc/class.admin_ui.inc.php +++ b/admin/inc/class.admin_ui.inc.php @@ -209,7 +209,7 @@ class admin_ui $actions['delete'] = array( 'caption' => 'Delete', 'group' => ++$group, - 'popup' => '450x400', + 'popup' => '615x590', 'url' => 'menuaction=admin.admin_account.delete&account_id=$id', 'allowOnMultiple' => false, ); diff --git a/admin/templates/default/account.delete.xet b/admin/templates/default/account.delete.xet index 3afc00e422..fbd577b32b 100644 --- a/admin/templates/default/account.delete.xet +++ b/admin/templates/default/account.delete.xet @@ -6,8 +6,21 @@ - +