diff --git a/doc/CHANGELOG b/doc/CHANGELOG index d8cb067a08..9f989d27e0 100755 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -4,6 +4,7 @@ - Fixed a number of preferences bugs on the main screen. - Fixed E-Mail sigs not being added. - Moved E-Mail preferences into its own section. + - When changing NNTP servers, now deletes newsgroups and users_newsgroups. [0.9.2] - Fixed sorting bug in currentusers.php - Cleaned up error reporting and form in newaccount.php diff --git a/setup/config.php b/setup/config.php index ff11148fa3..304ff6aad0 100644 --- a/setup/config.php +++ b/setup/config.php @@ -40,6 +40,16 @@ if ($submit) { $db->query("delete from config"); while ($newsetting = each($newsettings)) { + if($newsetting[0] == "nntp_server") { + $db->query("select nntp_server from config"); + if($db->num_rows()) { + $db->next_record(); + if($db->f("nntp_server") <> $newsetting[1]) { + $db->query("DELETE FROM newsgroups"); + $db->query("DELETE FROM users_newsgroups"); + } + } + } $db->query("insert into config (config_name, config_value) values ('" . addslashes($newsetting[0]) . "','" . addslashes($newsetting[1]) . "')"); }