version 1.3, 2001/04/03 21:12:39
|
version 1.4, 2001/04/03 22:03:55
|
Line 66 sub phaseone {
|
Line 66 sub phaseone {
|
'<th>Current</th><td>'.localtime($rmtime). |
'<th>Current</th><td>'.localtime($rmtime). |
'</td><td><a href="'.$urldir.$main.'.'.$suffix.'.meta" target=cat>'. |
'</td><td><a href="'.$urldir.$main.'.'.$suffix.'.meta" target=cat>'. |
'Metadata current version</a></td></tr></table><p>'. |
'Metadata current version</a></td></tr></table><p>'. |
|
'<font size=+1 color=red>Retrieval of an old version will '. |
|
'overwrite the file currently in construction space</font><p>'. |
'<input type=submit value="Retrieve version"></form>'); |
'<input type=submit value="Retrieve version"></form>'); |
} |
} |
|
|
|
sub phasetwo { |
|
my ($r,$fn,$uname,$udom)=@_; |
|
if ($ENV{'form.version'}) { |
|
my $version=$ENV{'form.version'}; |
|
if ($version eq 'new') { |
|
$r->print('<h3>Retrieving current (most recent) version</h3>'); |
|
} else { |
|
$r->print('<h3>Retrieving old version '.$version.'</h3>'); |
|
} |
|
my $logfile; |
|
my $ctarget='/home/'.$uname.'/public_html'.$fn; |
|
unless ($logfile=Apache::File->new('>>'.$ctarget.'.log')) { |
|
$r->print( |
|
'<font color=red>No write permission to user directory, FAIL</font>'); |
|
} |
|
print $logfile |
|
"\n\n================= Retrieve ".localtime()." ================\n". |
|
"Version $version\n\n"; |
|
|
|
} else { |
|
$r->print( |
|
'<font size=+1 color=red>Please pick a version to retrieve</font><p>'); |
|
&phaseone($r,$fn,$uname,$udom); |
|
} |
|
} |
|
|
sub handler { |
sub handler { |
|
|
my $r=shift; |
my $r=shift; |
Line 107 sub handler {
|
Line 135 sub handler {
|
$r->print('<h1>Retrieve previous versions of <tt>'.$fn.'</tt></h1>'); |
$r->print('<h1>Retrieve previous versions of <tt>'.$fn.'</tt></h1>'); |
|
|
if ($ENV{'form.phase'} eq 'two') { |
if ($ENV{'form.phase'} eq 'two') { |
|
&phasetwo($r,$fn,$uname,$udom); |
} else { |
} else { |
&phaseone($r,$fn,$uname,$udom); |
&phaseone($r,$fn,$uname,$udom); |
} |
} |