Code Duplication    Length = 12-15 lines in 2 locations

plugin/courselegal/CourseLegalPlugin.php 1 location

@@ 155-166 (lines=12) @@
152
    public function updateMailAgreementLink($userId, $courseId, $sessionId)
153
    {
154
        $data = $this->getUserAcceptedLegal($userId, $courseId, $sessionId);
155
        if (!empty($data)) {
156
            $table = Database::get_main_table(
157
                'session_rel_course_rel_user_legal'
158
            );
159
            $uniqueId = api_get_unique_id();
160
            Database::update(
161
                $table,
162
                array('mail_agreement_link' => $uniqueId),
163
                array('id = ? ' => array($data['id']))
164
            );
165
            $this->sendMailLink($uniqueId, $userId, $courseId, $sessionId);
166
        }
167
    }
168
169
    /**

main/inc/lib/plugin.class.php 1 location

@@ 784-798 (lines=15) @@
781
                // The page must be refreshed to show the recently created tab
782
                echo "<script>location.href = '".Security::remove_XSS($_SERVER['REQUEST_URI'])."';</script>";
783
            }
784
        } else {
785
            $settingsCurrentTable = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
786
            $conditions = array(
787
                'where' => array(
788
                    "variable = 'show_tabs' AND title = ? AND comment = ? " => array(
789
                        $langString,
790
                        $pluginUrl
791
                    )
792
                )
793
            );
794
            $result = Database::select('subkey', $settingsCurrentTable, $conditions);
795
            if (!empty($result)) {
796
                $this->deleteTab($result[0]['subkey']);
797
            }
798
        }
799
    }
800
801
    /**