File: switch_user.cgi

package info (click to toggle)
webmin 1.180-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 16,900 kB
  • ctags: 2,152
  • sloc: perl: 55,792; java: 1,362; sh: 980; ansic: 221; makefile: 191
file content (14 lines) | stat: -rwxr-xr-x 374 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/local/bin/perl
# switch_user.cgi
# Force the webserver to re-authenticate

require './web-lib.pl';
&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)/ ? 1 : 2;
close(LOGOUT);
&redirect("/?miniserv_logout_id=$id");