diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2009-08-31 14:57:04 +0000 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2009-08-31 14:57:04 +0000 |
commit | 139f1d35302fc675b5e972e55c62d36cbc42af5c (patch) | |
tree | 9618453f34cafc260fbb26883f9a51d01bc072d2 | |
parent | d7925595dc46c1d913dd722b2121d4552c20cb47 (diff) | |
download | forums-139f1d35302fc675b5e972e55c62d36cbc42af5c.tar forums-139f1d35302fc675b5e972e55c62d36cbc42af5c.tar.gz forums-139f1d35302fc675b5e972e55c62d36cbc42af5c.tar.bz2 forums-139f1d35302fc675b5e972e55c62d36cbc42af5c.tar.xz forums-139f1d35302fc675b5e972e55c62d36cbc42af5c.zip |
fix r10076 for #48615 - Ability to specify amount of time user is able to delete his last post in topic.
Authorised by: AcydBurn
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10080 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 3 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_board.php | 1 | ||||
-rw-r--r-- | phpBB/install/database_update.php | 5 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 1 | ||||
-rw-r--r-- | phpBB/language/en/acp/board.php | 2 | ||||
-rw-r--r-- | phpBB/posting.php | 4 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 3 |
7 files changed, 15 insertions, 4 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index f1f5787cab..bf34bea603 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -201,7 +201,6 @@ <li>[Fix] Sort private messages by message time and not message id. (Bug #50015)</li> <li>[Fix] Make sure only logs for existing users are displayed and user-specific logs removed on user deletion. (Bug #49855)</li> <li>[Fix] Only show "Add friend" and "Add foe" links if the specific module is enabled. (Bug #50475)</li> - <li>[Fix] Do not take edit post time into account for determining permission to delete last post in topic. (Bug #48615)</li> <li>[Fix] Correctly display list items in forum description in prosilver and administration. (Bug #48055 - Patch by leviatan21)</li> <li>[Fix] Fix handling of bookmarks and subscriptions on "split topcis", "merge topics" and "merge posts". (Bug #50035)</li> <li>[Change] submit_post() now accepts force_approved_state key passed to $data to indicate new posts being approved (true) or unapproved (false).</li> @@ -234,6 +233,7 @@ <li>[Change] Require user to be registered and logged in to search for unread posts if topic read tracking is disabled for guests (Bug #49525)</li> <li>[Change] Allow three-digit hex notation in Color BBcode. (Bug #39965 - Patch by m0rpha)</li> <li>[Change] Simplified login_box() and redirection after login. S_LOGIN_ACTION can now be used on every page. (Bug #50285)</li> + <li>[Change] Do not take edit post time into account for determining permission to delete last post in topic. (Bug #48615)</li> <li>[Feature] Add language selection on the registration terms page (Bug #15085 - Patch by leviatan21)</li> <li>[Feature] Backported 3.2 captcha plugins. <ul> @@ -289,6 +289,7 @@ <li>[Feature] Ability to define constant PHPBB_USE_BOARD_URL_PATH to use board url for images/avatars/ranks/imageset...</li> <li>[Feature] Added function to generate Email hash. (Bug #49195)</li> <li>[Feature] Style authors are now able to define the default submit button used for form submission on ENTER keypress on forms using more than one. Prosilver uses this for the posting page(s) and registration screen.</li> + <li>[Feature] Ability to specify amount of time user is able to delete his last post in topic.</li> </ul> <a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3> diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 78ba5092a0..9f0bcf210f 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -177,6 +177,7 @@ class acp_board 'legend2' => 'POSTING', 'bump_type' => false, 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'delete_time' => array('lang' => 'DELETE_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int:0', 'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int:0', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index d489521a20..48dd55ac72 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1498,6 +1498,11 @@ function change_database_data(&$no_updates, $version) _sql($sql, $errored, $error_ary); } + if (!isset($config['delete_time'])) + { + set_config('delete_time', $config['edit_time']); + } + $no_updates = false; break; } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 30acb90618..b582b8a8bd 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -90,6 +90,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style', '1 INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail'); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 2673b4a1ed..8797a1210a 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -152,6 +152,8 @@ $lang = array_merge($lang, array( 'BUMP_INTERVAL_EXPLAIN' => 'Number of minutes, hours or days between the last post to a topic and the ability to bump this topic.', 'CHAR_LIMIT' => 'Maximum characters per post/message', 'CHAR_LIMIT_EXPLAIN' => 'The number of characters allowed within a post/private message. Set to 0 for unlimited characters.', + 'DELETE_TIME' => 'Limit deleting time', + 'DELETE_TIME_EXPLAIN' => 'Limits the time available to delete a new post. Setting the value to 0 disables this behaviour.', 'DISPLAY_LAST_EDITED' => 'Display last edited time information', 'DISPLAY_LAST_EDITED_EXPLAIN' => 'Choose if the last edited by information to be displayed on posts.', 'EDIT_TIME' => 'Limit editing time', diff --git a/phpBB/posting.php b/phpBB/posting.php index 77a499db4b..b241da2eab 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1433,7 +1433,7 @@ $template->assign_vars(array( 'S_EDIT_REASON' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false, 'S_DISPLAY_USERNAME' => (!$user->data['is_registered'] || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS)) ? true : false, 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, - 'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked']) || $auth->acl_get('m_delete', $forum_id))) ? true : false, + 'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])) || $auth->acl_get('m_delete', $forum_id))) ? true : false, 'S_BBCODE_ALLOWED' => $bbcode_status, 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', 'S_SMILIES_ALLOWED' => $smilies_status, @@ -1545,7 +1545,7 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data) global $phpbb_root_path, $phpEx; // If moderator removing post or user itself removing post, present a confirmation screen - if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'])) + if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']))) { $s_hidden_fields = build_hidden_fields(array( 'p' => $post_id, diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index eaa17279a2..e7522841e3 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1476,7 +1476,8 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) $user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && - // we do not want to allowe removal of the last post if a moderator locked it! + ($row['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']) && + // we do not want to allow removal of the last post if a moderator locked it! !$row['post_edit_locked'] ))); |