aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/install_convert.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2011-11-15 17:23:55 +0100
committerJoas Schilling <nickvergessen@gmx.de>2011-11-15 17:23:55 +0100
commit815dd3591b2618f072791aeb7bf6d87492e690b0 (patch)
tree3dea6b555a7c5e56909b7c3e6a1360bc85c8fb0f /phpBB/install/install_convert.php
parent00f792f16f6f8c9a826c5a44e539fb3aeb80c340 (diff)
downloadforums-815dd3591b2618f072791aeb7bf6d87492e690b0.tar
forums-815dd3591b2618f072791aeb7bf6d87492e690b0.tar.gz
forums-815dd3591b2618f072791aeb7bf6d87492e690b0.tar.bz2
forums-815dd3591b2618f072791aeb7bf6d87492e690b0.tar.xz
forums-815dd3591b2618f072791aeb7bf6d87492e690b0.zip
[ticket/10185] Always set board startdate on conversion
The board startdate should always be set to first user registration date. The current code did not do anything at all, as the board_startdate was always set on installation before running the convertor. PHPBB3-10185
Diffstat (limited to 'phpBB/install/install_convert.php')
-rw-r--r--phpBB/install/install_convert.php21
1 files changed, 9 insertions, 12 deletions
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 814b50cf68..62efc3e46b 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -1716,19 +1716,16 @@ class install_convert extends module
fix_empty_primary_groups();
- if (!isset($config['board_startdate']))
- {
- $sql = 'SELECT MIN(user_regdate) AS board_startdate
- FROM ' . USERS_TABLE;
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $sql = 'SELECT MIN(user_regdate) AS board_startdate
+ FROM ' . USERS_TABLE;
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- if (($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0) || !isset($config['board_startdate']))
- {
- set_config('board_startdate', $row['board_startdate']);
- $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS);
- }
+ if (!isset($config['board_startdate']) || ($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0))
+ {
+ set_config('board_startdate', $row['board_startdate']);
+ $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS);
}
update_dynamic_config();