|
|
|
@ -21,10 +21,6 @@ if (!api_get_multiple_access_url()) { |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
Global constants and variables |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
$form_sent = 0; |
|
|
|
|
$first_letter_user = ''; |
|
|
|
|
$first_letter_course = ''; |
|
|
|
@ -41,12 +37,12 @@ $tool_name = get_lang('AddUsersToURL'); |
|
|
|
|
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
|
|
|
$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); |
|
|
|
|
|
|
|
|
|
/* MAIN CODE */ |
|
|
|
|
|
|
|
|
|
Display :: display_header($tool_name); |
|
|
|
|
|
|
|
|
|
echo '<div class="actions">'; |
|
|
|
|
echo Display::url(Display::return_icon('edit.gif',get_lang('EditUsersToURL'),''), api_get_path(WEB_CODE_PATH).'admin/access_url_edit_users_to_url.php">'); |
|
|
|
|
echo Display::url( |
|
|
|
|
Display::return_icon('edit.png', get_lang('EditUsersToURL'),''), |
|
|
|
|
api_get_path(WEB_CODE_PATH).'admin/access_url_edit_users_to_url.php'); |
|
|
|
|
echo '</div>'; |
|
|
|
|
|
|
|
|
|
api_display_tool_title($tool_name); |
|
|
|
@ -61,29 +57,22 @@ if ($_POST['form_sent']) { |
|
|
|
|
$users[$key] = intval($value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($form_sent == 1) |
|
|
|
|
{ |
|
|
|
|
if ($form_sent == 1) { |
|
|
|
|
if ( count($users) == 0 || count($url_list) == 0) { |
|
|
|
|
Display :: display_error_message(get_lang('AtLeastOneUserAndOneURL')); |
|
|
|
|
//header('Location: access_urls.php?action=show_message&message='.get_lang('AtLeastOneUserAndOneURL')); |
|
|
|
|
} else { |
|
|
|
|
UrlManager::add_users_to_urls($users,$url_list); |
|
|
|
|
Display :: display_confirmation_message(get_lang('UsersBelongURL')); |
|
|
|
|
//header('Location: access_urls.php?action=show_message&message='.get_lang('UsersBelongURL')); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Display GUI */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($first_letter_user)) { |
|
|
|
|
$sql = "SELECT count(*) as nb_users FROM $tbl_user"; |
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
$num_row = Database::fetch_array($result); |
|
|
|
|
if($num_row['nb_users']>1000) { |
|
|
|
|
if ($num_row['nb_users']>1000) { |
|
|
|
|
//if there are too much users to gracefully handle with the HTML select list, |
|
|
|
|
// assign a default filter on users names |
|
|
|
|
$first_letter_user = 'A'; |
|
|
|
@ -161,5 +150,5 @@ unset($result); |
|
|
|
|
</table> |
|
|
|
|
</form> |
|
|
|
|
<?php |
|
|
|
|
/* FOOTER */ |
|
|
|
|
|
|
|
|
|
Display :: display_footer(); |