version 1.1175, 2014/02/16 22:04:14
|
version 1.1179, 2014/02/27 12:41:24
|
Line 5151 sub bodytag {
|
Line 5151 sub bodytag {
|
@design{keys(%$addentries)} = @$addentries{keys(%$addentries)}; |
@design{keys(%$addentries)} = @$addentries{keys(%$addentries)}; |
|
|
# role and realm |
# role and realm |
my ($role,$realm) = split(/\./,$env{'request.role'},2); |
my ($role,$realm) = split(m{\./},$env{'request.role'},2); |
|
if ($realm) { |
|
$realm = '/'.$realm; |
|
} |
if ($role eq 'ca') { |
if ($role eq 'ca') { |
my ($rdom,$rname) = ($realm =~ m{^/($match_domain)/($match_username)$}); |
my ($rdom,$rname) = ($realm =~ m{^/($match_domain)/($match_username)$}); |
$realm = &plainname($rname,$rdom); |
$realm = &plainname($rname,$rdom); |
Line 8967 sub excess_filesize_warning {
|
Line 8970 sub excess_filesize_warning {
|
} |
} |
$disk_quota = int($disk_quota * 1000); |
$disk_quota = int($disk_quota * 1000); |
if (($current_disk_usage + $filesize) > $disk_quota) { |
if (($current_disk_usage + $filesize) > $disk_quota) { |
return '<p><span class="LC_warning">'. |
return '<p class="LC_warning">'. |
&mt("Unable to $action [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.", |
&mt("Unable to $action [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.", |
'<span class="LC_filename">'.$filename.'</span>',$filesize).'</span>'. |
'<span class="LC_filename">'.$filename.'</span>',$filesize).'</p>'. |
'<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.', |
'<p>'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.', |
$disk_quota,$current_disk_usage). |
$disk_quota,$current_disk_usage). |
'</p>'; |
'</p>'; |
} |
} |
Line 10917 sub check_for_upload {
|
Line 10920 sub check_for_upload {
|
if ($currsize < $filesize) { |
if ($currsize < $filesize) { |
my $extra = $filesize - $currsize; |
my $extra = $filesize - $currsize; |
if (($current_disk_usage + $extra) > $disk_quota) { |
if (($current_disk_usage + $extra) > $disk_quota) { |
my $msg = '<span class="LC_error">'. |
my $msg = '<p class="LC_warning">'. |
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded if existing (smaller) file with same name (size = [_3] kilobytes) is replaced.', |
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded if existing (smaller) file with same name (size = [_3] kilobytes) is replaced.', |
'<span class="LC_filename">'.$fname.'</span>',$filesize,$currsize).'</span>'. |
'<span class="LC_filename">'.$fname.'</span>',$filesize,$currsize).'</p>'. |
'<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.', |
'<p>'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.', |
$disk_quota,$current_disk_usage); |
$disk_quota,$current_disk_usage).'</p>'; |
return ('will_exceed_quota',$msg); |
return ('will_exceed_quota',$msg); |
} |
} |
} |
} |
Line 10930 sub check_for_upload {
|
Line 10933 sub check_for_upload {
|
} |
} |
} |
} |
if (($current_disk_usage + $filesize) > $disk_quota){ |
if (($current_disk_usage + $filesize) > $disk_quota){ |
my $msg = '<span class="LC_error">'. |
my $msg = '<p class="LC_warning">'. |
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.','<span class="LC_filename">'.$fname.'</span>',$filesize).'</span>'. |
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.','<span class="LC_filename">'.$fname.'</span>',$filesize).'</p>'. |
'<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage); |
'<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage); |
return ('will_exceed_quota',$msg); |
return ('will_exceed_quota',$msg); |
} elsif ($found_file) { |
} elsif ($found_file) { |
if ($locked_file) { |
if ($locked_file) { |
my $msg = '<span class="LC_error">'; |
my $msg = '<p class="LC_warning">'; |
$msg .= &mt('Unable to upload [_1]. A locked file by that name was found in [_2].','<span class="LC_filename">'.$fname.'</span>','<span class="LC_filename">'.$port_path.$env{'form.currentpath'}.'</span>'); |
$msg .= &mt('Unable to upload [_1]. A locked file by that name was found in [_2].','<span class="LC_filename">'.$fname.'</span>','<span class="LC_filename">'.$port_path.$env{'form.currentpath'}.'</span>'); |
$msg .= '</span><br />'; |
$msg .= '</p>'; |
$msg .= &mt('You will be able to rename or delete existing [_1] after a grade has been assigned.','<span class="LC_filename">'.$fname.'</span>'); |
$msg .= &mt('You will be able to rename or delete existing [_1] after a grade has been assigned.','<span class="LC_filename">'.$fname.'</span>'); |
return ('file_locked',$msg); |
return ('file_locked',$msg); |
} else { |
} else { |
my $msg = '<span class="LC_error">'; |
my $msg = '<p class="LC_error">'; |
$msg .= &mt(' A file by that name: [_1] was found in [_2].','<span class="LC_filename">'.$fname.'</span>',$port_path.$env{'form.currentpath'}); |
$msg .= &mt(' A file by that name: [_1] was found in [_2].','<span class="LC_filename">'.$fname.'</span>',$port_path.$env{'form.currentpath'}); |
$msg .= '</span>'; |
$msg .= '</p>'; |
return ('existingfile',$msg); |
return ('existingfile',$msg); |
} |
} |
} |
} |
Line 14902 sub captcha_display {
|
Line 14905 sub captcha_display {
|
$error = 'recaptcha'; |
$error = 'recaptcha'; |
} |
} |
} |
} |
return ($output,$error); |
return ($output,$error,$captcha); |
} |
} |
|
|
sub captcha_response { |
sub captcha_response { |
Line 14978 sub create_captcha {
|
Line 14981 sub create_captcha {
|
if (-e $Apache::lonnet::perlvar{'lonCaptchaDir'}.'/'.$md5sum.'.png') { |
if (-e $Apache::lonnet::perlvar{'lonCaptchaDir'}.'/'.$md5sum.'.png') { |
$output = '<input type="hidden" name="crypt" value="'.$md5sum.'" />'."\n". |
$output = '<input type="hidden" name="crypt" value="'.$md5sum.'" />'."\n". |
&mt('Type in the letters/numbers shown below').' '. |
&mt('Type in the letters/numbers shown below').' '. |
'<input type="text" size="5" name="code" value="" /><br />'. |
'<input type="text" size="5" name="code" value="" autocomplete="off" />'. |
'<img src="'.$captcha_params{'www_output_dir'}.'/'.$md5sum.'.png" alt="captcha" />'; |
'<br />'. |
|
'<img src="'.$captcha_params{'www_output_dir'}.'/'.$md5sum.'.png" alt="captcha" />'; |
last; |
last; |
} |
} |
} |
} |
Line 15050 sub check_recaptcha {
|
Line 15054 sub check_recaptcha {
|
} |
} |
|
|
sub emailusername_info { |
sub emailusername_info { |
my @fields = ('lastname','firstname','institution','web','location','officialemail'); |
my @fields = ('firstname','lastname','institution','web','location','officialemail'); |
my %titles = &Apache::lonlocal::texthash ( |
my %titles = &Apache::lonlocal::texthash ( |
lastname => 'Last Name', |
lastname => 'Last Name', |
firstname => 'First Name', |
firstname => 'First Name', |