Initial checkin of Webmin
[webmin.git] / switch_user.cgi
1 #!/usr/local/bin/perl
2 # switch_user.cgi
3 # Force the webserver to re-authenticate
4
5 require './web-lib.pl';
6 &init_config();
7 &get_miniserv_config(\%miniserv);
8 $id = $$.time();
9 open(LOGOUT, ">$miniserv{'logout'}$id");
10 printf LOGOUT "%d\n",
11         $ENV{'HTTP_USER_AGENT'} =~ /(MSIE\s+[6321]\.)|(Netscape\/[4321])|(Lynx)/ ? 1 : 2;
12 close(LOGOUT);
13 &redirect("/?miniserv_logout_id=$id");
14