From 6aa45fb9cc2569f99b550003ee3f98916754dd0a Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Mon, 17 Sep 2012 08:48:43 -0400 Subject: [PATCH] admin: Don't allow to block or delete site admin in users admin page. fix bug 471 --- mod/admin.php | 3 +++ view/admin_users.tpl | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 5edb927559..ee04830548 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -664,6 +664,7 @@ function admin_page_users(&$a){ ); function _setup_users($e){ + $a = get_app(); $accounts = Array( t('Normal Account'), t('Soapbox Account'), @@ -674,6 +675,7 @@ function admin_page_users(&$a){ $e['register_date'] = relative_date($e['register_date']); $e['login_date'] = relative_date($e['login_date']); $e['lastitem_date'] = relative_date($e['lastitem_date']); + $e['is_admin'] = ($e['email'] === $a->config['admin_email']); return $e; } $users = array_map("_setup_users", $users); @@ -694,6 +696,7 @@ function admin_page_users(&$a){ '$delete' => t('Delete'), '$block' => t('Block'), '$unblock' => t('Unblock'), + '$siteadmin' => t('Site admin'), '$h_users' => t('Users'), '$th_users' => array( t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account') ), diff --git a/view/admin_users.tpl b/view/admin_users.tpl index f67e4a0f74..c9ab0e3f73 100644 --- a/view/admin_users.tpl +++ b/view/admin_users.tpl @@ -70,11 +70,20 @@ $u.register_date $u.login_date $u.lastitem_date - $u.page-flags - + $u.page-flags {{ if $u.is_admin }}($siteadmin){{ endif }} + + {{ if $u.is_admin }} +   + {{ else }} + + {{ endif }} - - + {{ if $u.is_admin }} +   + {{ else }} + + + {{ endif }} {{ endfor }} -- 2.39.5