diff options
author | Nils Adermann <naderman@naderman.de> | 2012-05-29 16:42:37 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2012-05-29 16:42:37 +0200 |
commit | 9ead56acb3a64f2a6ac20336e02c0a976935bd3b (patch) | |
tree | 9ef5ca1dd2927a0d22edad2a244758e1c5e9c2d1 /phpBB | |
parent | efa96e1817847b94abe6d6d0f3f4a8563339f745 (diff) | |
parent | 041b7be77ecd4e52048b94b4e47ad8268716a032 (diff) | |
download | forums-9ead56acb3a64f2a6ac20336e02c0a976935bd3b.tar forums-9ead56acb3a64f2a6ac20336e02c0a976935bd3b.tar.gz forums-9ead56acb3a64f2a6ac20336e02c0a976935bd3b.tar.bz2 forums-9ead56acb3a64f2a6ac20336e02c0a976935bd3b.tar.xz forums-9ead56acb3a64f2a6ac20336e02c0a976935bd3b.zip |
Merge remote-tracking branch 'github-dhruv/ticket/10308' into develop-olympus
By Dhruv Goel
via Dhruv Goel
* github-dhruv/ticket/10308:
[ticket/10308] fixes indentation
[ticket/10308] fixes language variable name
[ticket/10308] makes variable boolean
[ticket/10308] fixes sql query, limit it to 1
[ticket/10308] fixes user deletion if no posts
[ticket/10308] renames language key to USER_NO_POSTS_DELETE
[ticket/10308] fix language and user's total posts
[ticket/10308] fixes language entity.
[ticket/10308] Displays message to user if there are no posts.
[ticket/10308] disable retain/ delete posts option when deleting a user
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/adm/style/acp_users_overview.html | 33 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 8 | ||||
-rw-r--r-- | phpBB/language/en/acp/users.php | 1 |
3 files changed, 28 insertions, 14 deletions
diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html index 9237e45daf..e2dcdb6307 100644 --- a/phpBB/adm/style/acp_users_overview.html +++ b/phpBB/adm/style/acp_users_overview.html @@ -135,19 +135,24 @@ </form> <!-- IF not S_OWN_ACCOUNT --> - <form id="user_delete" method="post" action="{U_ACTION}"> - <fieldset> - <legend>{L_DELETE_USER}</legend> - <dl> - <dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt> - <dd><select id="delete_type" name="delete_type"><option class="sep" value="">{L_SELECT_OPTION}</option><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd> - </dl> - <p class="quick"> - <input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> - <input type="hidden" name="delete" value="1" /> - {S_FORM_TOKEN} - </p> - </fieldset> - </form> + <form id="user_delete" method="post" action="{U_ACTION}"> + <fieldset> + <legend>{L_DELETE_USER}</legend> + <dl> + <dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt> + <dd> + <!-- IF USER_HAS_POSTS --> + <select id="delete_type" name="delete_type"><option class="sep" value="">{L_SELECT_OPTION}</option><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd> + <!-- ELSE --> + {L_USER_NO_POSTS_TO_DELETE}<input type="hidden" id="delete_type" name="delete_type" value="retain" /> + <!-- ENDIF --> + </dl> + <p class="quick"> + <input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> + <input type="hidden" name="delete" value="1" /> + {S_FORM_TOKEN} + </p> + </fieldset> + </form> <!-- ENDIF --> <!-- ENDIF --> diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 363c900edc..70e08f79f2 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1009,6 +1009,13 @@ class acp_users $user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue'); $db->sql_freeresult($result); + $sql = 'SELECT post_id + FROM ' . POSTS_TABLE . ' + WHERE poster_id = '. $user_id; + $result = $db->sql_query_limit($sql, 1); + $user_row['user_has_posts'] = (bool) $db->sql_fetchfield('post_id'); + $db->sql_freeresult($result); + $template->assign_vars(array( 'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), @@ -1036,6 +1043,7 @@ class acp_users 'USER_EMAIL' => $user_row['user_email'], 'USER_WARNINGS' => $user_row['user_warnings'], 'USER_POSTS' => $user_row['user_posts'], + 'USER_HAS_POSTS' => $user_row['user_has_posts'], 'USER_INACTIVE_REASON' => $inactive_reason, )); diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php index eda9659795..785283faea 100644 --- a/phpBB/language/en/acp/users.php +++ b/phpBB/language/en/acp/users.php @@ -124,6 +124,7 @@ $lang = array_merge($lang, array( 'USER_GROUP_SPECIAL' => 'Pre-defined groups user is a member of', 'USER_LIFTED_NR' => 'Successfully removed the user’s newly registered status.', 'USER_NO_ATTACHMENTS' => 'There are no attached files to display.', + 'USER_NO_POSTS_TO_DELETE' => 'The user has no posts to retain or delete.', 'USER_OUTBOX_EMPTIED' => 'Successfully emptied user’s private message outbox.', 'USER_OUTBOX_EMPTY' => 'The user’s private message outbox was already empty.', 'USER_OVERVIEW_UPDATED' => 'User details updated.', |