Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: simplenick on May 23, 2023, 03:53:37 PM

Title: Registering help
Post by: simplenick on May 23, 2023, 03:53:37 PM
Got an older forum we are looking to start updating soon however noticed sometime over the last few weeks a new error that people get that prevents them from registering as seen below:

Ver: 2.0.15
The database value you're trying to insert does not exist: ip_low1

I do see that under ban_items in the DB and nothing has changed server side with the DB or files - any idea how to fix this up or apply a band-aid fix for now so people can register again?

Thanks!
Title: Re: Registering help
Post by: Kindred on May 23, 2023, 11:23:28 PM
I don't think that is a core smf field...
Title: Re: Registering help
Post by: simplenick on May 24, 2023, 06:40:37 AM
I didn't think so either, forum was setup by someone else nearly 10 years ago.

Any ideas how to get around this error or where to look?

Thanks
Title: Re: Registering help
Post by: simplenick on May 24, 2023, 08:13:25 AM
Came across this in the error log so guessing related to this package:

The database value you're trying to insert does not exist: expire_time
Function: spamBlockerRegisterApply Filter: Only show the errors from this fileFile: /Sources/SpamBlocker.php
Line: 133
--------------------------------------------------------------------------------------------------
So I went to that area (around 133 and found this):
                /* Add data to the ban_groups table */
                if ((!$date) && (((int)$ban_full == 1) || ((int)$ban_post+(int)$ban_register+(int)$ban_login) == 0))
                    $request = $smcFunc['db_insert']('insert', "
                                    {db_prefix}ban_groups",
                                    array('name' => 'string', 'ban_time' => 'int', 'expire_time' => 'int', 'cannot_access' => 'int', 'cannot_register' => 'int', 'cannot_post' => 'int', 'cannot_login' => 'int', 'reason' => 'string', 'notes' => 'string'),
                                    array(trim($name), $time, NULL, 1, 0, 0, 0, $reason, $notes),
                                    array('id_ban_group')
                                );
                elseif (!$date)
                    $request = $smcFunc['db_insert']('insert', "
                                    {db_prefix}ban_groups",
                                    array('name' => 'string', 'ban_time' => 'int', 'expire_time' => 'int', 'cannot_access' => 'int', 'cannot_register' => 'int', 'cannot_post' => 'int', 'cannot_login' => 'int', 'reason' => 'string', 'notes' => 'string'),
                                    array(trim($name), $time, NULL, 0, $ban_register, $ban_post, $ban_login, $reason, $notes),
                                    array('id_ban_group')
                                );
                elseif (((int)$ban_full == 1) || ((int)$ban_post+(int)$ban_register+(int)$ban_login) == 0)
                    $request = $smcFunc['db_insert']('insert', "
                                    {db_prefix}ban_groups",
                                    array('name' => 'string', 'ban_time' => 'int', 'expire_time' => 'int', 'cannot_access' => 'int', 'cannot_register' => 'int', 'cannot_post' => 'int', 'cannot_login' => 'int', 'reason' => 'string', 'notes' => 'string'),
                                    array(trim($name), $time, $date, 1, 0, 0, 0, $reason, $notes),
                                    array('id_ban_group')
                                );
                else
                    $request = $smcFunc['db_insert']('insert', "
                                    {db_prefix}ban_groups",
                                    array('name' => 'string', 'ban_time' => 'int', 'expire_time' => 'int', 'cannot_access' => 'int', 'cannot_register' => 'int', 'cannot_post' => 'int', 'cannot_login' => 'int', 'reason' => 'string', 'notes' => 'string'),
                                    array(trim($name), $time, $date, 0, $ban_register, $ban_post, $ban_login, $reason, $notes),
                                    array('id_ban_group')
                                );

                $result = $smcFunc['db_query']('', "
                            SELECT id_ban_group, notes
                            FROM {db_prefix}ban_groups
                            WHERE notes = {string:notes}",
                            array('notes' => $notes)
                        );
--------------------------------------------------------------------------------------------------

There an updated version of this package perhaps we can try or anything you recommend?

Thanks
Title: Re: Registering help
Post by: Kindred on May 24, 2023, 09:02:02 AM
AT this point, the best suggestion that I have would be to perform the large upgrade to 2.1.3.
Doing this should remove all mods and put your system in a modern state (because 2.0.15 won't even support modern php versions and you are going to encounter more and more problems...   so rather than debug problems on an outdated system - do the upgrade and we can work further from that point. :)