--- loncom/interface/lonuserutils.pm 2015/08/09 21:43:18 1.172 +++ loncom/interface/lonuserutils.pm 2017/11/16 17:05:49 1.184.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.172 2015/08/09 21:43:18 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.184.2.2 2017/11/16 17:05:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -30,12 +30,29 @@ package Apache::lonuserutils; +=pod + +=head1 NAME + +Apache::lonuserutils.pm + +=head1 SYNOPSIS + + Utilities for management of users and custom roles + + Provides subroutines called by loncreateuser.pm + +=head1 OVERVIEW + +=cut + use strict; use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon; use Apache::lonlocal; use Apache::longroup; +use HTML::Entities; use LONCAPA qw(:DEFAULT :match); ############################################################### @@ -1104,8 +1121,15 @@ sub print_upload_manager_form { if (!$env{'form.datatoken'}) { $datatoken=&Apache::loncommon::upfile_store($r); } else { - $datatoken=$env{'form.datatoken'}; - &Apache::loncommon::load_tmp_file($r); + $datatoken=&Apache::loncommon::valid_datatoken($env{'form.datatoken'}); + if ($datatoken ne '') { + &Apache::loncommon::load_tmp_file($r,$datatoken); + } + } + if ($datatoken eq '') { + $r->print('
'.&mt('Error').': '. + &mt('Invalid datatoken').'
'.&mt('Error').': '. + &mt('Invalid home server specified').'
\n". - &mt('Roles added for [quant,_1,user].',$counts{'role'}).' '.&mt('If a user is currently logged-in to LON-CAPA, any new roles which are active will be available when the user next logs in.')."
'.&mt('No roles added').'
'.&mt('There are no students with current/future access to the course.').'
'. + &mt('There are no students with current/future access to the course.'). + '