webmin/switch_user.cgi

17 lines
410 B
Plaintext
Raw Permalink Normal View History

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",
$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");