Code Duplication    Length = 12-15 lines in 2 locations

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

@@ 733-747 (lines=15) @@
730
                // The page must be refreshed to show the recently created tab
731
                echo "<script>location.href = '".Security::remove_XSS($_SERVER['REQUEST_URI'])."';</script>";
732
            }
733
        } else {
734
            $settingsCurrentTable = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
735
            $conditions = array(
736
                'where' => array(
737
                    "variable = 'show_tabs' AND title = ? AND comment = ? " => array(
738
                        $langString,
739
                        $pluginUrl
740
                    )
741
                )
742
            );
743
            $result = Database::select('subkey', $settingsCurrentTable, $conditions);
744
            if (!empty($result)) {
745
                $this->deleteTab($result[0]['subkey']);
746
            }
747
        }
748
    }
749
750
    /**

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
    /**