mybb / merge-system

The MyBB Merge System allows for easy merging of an existing forum (be it MyBB or another forum software) into a MyBB 1.8.x forum.
Other
32 stars 33 forks source link

[SMF2] Possible Merge System Typo Error? #205

Open dresch86 opened 7 years ago

dresch86 commented 7 years ago

I have a question about this section of the forum permission merger for SMF:

                $tquery = $db->simple_select('forumpermissions', 'pid', "fid={$fid} AND gid={$mgid}");
                if($db->num_rows($tquery) == 0)
                {
                    // We hadn't any permissions for this forum so simply insert one and leave everything to default
                    $db->insert_query('forumpermissions', array('fid' => $fid, 'gid' => $mgid, 'canview' => 0));
                }
                else
                {
                    // We had permissions so simply update them
                    $db->update_query('forumpermissions', array('canview' => 0), "fid={$fid} AND gid={$mgid}");
                }

Shouldn't the bottom else block set canview to 1? I don't see anywhere where canview gets set to 1 and the value defaults to 0 so an update shouldn't be required unless you need to allow view access.

The main reason I ask is I'm working on developing a Java merge system designed to handle the conversion of large forums without timeouts, pauses, or slowing up the web service. I have not run the current PHP variant.