version 1.1, 2003/09/11 19:47:30
|
version 1.4, 2008/12/25 01:56:03
|
Line 1
|
Line 1
|
#!/usr/bin/perl |
#!/usr/bin/perl |
|
$|=1; |
# Take machine online |
# Take machine online |
# |
# |
# $Id$ |
# $Id$ |
Line 26
|
Line 27
|
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
|
|
print "Content-type: text/html\n\n". |
use strict; |
"<html><body bgcolor=#FFFFFF><h1>Take Online</h1>"; |
use lib '/home/httpd/lib/perl/'; |
system('mv /home/httpd/html/origindex.html /home/httpd/html/index.html'); |
use Apache::lonlocal; |
print "</body></html>"; |
use LONCAPA::loncgi; |
|
use LONCAPA::lonauthcgi; |
|
|
|
print "Content-type: text/html\n\n"; |
|
|
|
&main(); |
|
|
|
sub main { |
|
if (!&LONCAPA::lonauthcgi::check_ipbased_access('takeonline')) { |
|
if (!&LONCAPA::loncgi::check_cookie_and_load_env()) { |
|
&Apache::lonlocal::get_language_handle(); |
|
print &LONCAPA::loncgi::missing_cookie_msg(); |
|
return; |
|
} |
|
|
|
if (!&LONCAPA::lonauthcgi::can_view('takeonline')) { |
|
&Apache::lonlocal::get_language_handle(); |
|
print &LONCAPA::lonauthcgi::unauthorized_msg('takeonline'); |
|
return; |
|
} |
|
} |
|
|
|
&Apache::lonlocal::get_language_handle(); |
|
|
|
print '<html><body bgcolor="#FFFFFF"><h1>'.&Apache::lonlocal::mt('Take Online').'</h1>'; |
|
system('cp /home/httpd/html/origindex.html /home/httpd/html/index.html'); |
|
system('rm /home/httpd/html/lon-status/reroute.txt'); |
|
print '</body></html>'; |
|
} |