1window webauth
2{
3	{
4		pos			"264 262"
5		size		"360 240"
6		dragbutton	true
7		closebutton	true
8		background		"ui/popup_alpha_tile"
9		color		"1.0 0.75 0 1"
10		string		"_Login"
11		modal		true
12	}
13
14	string webusernamestr
15	{
16		string 		"_Name"
17		pos			"30 60"
18		size		"110 34"
19		contentalign	ALIGN_CL
20		color		"1.0 0.75 0 1"
21	}
22	textentry webusername
23	{
24		string		*cvar:web_username
25		background		"ui/button_green_verysmall"
26		color 		"0 .78 0 1"
27		selectcolor	"1 1 1 1"
28		contentalign	ALIGN_CL
29		padding		8
30		font		"f_verysmall"
31		pos			"150 60"
32		size		"180 34"
33	}
34
35	string webpasswordstr
36	{
37		string 		"_Password"
38		pos			"30 110"
39		size		"110 34"
40		contentalign	ALIGN_CL
41		color		"1.0 0.75 0 1"
42	}
43	textentry webpassword
44	{
45		string		*cvar:web_password
46		background		"ui/button_green_verysmall"
47		color 		"0 .78 0 1"
48		selectcolor	"1 1 1 1"
49		contentalign	ALIGN_CL
50		padding		8
51		font		"f_verysmall"
52		pos			"150 110"
53		size		"180 34"
54		ispassword	true
55		onChange 	{
56			// TODO: encrypt me
57		}
58	}
59
60	button login
61	{
62		pos			"50 180"
63		size		"256 30"
64		string		"_Login"
65		onClick		{ cmd "web_auth <cvar:web_username> <cvar:web_password>;" }
66		font	"f_menusmall"
67		color	"0 0.5 0 1"
68		selectcolor "1 1 1 1"
69		string	"_Login"
70		background	"ui/button_green_small"
71	}
72
73	func onWindowOpened
74	{
75		// it's encrypted, so it has no value any longer in this dialog
76		*cvar:web_password = ""
77	}
78
79	confunc web_authsuccessful {
80		cmd "echo \"Authentification successful\";ui_pop;"
81	}
82
83	confunc web_authfailed {
84		*cvar:web_password = ""
85		cmd "echo \"Authentification failed\";"
86	}
87}
88