Code Duplication    Length = 3-3 lines in 18 locations

main/admin/add_sessions_to_usergroup.php 1 location

@@ 33-35 (lines=3) @@
30
$tool_name=get_lang('SubscribeClassToSessions');
31
32
$add_type = 'multiple';
33
if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
34
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
35
}
36
37
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
38
$htmlHeadXtra[] = '<script>

main/admin/dashboard_add_courses_to_user.php 1 location

@@ 47-49 (lines=3) @@
44
}
45
46
$add_type = 'multiple';
47
if(isset($_GET['add_type']) && $_GET['add_type']!='') {
48
	$add_type = Security::remove_XSS($_REQUEST['add_type']);
49
}
50
51
if (!api_is_platform_admin()) {
52
	api_not_allowed(true);

main/admin/dashboard_add_sessions_to_user.php 1 location

@@ 49-51 (lines=3) @@
46
}
47
48
$add_type = 'multiple';
49
if (isset($_GET['add_type']) && $_GET['add_type']!='') {
50
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
51
}
52
53
if (!api_is_platform_admin() && !api_is_session_admin()) {
54
    api_not_allowed(true);

main/session/add_courses_to_session.php 1 location

@@ 40-42 (lines=3) @@
37
$tool_name= get_lang('SubscribeCoursesToSession');
38
39
$add_type = 'multiple';
40
if (isset($_GET['add_type']) && $_GET['add_type']!=''){
41
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
42
}
43
44
$page = isset($_GET['page']) ? Security::remove_XSS($_GET['page']) : null;
45

main/session/add_many_session_to_category.php 1 location

@@ 37-39 (lines=3) @@
34
SessionManager::protectSession($id_session);
35
36
$add_type = 'multiple';
37
if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
38
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
39
}
40
41
if (!api_is_platform_admin() && !api_is_session_admin()) {
42
    $sql = 'SELECT session_admin_id FROM ' . Database:: get_main_table(TABLE_MAIN_SESSION) . ' WHERE id=' . $id_session;

main/session/add_students_to_session.php 1 location

@@ 22-24 (lines=3) @@
19
// Setting the name of the tool
20
$tool_name = get_lang('SubscribeStudentsToSession');
21
$add_type = 'multiple';
22
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
23
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
24
}
25
$form_sent  = 0;
26
$errorMsg   = '';
27
$users = $sessions = array();

main/admin/access_url_edit_courses_to_url.php 2 locations

@@ 39-41 (lines=3) @@
36
$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
37
38
$add_type = 'multiple';
39
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
40
	$add_type = Security::remove_XSS($_REQUEST['add_type']);
41
}
42
43
$access_url_id = 1;
44
if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') {
@@ 44-46 (lines=3) @@
41
}
42
43
$access_url_id = 1;
44
if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') {
45
	$access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
46
}
47
48
$xajax -> processRequests();
49
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');

main/admin/access_url_edit_usergroup_to_url.php 2 locations

@@ 33-35 (lines=3) @@
30
$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
31
32
$add_type = 'multiple';
33
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
34
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
35
}
36
37
$access_url_id = 1;
38
if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {
@@ 38-40 (lines=3) @@
35
}
36
37
$access_url_id = 1;
38
if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {
39
    $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
40
}
41
42
$xajax->processRequests();
43
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');

main/admin/access_url_edit_users_to_url.php 2 locations

@@ 41-43 (lines=3) @@
38
$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
39
40
$add_type = 'multiple';
41
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
42
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
43
}
44
45
$access_url_id = 1;
46
if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {
@@ 46-48 (lines=3) @@
43
}
44
45
$access_url_id = 1;
46
if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {
47
    $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
48
}
49
50
$xajax->processRequests();
51
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');

main/admin/add_courses_to_usergroup.php 1 location

@@ 32-34 (lines=3) @@
29
$tool_name = get_lang('SubscribeClassToCourses');
30
31
$add_type = 'multiple';
32
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
33
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
34
}
35
36
$add = isset($_GET['add']) ? Security::remove_XSS($_GET['add']) : null;
37

main/admin/add_sessions_to_promotion.php 1 location

@@ 30-32 (lines=3) @@
27
// Setting the name of the tool
28
$tool_name = get_lang('SubscribeSessionsToPromotions');
29
$add_type = 'multiple';
30
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
31
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
32
}
33
34
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
35
$htmlHeadXtra[] = '<script>

main/admin/dashboard_add_users_to_user.php 1 location

@@ 55-57 (lines=3) @@
52
}
53
54
$add_type = 'multiple';
55
if (isset($_GET['add_type']) && $_GET['add_type']!='') {
56
	$add_type = Security::remove_XSS($_REQUEST['add_type']);
57
}
58
59
if (!api_is_platform_admin()) {
60
    api_not_allowed(true);

main/session/add_users_to_session.php 1 location

@@ 37-39 (lines=3) @@
34
$tool_name = get_lang('SubscribeUsersToSession');
35
$add_type = 'unique';
36
37
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
38
	$add_type = Security::remove_XSS($_REQUEST['add_type']);
39
}
40
41
$page = isset($_GET['page']) ? Security::remove_XSS($_GET['page']) : null;
42

main/user/add_users_to_session.php 1 location

@@ 42-44 (lines=3) @@
39
    $tool_name = get_lang('SubscribeUsersToSession');
40
    $add_type = 'unique';
41
42
    if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
43
        $add_type = Security::remove_XSS($_REQUEST['add_type']);
44
    }
45
46
    $page = isset($_GET['page']) ? Security::remove_XSS($_GET['page']) : null;
47

main/admin/access_url_edit_course_category_to_url.php 1 location

@@ 33-35 (lines=3) @@
30
$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
31
32
$add_type = 'multiple';
33
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
34
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
35
}
36
37
$access_url_id = 1;
38
if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {