2007-04-12 20:24:50 +00:00
|
|
|
#!/usr/local/bin/perl
|
|
|
|
# switch_user.cgi
|
|
|
|
# Force the webserver to re-authenticate
|
|
|
|
|
2018-07-04 12:24:02 -07:00
|
|
|
BEGIN { push(@INC, "."); };
|
2009-03-01 07:50:03 +00:00
|
|
|
use WebminCore;
|
|
|
|
|
2007-04-12 20:24:50 +00:00
|
|
|
&init_config();
|
|
|
|
&get_miniserv_config(\%miniserv);
|
|
|
|
$id = $$.time();
|
|
|
|
open(LOGOUT, ">$miniserv{'logout'}$id");
|
|
|
|
printf LOGOUT "%d\n",
|
2017-06-01 06:29:57 +02:00
|
|
|
$ENV{'HTTP_USER_AGENT'} =~ /(MSIE\s+[6321]\.)|(Netscape\/[4321])|(Lynx)|(Mozilla\/5.0)/ ? 1 : 2;
|
2007-04-12 20:24:50 +00:00
|
|
|
close(LOGOUT);
|
|
|
|
&redirect("/?miniserv_logout_id=$id");
|
|
|
|
|