diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c7b610e8..0ad8b072e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ - Show poll prefix for guests [\#1417](https://github.com/torrentpier/torrentpier/pull/1417) ([belomaxorka](https://github.com/belomaxorka)) - Used hashing for filenames generation [\#1385](https://github.com/torrentpier/torrentpier/pull/1385) ([belomaxorka](https://github.com/belomaxorka)) - Hide quote button if topic locked [\#1416](https://github.com/torrentpier/torrentpier/pull/1416) ([belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#1382](https://github.com/torrentpier/torrentpier/pull/1382), [\#1383](https://github.com/torrentpier/torrentpier/pull/1383), [\#1391](https://github.com/torrentpier/torrentpier/pull/1391), [\#1398](https://github.com/torrentpier/torrentpier/pull/1398), [\#1405](https://github.com/torrentpier/torrentpier/pull/1405), [\#1406](https://github.com/torrentpier/torrentpier/pull/1406), [\#1408](https://github.com/torrentpier/torrentpier/pull/1408), [\#1409](https://github.com/torrentpier/torrentpier/pull/1409), [\#1410](https://github.com/torrentpier/torrentpier/pull/1410), [\#1411](https://github.com/torrentpier/torrentpier/pull/1411) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#1382](https://github.com/torrentpier/torrentpier/pull/1382), [\#1383](https://github.com/torrentpier/torrentpier/pull/1383), [\#1391](https://github.com/torrentpier/torrentpier/pull/1391), [\#1398](https://github.com/torrentpier/torrentpier/pull/1398), [\#1405](https://github.com/torrentpier/torrentpier/pull/1405), [\#1406](https://github.com/torrentpier/torrentpier/pull/1406), [\#1408](https://github.com/torrentpier/torrentpier/pull/1408), [\#1409](https://github.com/torrentpier/torrentpier/pull/1409), [\#1410](https://github.com/torrentpier/torrentpier/pull/1410), [\#1411](https://github.com/torrentpier/torrentpier/pull/1411), [\#1418](https://github.com/torrentpier/torrentpier/pull/1418) ([belomaxorka](https://github.com/belomaxorka)) - Some bugfixes [\#1380](https://github.com/torrentpier/torrentpier/pull/1380) ([belomaxorka](https://github.com/belomaxorka)) - Updated deps [\#1414](https://github.com/torrentpier/torrentpier/pull/1414), [\#1415](https://github.com/torrentpier/torrentpier/pull/1415), [\#1421](https://github.com/torrentpier/torrentpier/pull/1421) ([belomaxorka](https://github.com/belomaxorka)) - New Crowdin updates [\#1384](https://github.com/torrentpier/torrentpier/pull/1384), [\#1389](https://github.com/torrentpier/torrentpier/pull/1389), [\#1392](https://github.com/torrentpier/torrentpier/pull/1392), [\#1402](https://github.com/torrentpier/torrentpier/pull/1402), [\#1403](https://github.com/torrentpier/torrentpier/pull/1403), [\#1412](https://github.com/torrentpier/torrentpier/pull/1412), [\#1420](https://github.com/torrentpier/torrentpier/pull/1420) ([Exileum](https://github.com/Exileum)) diff --git a/library/ajax/manage_admin.php b/library/ajax/manage_admin.php index c87de275a..afb60f408 100644 --- a/library/ajax/manage_admin.php +++ b/library/ajax/manage_admin.php @@ -25,7 +25,6 @@ switch ($mode) { $this->response['cache_html'] = '' . $lang['ALL_CACHE_CLEARED'] . ''; break; - case 'clear_datastore': global $datastore; @@ -33,7 +32,6 @@ switch ($mode) { $this->response['datastore_html'] = '' . $lang['DATASTORE_CLEARED'] . ''; break; - case 'clear_template_cache': global $template; @@ -49,7 +47,6 @@ switch ($mode) { $this->response['template_cache_html'] = '' . $lang['ALL_TEMPLATE_CLEARED'] . ''; break; - case 'indexer': exec("indexer --config {$bb_cfg['sphinx_config_path']} --all --rotate", $result); @@ -68,32 +65,23 @@ switch ($mode) { $this->response['indexer_html'] = '' . $lang['INDEXER'] . ''; break; - case 'update_user_level': \TorrentPier\Legacy\Group::update_user_level('all'); - $this->response['update_user_level_html'] = '' . $lang['USER_LEVELS_UPDATED'] . ''; break; - case 'sync_topics': \TorrentPier\Legacy\Admin\Common::sync('topic', 'all'); \TorrentPier\Legacy\Admin\Common::sync_all_forums(); - $this->response['sync_topics_html'] = '' . $lang['TOPICS_DATA_SYNCHRONIZED'] . ''; break; - case 'sync_user_posts': \TorrentPier\Legacy\Admin\Common::sync('user_posts', 'all'); - $this->response['sync_user_posts_html'] = '' . $lang['USER_POSTS_COUNT_SYNCHRONIZED'] . ''; break; - case 'unlock_cron': \TorrentPier\Helpers\CronHelper::enableBoard(); - $this->response['unlock_cron_html'] = '' . $lang['ADMIN_UNLOCKED'] . ''; break; - default: $this->ajax_die('Invalid mode: ' . $mode); } diff --git a/library/ajax/manage_user.php b/library/ajax/manage_user.php index 24b78271b..4b9216e23 100644 --- a/library/ajax/manage_user.php +++ b/library/ajax/manage_user.php @@ -35,55 +35,46 @@ switch ($mode) { $this->prompt_for_confirm($lang['USER_DELETE_CONFIRM']); } - if ($user_id != BOT_UID) { + if (!in_array($user_id, explode(',', EXCLUDED_USERS))) { \TorrentPier\Sessions::delete_user_sessions($user_id); \TorrentPier\Legacy\Admin\Common::user_delete($user_id); + $user_id = $userdata['user_id']; // Store self user_id for redirect after successful deleting $this->response['info'] = $lang['USER_DELETED']; } else { $this->ajax_die($lang['USER_DELETE_CSV']); } break; case 'delete_topics': - if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) { + if ($userdata['user_id'] == $user_id) { $this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']); } if (empty($this->request['confirmed'])) { $this->prompt_for_confirm($lang['DELETE_USER_ALL_POSTS_CONFIRM']); } - if (IS_ADMIN) { - $user_topics = DB()->fetch_rowset("SELECT topic_id FROM " . BB_TOPICS . " WHERE topic_poster = $user_id", 'topic_id'); - $deleted_topics = \TorrentPier\Legacy\Admin\Common::topic_delete($user_topics); - $deleted_posts = \TorrentPier\Legacy\Admin\Common::post_delete('user', $user_id); - - $this->response['info'] = $lang['USER_DELETED_POSTS']; - } else { - $this->ajax_die($lang['NOT_ADMIN']); - } + $user_topics = DB()->fetch_rowset("SELECT topic_id FROM " . BB_TOPICS . " WHERE topic_poster = $user_id", 'topic_id'); + $deleted_topics = \TorrentPier\Legacy\Admin\Common::topic_delete($user_topics); + $deleted_posts = \TorrentPier\Legacy\Admin\Common::post_delete('user', $user_id); + $this->response['info'] = $lang['USER_DELETED_POSTS']; break; case 'delete_message': - if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) { + if ($userdata['user_id'] == $user_id) { $this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']); } if (empty($this->request['confirmed'])) { $this->prompt_for_confirm($lang['DELETE_USER_POSTS_CONFIRM']); } - if (IS_ADMIN) { - \TorrentPier\Legacy\Admin\Common::post_delete('user', $user_id); - - $this->response['info'] = $lang['USER_DELETED_POSTS']; - } else { - $this->ajax_die($lang['NOT_ADMIN']); - } + \TorrentPier\Legacy\Admin\Common::post_delete('user', $user_id); + $this->response['info'] = $lang['USER_DELETED_POSTS']; break; case 'user_activate': if (empty($this->request['confirmed'])) { $this->prompt_for_confirm($lang['DEACTIVATE_CONFIRM']); } - DB()->query("UPDATE " . BB_USERS . " SET user_active = '1' WHERE user_id = " . $user_id); + DB()->query("UPDATE " . BB_USERS . " SET user_active = 1 WHERE user_id = " . $user_id); $this->response['info'] = $lang['USER_ACTIVATE_ON']; break; case 'user_deactivate': @@ -94,11 +85,10 @@ switch ($mode) { $this->prompt_for_confirm($lang['ACTIVATE_CONFIRM']); } - DB()->query("UPDATE " . BB_USERS . " SET user_active = '0' WHERE user_id = " . $user_id); + DB()->query("UPDATE " . BB_USERS . " SET user_active = 0 WHERE user_id = " . $user_id); \TorrentPier\Sessions::delete_user_sessions($user_id); $this->response['info'] = $lang['USER_ACTIVATE_OFF']; break; - default: $this->ajax_die('Invalid mode'); } diff --git a/styles/templates/default/viewforum.tpl b/styles/templates/default/viewforum.tpl index 08a7ca024..827aa88e5 100644 --- a/styles/templates/default/viewforum.tpl +++ b/styles/templates/default/viewforum.tpl @@ -473,7 +473,7 @@ td.topic_id { cursor: pointer; }

{t.REPLIES} - | + | {t.VIEWS}