</script>';
$form_sent = 0;
$errorMsg = '';
$UserList = $SessionList = array();
$users = $sessions = array();
if (isset($_POST['form_sent']) && $_POST['form_sent']) {
    $form_sent = $_POST['form_sent'];
    $course_list = $_POST['course_list'];
    if (!is_array($course_list)) {
        $course_list = array();
    }
    if ($form_sent == 1) {
        if ($access_url_id == 0) {
            header('Location: access_url_edit_users_to_url.php?action=show_message&message=' . get_lang('SelectURL'));
        } elseif (is_array($course_list)) {
            UrlManager::update_urls_rel_usergroup($course_list, $access_url_id);
            header('Location: access_urls.php?action=show_message&message=' . get_lang('Updated'));
        }
        exit;
    }
}
Display::display_header($tool_name);
echo '<div class="actions">';
echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserGroupToURL'), ''), api_get_path(WEB_CODE_PATH) . 'admin/access_url_add_usergroup_to_url.php');
echo '</div>';
api_display_tool_title($tool_name);
if ($_GET['action'] == 'show_message') {
    Display::display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
}
$noUserGroupList = $userGroupList = array();
$ajax_search = $add_type == 'unique' ? true : false;