Code Duplication    Length = 14-14 lines in 2 locations

main/admin/settings.lib.php 2 locations

@@ 24-37 (lines=14) @@
21
 */
22
function handleRegions()
23
{
24
    if (isset($_POST['submit_plugins'])) {
25
        storeRegions();
26
        // Add event to the system log.
27
        $user_id = api_get_user_id();
28
        $category = $_GET['category'];
29
        Event::addEvent(
30
            LOG_CONFIGURATION_SETTINGS_CHANGE,
31
            LOG_CONFIGURATION_SETTINGS_CATEGORY,
32
            $category,
33
            api_get_utc_datetime(),
34
            $user_id
35
        );
36
        Display :: display_confirmation_message(get_lang('SettingsStored'));
37
    }
38
39
    $plugin_obj = new AppPlugin();
40
    $possible_plugins  = $plugin_obj->read_plugins_from_path();
@@ 129-142 (lines=14) @@
126
{
127
    $plugin_obj = new AppPlugin();
128
    $token = Security::get_token();
129
    if (isset($_POST['submit_plugins'])) {
130
        storePlugins();
131
        // Add event to the system log.
132
        $user_id = api_get_user_id();
133
        $category = $_GET['category'];
134
        Event::addEvent(
135
            LOG_CONFIGURATION_SETTINGS_CHANGE,
136
            LOG_CONFIGURATION_SETTINGS_CATEGORY,
137
            $category,
138
            api_get_utc_datetime(),
139
            $user_id
140
        );
141
        Display :: display_confirmation_message(get_lang('SettingsStored'));
142
    }
143
144
    $all_plugins = $plugin_obj->read_plugins_from_path();
145
    $installed_plugins = $plugin_obj->get_installed_plugins();