Files
webmin/switch_user.cgi
MUY 37a5504f51 Update switch_user.cgi
Only ask once the password in Mozilla Firefox 31.
2017-06-01 06:29:57 +02:00

17 lines
411 B
Perl
Executable File

#!/usr/local/bin/perl
# switch_user.cgi
# Force the webserver to re-authenticate
BEGIN { push(@INC, ".."); };
use WebminCore;
&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;
close(LOGOUT);
&redirect("/?miniserv_logout_id=$id");