version 1.24, 2000/08/22 15:27:35
|
version 1.25, 2000/08/28 22:21:24
|
Line 4
|
Line 4
|
# Functions for use by content handlers: |
# Functions for use by content handlers: |
# |
# |
# plaintext(short) : plain text explanation of short term |
# plaintext(short) : plain text explanation of short term |
|
# fileembstyle(ext) : embed style in page for file extension |
|
# filedescription(ext) : descriptor text for file extension |
# allowed(short,url) : returns codes for allowed actions F,R,S,C |
# allowed(short,url) : returns codes for allowed actions F,R,S,C |
# definerole(rolename,sys,dom,cou) : define a custom role rolename |
# definerole(rolename,sys,dom,cou) : define a custom role rolename |
# set priviledges in format of lonTabs/roles.tab for |
# set priviledges in format of lonTabs/roles.tab for |
Line 38
|
Line 40
|
# 06/26 Ben Tyszka |
# 06/26 Ben Tyszka |
# 06/30,07/15,07/17,07/18,07/20,07/21,07/22,07/25 Gerd Kortemeyer |
# 06/30,07/15,07/17,07/18,07/20,07/21,07/22,07/25 Gerd Kortemeyer |
# 08/14 Ben Tyszka |
# 08/14 Ben Tyszka |
# 08/22 Gerd Kortemeyer |
# 08/22,08/28 Gerd Kortemeyer |
|
|
package Apache::lonnet; |
package Apache::lonnet; |
|
|
Line 47 use Apache::File;
|
Line 49 use Apache::File;
|
use LWP::UserAgent(); |
use LWP::UserAgent(); |
use HTTP::Headers; |
use HTTP::Headers; |
use vars |
use vars |
qw(%perlvar %hostname %homecache %spareid %hostdom %libserv %pr %prp $readit); |
qw(%perlvar %hostname %homecache %spareid %hostdom %libserv %pr %prp %fe %fd $readit); |
use IO::Socket; |
use IO::Socket; |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
|
|
Line 644 sub plaintext {
|
Line 646 sub plaintext {
|
return $prp{$short}; |
return $prp{$short}; |
} |
} |
|
|
|
# ------------------------------------------------------------------ Plain Text |
|
|
|
sub fileembstyle { |
|
my $ending=shift; |
|
return $fe{$ending}; |
|
} |
|
|
|
# ------------------------------------------------------------ Description Text |
|
|
|
sub filedecription { |
|
my $ending=shift; |
|
return $fd{$ending}; |
|
} |
|
|
# ----------------------------------------------------------------- Assign Role |
# ----------------------------------------------------------------- Assign Role |
|
|
sub assignrole { |
sub assignrole { |
Line 823 if ($readit ne 'done') {
|
Line 839 if ($readit ne 'done') {
|
} |
} |
} |
} |
|
|
|
# ------------------------------------------------------------- Read file types |
|
{ |
|
my $config=Apache::File->new("$perlvar{'lonTabDir'}/filetypes.tab"); |
|
|
|
while (my $configline=<$config>) { |
|
chomp($configline); |
|
my ($ending,$emb,@descr)=split(/\s+/,$configline); |
|
if ($descr[0] ne '') { |
|
$fe{$ending}=$emb; |
|
$fd{$ending}=join(' ',@descr); |
|
} |
|
} |
|
} |
|
|
|
|
$readit='done'; |
$readit='done'; |
&logthis('<font color=yellow>INFO: Read configuration</font>'); |
&logthis('<font color=yellow>INFO: Read configuration</font>'); |