version 1.12, 2007/04/13 16:21:15
|
version 1.16, 2007/05/27 21:21:26
|
Line 145 sub handler {
|
Line 145 sub handler {
|
</td> |
</td> |
</tr> |
</tr> |
</table>'); |
</table>'); |
&print_footer($r,$phase,'process','Store changes'); |
&print_footer($r,$phase,'process','Save changes'); |
} |
} |
return OK; |
return OK; |
} |
} |
Line 550 sub display_color_options {
|
Line 550 sub display_color_options {
|
$showfile = ''; |
$showfile = ''; |
} |
} |
} elsif ($imgfile =~ m-^/(adm/[^/]+)/([^/]+)$-) { |
} elsif ($imgfile =~ m-^/(adm/[^/]+)/([^/]+)$-) { |
|
$showfile = $imgfile; |
my $imgdir = $1; |
my $imgdir = $1; |
my $filename = $2; |
my $filename = $2; |
if (-e "/home/httpd/html/$imgdir/tn-".$filename) { |
if (-e "/home/httpd/html/$imgdir/tn-".$filename) { |
Line 559 sub display_color_options {
|
Line 560 sub display_color_options {
|
my $output = '/home/httpd/html/'.$imgdir.'/tn-'.$filename; |
my $output = '/home/httpd/html/'.$imgdir.'/tn-'.$filename; |
if (!-e $output) { |
if (!-e $output) { |
my ($width,$height) = &thumb_dimensions(); |
my ($width,$height) = &thumb_dimensions(); |
my $size = $width.'x'.$height; |
my ($fullwidth,$fullheight) = &check_dimensions($input); |
system("convert -sample $size $input $output"); |
if ($fullwidth ne '' && $fullheight ne '') { |
|
if ($fullwidth > $width && $fullheight > $height) { |
|
my $size = $width.'x'.$height; |
|
system("convert -sample $size $input $output"); |
|
$showfile = '/'.$imgdir.'/tn-'.$filename; |
|
} |
|
} |
} |
} |
$showfile = '/'.$imgdir.'/tn-'.$filename; |
|
} |
} |
} |
} |
if ($showfile) { |
if ($showfile) { |
$showfile = &Apache::loncommon::lonhttpdurl($showfile); |
$showfile = &Apache::loncommon::lonhttpdurl($showfile); |
$fullsize = &Apache::loncommon::lonhttpdurl($imgfile); |
$fullsize = &Apache::loncommon::lonhttpdurl($imgfile); |
Line 733 sub print_quotas {
|
Line 739 sub print_quotas {
|
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td>'.&mt($othertitle).'</td>'. |
'<td>'.&mt($othertitle).'</td>'. |
'<td class="LC_right_item"><span class="LC_nobreak">'. |
'<td class="LC_right_item"><span class="LC_nobreak">'. |
'<input type="text" name="default" value="'. |
'<input type="text" name="defaultquota" value="'. |
$defaultquota.'" size="5" /> Mb</span></td></tr>'; |
$defaultquota.'" size="5" /> Mb</span></td></tr>'; |
return $datatable; |
return $datatable; |
} |
} |
Line 764 sub print_autoenroll {
|
Line 770 sub print_autoenroll {
|
if (exists($settings->{'sender_domain'})) { |
if (exists($settings->{'sender_domain'})) { |
$defdom = $settings->{'sender_domain'}; |
$defdom = $settings->{'sender_domain'}; |
} |
} |
|
} else { |
|
if ($autorun) { |
|
$runon = ' checked="checked" '; |
|
$runoff = ' '; |
|
} else { |
|
$runoff = ' checked="checked" '; |
|
$runon = ' '; |
|
} |
} |
} |
my $domform = &Apache::loncommon::select_dom_form($defdom,'sender_domain',1); |
my $domform = &Apache::loncommon::select_dom_form($defdom,'sender_domain',1); |
my $datatable='<tr class="LC_odd_row">'. |
my $datatable='<tr class="LC_odd_row">'. |
Line 772 sub print_autoenroll {
|
Line 786 sub print_autoenroll {
|
'<input type="radio" name="autoenroll_run"'. |
'<input type="radio" name="autoenroll_run"'. |
$runon.' value="1" />'.&mt('Yes').'</label> '. |
$runon.' value="1" />'.&mt('Yes').'</label> '. |
'<label><input type="radio" name="autoenroll_run"'. |
'<label><input type="radio" name="autoenroll_run"'. |
$runoff.'value="0" />'.&mt('No').'</label></span></td>'. |
$runoff.' value="0" />'.&mt('No').'</label></span></td>'. |
'</tr><tr>'. |
'</tr><tr>'. |
'<td>'.&mt('Notification messages - sender'). |
'<td>'.&mt('Notification messages - sender'). |
'</td><td class="LC_right_item"><span class="LC_nobreak">'. |
'</td><td class="LC_right_item"><span class="LC_nobreak">'. |
Line 1229 sub thumb_dimensions {
|
Line 1243 sub thumb_dimensions {
|
return ('200','50'); |
return ('200','50'); |
} |
} |
|
|
|
sub check_dimensions { |
|
my ($inputfile) = @_; |
|
my ($fullwidth,$fullheight); |
|
if ($inputfile =~ m|^[/\w.\-]+$|) { |
|
if (open(PIPE,"identify $inputfile 2>&1 |")) { |
|
my $imageinfo = <PIPE>; |
|
if (!close(PIPE)) { |
|
&Apache::lonnet::logthis("Failed to close PIPE opened to retrieve image information for $inputfile"); |
|
} |
|
chomp($imageinfo); |
|
my ($fullsize) = |
|
($imageinfo =~ /^\Q$inputfile\E\s+\w+\s+(\d+x\d+)\s+/); |
|
if ($fullsize) { |
|
($fullwidth,$fullheight) = split(/x/,$fullsize); |
|
} |
|
} |
|
} |
|
return ($fullwidth,$fullheight); |
|
} |
|
|
sub check_configuser { |
sub check_configuser { |
my ($uhome,$dom,$confname,$servadm) = @_; |
my ($uhome,$dom,$confname,$servadm) = @_; |
my ($configuserok,%currroles); |
my ($configuserok,%currroles); |
Line 1361 $env{'user.name'}.':'.$env{'user.domain'
|
Line 1395 $env{'user.name'}.':'.$env{'user.domain'
|
if (($thumbwidth =~ /^\d+$/) && ($thumbheight =~ /^\d+$/)) { |
if (($thumbwidth =~ /^\d+$/) && ($thumbheight =~ /^\d+$/)) { |
my $inputfile = $filepath.'/'.$file; |
my $inputfile = $filepath.'/'.$file; |
my $outfile = $filepath.'/'.'tn-'.$file; |
my $outfile = $filepath.'/'.'tn-'.$file; |
my $thumbsize = $thumbwidth.'x'.$thumbheight; |
my ($fullwidth,$fullheight) = &check_dimensions($inputfile); |
system("convert -sample $thumbsize $inputfile $outfile"); |
if ($fullwidth ne '' && $fullheight ne '') { |
chmod(0660, $filepath.'/tn-'.$file); |
if ($fullwidth > $thumbwidth && $fullheight > $thumbheight) { |
if (-e $outfile) { |
my $thumbsize = $thumbwidth.'x'.$thumbheight; |
my $copyfile=$targetdir.'/tn-'.$file; |
system("convert -sample $thumbsize $inputfile $outfile"); |
if (copy($outfile,$copyfile)) { |
chmod(0660, $filepath.'/tn-'.$file); |
print $logfile "\nCopied source to ".$copyfile."\n"; |
if (-e $outfile) { |
&write_metadata($dom,$confname,$formname,$targetdir, |
my $copyfile=$targetdir.'/tn-'.$file; |
'tn-'.$file,$logfile); |
if (copy($outfile,$copyfile)) { |
} else { |
print $logfile "\nCopied source to ".$copyfile."\n"; |
print $logfile "\nUnable to write ".$copyfile.':'.$!."\n"; |
&write_metadata($dom,$confname,$formname, |
|
$targetdir,'tn-'.$file,$logfile); |
|
} else { |
|
print $logfile "\nUnable to write ".$copyfile. |
|
':'.$!."\n"; |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 1483 sub modify_quotas {
|
Line 1523 sub modify_quotas {
|
$formhash{$1} = $env{$key}; |
$formhash{$1} = $env{$key}; |
} |
} |
} |
} |
|
$formhash{'default'} = $env{'form.defaultquota'}; |
if (ref($domconfig{'quotas'}) eq 'HASH') { |
if (ref($domconfig{'quotas'}) eq 'HASH') { |
foreach my $key (keys(%{$domconfig{'quotas'}})) { |
foreach my $key (keys(%{$domconfig{'quotas'}})) { |
if (exists($formhash{$key})) { |
if (exists($formhash{$key})) { |