1<? I18N znc-webadmin ?>
2<? AddRow JSLoop HREF=/modfiles/global/webadmin/webadmin.js ?>
3<? AddRow CSSLoop HREF=/modfiles/global/webadmin/webadmin.css ?>
4<? INC Header.tmpl ?>
5
6<form action="<? VAR URIPrefix TOP ?><? VAR ModPath TOP ?><? IF Edit ?>edituser<? ELSE ?>adduser<? ENDIF ?>" method="post">
7	<? INC _csrf_check.tmpl ?>
8	<div class="section">
9		<input type="hidden" name="submitted" value="1" />
10
11		<!-- Trick Firefox into NOT autofilling password to "change password" field. It will autofill username and password to these useless fields instead. See issue #1163 -->
12		<input name="userdummy" type="text" style="display: none"/>
13		<input name="passworddummy" type="password" style="display: none"/>
14
15		<h3><? FORMAT "Authentication" ?></h3>
16		<div class="sectionbg">
17			<div class="sectionbody">
18				<div class="subsection">
19					<div class="inputlabel"><label for="user"><? FORMAT "Username:" ?></label></div>
20
21						<? IF Clone ?>
22						<input type="hidden" name="clone" value="<? VAR CloneUsername ?>" />
23						<? ENDIF ?>
24						<? IF Edit ?>
25						<input type="hidden" name="user" value="<? VAR Username ?>" />
26						<input id="user" type="text" name="newuser" value="<? VAR Username ?>" class="half" maxlength="128" disabled="disabled" />
27						<? ELSE ?>
28						<input id="user" type="text" name="user" value="<? VAR Username ?>" class="half" maxlength="128"
29							   title="<? FORMAT "Please enter a username." ?>"/>
30						<? ENDIF ?>
31
32				</div>
33				<div class="subsection">
34					<div class="inputlabel"><label for="password"><? FORMAT "Password:" ?></label></div>
35					<input id="password" type="password" name="password" class="half"
36						   title="<? FORMAT "Please enter a password." ?>" autocomplete="off" />
37				</div>
38				<div class="subsection">
39					<div class="inputlabel"><label for="password2"><? FORMAT "Confirm password:" ?></label></div>
40					<input id="password2" type="password" name="password2" class="half"
41						   title="<? FORMAT "Please re-type the above password." ?>"/>
42				</div>
43				<div class="subsection">
44					<div class="inputlabel"><label for="authonlyviamodule"><? FORMAT "Auth Only Via Module:" ?></label></div>
45					<input id="authonlyviamodule" type="checkbox" name="authonlyviamodule"
46						    title="<? FORMAT "Allow user authentication by external modules only, disabling built-in password authentication." ?>"
47						    <? IF AuthOnlyViaModule ?>checked="checked" <? ENDIF ?><? IF !ImAdmin ?>disabled="disabled" <? ENDIF ?>/>
48				</div>
49				<div class="subsection half">
50					<div class="inputlabel"><label for="allowedips"><? FORMAT "Allowed IPs:" ?></label></div>
51					<textarea id="allowedips" name="allowedips" cols="70" rows="5"><? LOOP AllowedHostLoop ?><? VAR Host ?>
52<? ENDLOOP ?>
53</textarea>
54					<br /><span class="info"><? FORMAT "Leave empty to allow connections from all IPs.<br/>Otherwise, one entry per line, wildcards * and ? are available." ?></span>
55				</div>
56				<div style="clear: both;"></div>
57			</div>
58		</div>
59	</div>
60
61	<div class="section">
62		<h3><? FORMAT "IRC Information" ?></h3>
63		<? IF !Edit ?>
64		<span class="info"><? FORMAT "Nick, AltNick, Ident, RealName and QuitMsg can be left empty to use default values." ?></span>
65		<? ENDIF ?>
66		<div class="sectionbg">
67			<div class="sectionbody">
68				<div class="subsection">
69					<div class="inputlabel"><label for="nick"><? FORMAT "Nickname:" ?></label></div>
70					<input id="nick" type="text" name="nick" value="<? VAR Nick ?>" class="half" maxlength="128"
71						   title="<? FORMAT "Your nickname on IRC." ?>"/>
72				</div>
73				<div class="subsection">
74					<div class="inputlabel"><label for="altnick"><? FORMAT "Alt. Nickname:" ?></label></div>
75					<input id="altnick" type="text" name="altnick" value="<? VAR AltNick ?>" class="half" maxlength="128"
76						   title="<? FORMAT "Your secondary nickname, if the first is not available on IRC." ?>"/>
77				</div>
78				<div style="clear: both;"></div>
79				<div class="subsection">
80					<div class="inputlabel"><label for="ident"><? FORMAT "Ident:" ?></label></div>
81					<input id="ident" type="text" name="ident" value="<? VAR Ident ?>" class="half" maxlength="128"
82						   title="<? FORMAT "The Ident is sent to server as username." ?>"/>
83				</div>
84				<div class="subsection">
85					<div class="inputlabel"><label for="statusprefix"><? FORMAT "Status Prefix:" ?></label></div>
86					<input id="statusprefix" type="text" name="statusprefix" value="<? VAR StatusPrefix ?>" class="half" maxlength="5"
87						   title="<? FORMAT "The prefix for the status and module queries." ?>"/>
88				</div>
89				<div style="clear: both;"></div>
90				<div class="subsection">
91					<div class="inputlabel"><label for="realname"><? FORMAT "Realname:" ?></label></div>
92					<input id="realname" type="text" name="realname" value="<? VAR RealName ?>" class="full" maxlength="256"
93						   title="<? FORMAT "Your real name." ?>"/>
94				</div>
95				<div style="clear: both;"></div>
96
97				<? IF BindHostEdit ?>
98				<div class="subsection">
99					<div class="inputlabel"><label for="bindhost"><? FORMAT "BindHost:" ?></label></div>
100					<input id="bindhost" type="text" name="bindhost" value="<? VAR BindHost ?>"/>
101				</div>
102				<div style="clear: both;"></div>
103
104				<div class="subsection">
105					<div class="inputlabel"><label for="dccbindhost"><? FORMAT "DCCBindHost:" ?></label></div>
106					<input id="dccbindhost" type="text" name="dccbindhost" value="<? VAR DCCBindHost ?>"/>
107				</div>
108				<div style="clear: both;"></div>
109				<? ENDIF ?>
110
111				<div class="subsection">
112					<div class="inputlabel"><label for="quitmsg"><? FORMAT "Quit Message:" ?></label></div>
113					<input type="text" name="quitmsg" value="<? VAR QuitMsg ?>" class="full" maxlength="256"
114						   title="<? FORMAT "You may define a Message shown, when you quit IRC." ?>"/>
115				</div>
116				<div style="clear: both;"></div>
117			</div>
118		</div>
119	</div>
120
121	<div class="section">
122		<h3><? FORMAT "Networks" ?></h3>
123		<? IF Edit ?>
124		<div class="sectionbg">
125			<div class="sectionbody">
126				<table class="sortable">
127					<thead>
128					<tr>
129						<td class="ignore-sort">[<a href="<? VAR URIPrefix TOP ?><? VAR ModPath TOP ?>addnetwork?user=<? VAR Username ESC=URL ?>"><? FORMAT "Add" ?></a>]</td>
130				<? IF NetworkLoop ?>
131						<th><? FORMAT "Name" ?></th>
132						<th><? FORMAT "Clients" ?></th>
133						<th><? FORMAT "Current Server" ?></th>
134						<th><? FORMAT "Nick" ?></th>
135					<? ELSE ?>
136						<td><? FORMAT "← Add a network (opens in same page)" ?></td>
137				<? ENDIF ?>
138					</tr>
139					</thead>
140
141					<tbody>
142			<? LOOP NetworkLoop SORTASC=Name ?>
143					<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
144						<td>
145							<input type="hidden" name="network" value="<? VAR Name ?>" />
146							[<a href="<? VAR URIPrefix TOP ?><? VAR ModPath TOP ?>editnetwork?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Name ESC=URL ?>"><? FORMAT "Edit" ?></a>] [<a href="<? VAR URIPrefix TOP ?><? VAR ModPath TOP ?>delnetwork?user=<? VAR Username ESC=URL ?>&amp;name=<? VAR Name ESC=URL ?>"><? FORMAT "Del" ?></a>]
147						</td>
148						<td><? VAR Name ?></td>
149						<td><? VAR Clients ?></td>
150						<td><? VAR Server DEFAULT="-N/A-" ?></td>
151						<td><? VAR IRCNick ?></td>
152					</tr>
153			<? ENDLOOP ?>
154					</tbody>
155				</table>
156			</div>
157		</div>
158		<? ELSE ?>
159			<? IF Clone ?>
160				<span class="info"><? FORMAT "You will be able to add + modify networks here after you have cloned the user." ?></span><br />
161			<? ELSE ?>
162				<span class="info"><? FORMAT "You will be able to add + modify networks here after you have created the user." ?></span><br />
163			<? ENDIF ?>
164		<? ENDIF ?>
165	</div>
166
167	<div class="section">
168		<h3><? FORMAT "Modules" ?></h3>
169		<div class="sectionbg">
170			<div class="sectionbody">
171				<table>
172					<thead>
173					<tr>
174						<th><? FORMAT "Name" ?></th>
175						<th><? FORMAT "Arguments" ?></th>
176						<th><? FORMAT "Description" ?></th>
177						<th><? FORMAT "Loaded globally" ?></th>
178						<th><? FORMAT "Loaded by networks" ?></th>
179					</tr>
180					</thead>
181					<tbody>
182
183				<? LOOP ModuleLoop ?>
184					<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
185						<td class="mod_name">
186							<input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? IF Wiki ?><a href="https://wiki.znc.in/<? VAR Wiki ?>" target="_blank" class="external"><? VAR Name ?></a> <? ELSE ?> <? VAR Name ?> <? ENDIF ?></label>
187						</td>
188						<td class="mod_args">
189							<? IF Disabled ?>
190							<? VAR Args ?>
191							<? ELSE ?>
192							<input class="third" type="text" name="modargs_<? VAR Name ?>" value="<? VAR Args ?>"
193							<? IF !HasArgs ?> disabled="disabled"<? ENDIF ?>
194							<? IF ArgsHelpText ?> title="<? VAR ArgsHelpText ?>"<? ENDIF ?> />
195							<? ENDIF ?>
196						</td>
197						<td class="mod_descr"><? VAR Description ?></td>
198						<td align="center">
199							<? IF CanBeLoadedGlobally ?>
200								<input type="checkbox" name="loaded_globally" id="loaded_globally_<? VAR Name ?>"
201								<? IF LoadedGlobally ?>
202									checked="checked"
203								<? ENDIF ?>
204								disabled="disabled"/>
205							<? ENDIF ?>
206						</td>
207						<td align="center">
208							<? IF CanBeLoadedByNetwork ?>
209								<input type="checkbox" name="loaded_by_network" id="loaded_by_net_<? VAR Name ?>"
210								<? IF LoadedBySomeNetworks && LoadedByAllNetworks ?>
211									checked="checked"
212								<? ENDIF ?>
213								disabled="disabled"/>
214								<? IF LoadedBySomeNetworks && !LoadedByAllNetworks ?>
215									<script type="text/javascript">
216										document.getElementById("loaded_by_net_<? VAR Name ?>").indeterminate = true;
217									</script>
218								<? ENDIF ?>
219							<? ENDIF ?>
220						</td>
221					</tr>
222				<? ENDLOOP ?>
223
224					</tbody>
225				</table>
226			</div>
227		</div>
228	</div>
229
230	<div class="section">
231		<h3><? FORMAT "Channels" ?></h3>
232		<div class="sectionbg">
233			<div class="sectionbody">
234				<div class="subsection third">
235					<div class="inputlabel"><label for="chanmodes"><? FORMAT "Default Modes:" ?></label></div>
236					<input id="chanmodes" type="text" name="chanmodes" value="<? VAR DefaultChanModes ?>" maxlength="32"
237						   title="<? FORMAT "These are the default modes ZNC will set when you join an empty channel." ?>"/>
238					<br /><span class="info"><? FORMAT "Empty = use standard value" ?></span>
239				</div>
240				<div class="subsection third">
241					<div class="inputlabel"><label for="chanbufsize"><? FORMAT "Buffer Size:" ?></label></div>
242					<input id="chanbufsize" type="number" name="chanbufsize" value="<? VAR ChanBufferSize ?>" min="0"
243						   title="<? FORMAT "This is the amount of lines that the playback buffer will store for channels before dropping off the oldest line. The buffers are stored in the memory by default." ?>"/>
244					<br /><span class="info"><? FORMAT "Empty = use standard value" ?></span>
245				</div>
246			</div>
247		</div>
248	</div>
249
250	<div class="section">
251		<h3><? FORMAT "Queries" ?></h3>
252		<div class="sectionbg">
253			<div class="sectionbody">
254				<div class="subsection third">
255					<div class="inputlabel"><label for="maxquerybuffers"><? FORMAT "Max Buffers:" ?></label></div>
256					<input id="maxquerybuffers" type="number" name="maxquerybuffers" value="<? VAR MaxQueryBuffers ?>" class="third" min="0"
257						   title="<? FORMAT "Maximum number of query buffers. 0 is unlimited." ?>"/>
258				</div>
259				<div class="subsection third">
260					<div class="inputlabel"><label for="querybufsize"><? FORMAT "Buffer Size:" ?></label></div>
261					<input id="querybufsize" type="number" name="querybufsize" value="<? VAR QueryBufferSize ?>" min="0"
262						   title="<? FORMAT "This is the amount of lines that the playback buffer will store for queries before dropping off the oldest line. The buffers are stored in the memory by default." ?>"/>
263					<br /><span class="info"><? FORMAT "Empty = use standard value" ?></span>
264				</div>
265			</div>
266		</div>
267	</div>
268
269	<div class="section">
270		<h3><? FORMAT "Flags" ?></h3>
271		<div class="sectionbg">
272			<div class="sectionbody lotsofcheckboxes">
273				<? LOOP OptionLoop ?>
274				<span class="checkboxandlabel" title="<? VAR Tooltip ?>">
275					<input type="checkbox" name="<? VAR Name ?>" id="opt_<? VAR Name ?>" value="1"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> />
276					<label for="opt_<? VAR Name ?>"><? VAR DisplayName ?></label>
277				</span>
278				<? ENDLOOP ?>
279				<div style="clear:both;"></div>
280			</div>
281		</div>
282	</div>
283
284	<div class="section">
285		<h3><? FORMAT "ZNC Behavior" ?></h3>
286		<span class="info"><? FORMAT "Any of the following text boxes can be left empty to use their default value." ?></span>
287		<div class="sectionbg">
288			<div class="sectionbody">
289				<div class="subsection">
290					<div class="inputlabel"><label for="timestampformat"><? FORMAT "Timestamp Format:" ?></label></div>
291					<input id="timestampformat" type="text" name="timestampformat" value="<? VAR TimestampFormat ?>" class="full"
292						   title="<? FORMAT "The format for the timestamps used in buffers, for example [%H:%M:%S]. This setting is ignored in new IRC clients, which use server-time. If your client supports server-time, change timestamp format in client settings instead." ?>"/>
293				</div>
294				<div class="subsection half">
295					<div class="inputlabel"><label for="timezone"><? FORMAT "Timezone:" ?></label></div>
296					<input id="timezone" type="text" name="timezone" value="<? VAR Timezone ?>" list="timezone_list"
297						   title="Select your timezone." />
298					<br /><span class="info"><? FORMAT "E.g. <code>Europe/Berlin</code>, or <code>GMT-6</code>" ?></span>
299					<datalist id="timezone_list">
300						<? LOOP TZLoop ?>
301						<option value="<? VAR TZ ?>"/>
302						<? ENDLOOP ?>
303					</datalist>
304				</div>
305				<div style="clear:both;"></div>
306				<div class="subsection" title="<? FORMAT "Character encoding used between IRC client and ZNC." ?>">
307					<div class="inputlabel"><? FORMAT "Client encoding:" ?></div>
308					<? INC encoding_settings.tmpl ?>
309				</div>
310				<div style="clear:both;"></div>
311				<div class="subsection">
312					<div class="inputlabel"><label for="jointries"><? FORMAT "Join Tries:" ?></label></div>
313					<input id="jointries" type="number" name="jointries" value="<? VAR JoinTries ?>" class="third" min="0"
314						   title="<? FORMAT "This defines how many times ZNC tries to join a channel, if the first join failed, e.g. due to channel mode +i/+k or if you are banned." ?>"/>
315				</div>
316				<div class="subsection">
317					<div class="inputlabel"><label for="maxjoins"><? FORMAT "Join speed:" ?></label></div>
318					<input id="maxjoins" type="number" name="maxjoins" value="<? VAR MaxJoins ?>" class="third" min="0"
319					       title="<? FORMAT "How many channels are joined in one JOIN command. 0 is unlimited (default). Set to small positive value if you get disconnected with “Max SendQ Exceeded”" ?>"/>
320				</div>
321				<div class="subsection">
322					<div class="inputlabel"><label for="notraffictimeout"><? FORMAT "Timeout before reconnect:" ?></label></div>
323					<input id="notraffictimeout" type="number" name="notraffictimeout" value="<? VAR NoTrafficTimeout ?>" class="third" min="30"
324					       title="<? FORMAT "How much time ZNC waits (in seconds) until it receives something from network or declares the connection timeout. This happens after attempts to ping the peer." ?>"/>
325				</div>
326				<div class="subsection">
327					<div class="inputlabel"><label for="maxnetworks"><? FORMAT "Max IRC Networks Number:" ?></label></div>
328					<input type="number" name="maxnetworks" value="<? VAR MaxNetworks ?>" class="third" min="0"
329					       title="<? FORMAT "Maximum number of IRC networks allowed for this user." ?>" <? IF !ImAdmin ?>disabled="disabled"<? ENDIF ?> />
330				</div>
331
332				<? SETBLOCK Substitutions_Link ?><a href="https://wiki.znc.in/ExpandString" target="_blank" class="external"><? FORMAT "Substitutions" ?></a><? ENDSETBLOCK ?>
333				<div class="subsection half" id="ctcpreplies_plain">
334					<div class="inputlabel"><label for="ctcpreplies_text"><? FORMAT "CTCP Replies:" ?></label></div>
335					<div><textarea name="ctcpreplies" cols="70" rows="3" id="ctcpreplies_text"><? LOOP CTCPLoop ?><? VAR CTCP ?>
336<? ENDLOOP ?>
337</textarea></div>
338					<br /><span class="info"><? FORMAT "One reply per line. Example: <code>TIME Buy a watch!</code>" ?></span>
339					<br /><span class="info"><? FORMAT "{1} are available" "Substitutions_Link ESC=" ?></span>
340				</div>
341				<div class="subsection" id="ctcpreplies_js" style="display:none" data-placeholder="<? FORMAT "Empty value means this CTCP request will be ignored" ?>">
342					<div class="inputlabel"><? FORMAT "CTCP Replies:" ?></div>
343					<div>
344						<table style="width:100%">
345							<thead>
346								<tr>
347									<th><? FORMAT "Request" ?></th>
348									<th><? FORMAT "Response" ?></th>
349									<th/>
350								</tr>
351							</thead>
352							<tbody id="ctcpreplies_tbody"/>
353						</table>
354						<input type="button" value="<? FORMAT "Add" ?>" id="ctcpreplies_add"/>
355						<span class="info"><? FORMAT "{1} are available" "Substitutions_Link ESC=" ?></span>
356						<datalist id="ctcpreplies_list">
357							<option value="PING"/>
358							<option value="FINGER"/>
359							<option value="CLIENTINFO"/>
360							<option value="USERINFO"/>
361							<option value="VERSION"/>
362							<option value="SOURCE"/>
363							<option value="TIME"/>
364							<option value="PAGE"/>
365							<option value="DCC"/>
366							<option value="UPTIME"/>
367						</datalist>
368					</div>
369				</div>
370				<script type="text/javascript">ctcpreplies_init(jQuery);</script>
371
372				<div class="subsection">
373					<div class="inputlabel"><label for="skin"><? FORMAT "Skin:" ?></label></div>
374
375						<? IF SkinLoop ROWS > 1 ?>
376						<select id="skin" name="skin">
377							<option value=""><? FORMAT "- Global -" ?></option>
378							<? LOOP SkinLoop ?>
379							<option value="<? VAR Name ?>"<? IF Checked ?> selected="selected"<? ENDIF ?>><? IF Name == "_default_" ?><? FORMAT "Default" ?><? ELSE ?><? VAR Name ?><? ENDIF ?></option>
380							<? ENDLOOP ?>
381						</select>
382						<? ELSE ?>
383						<? FORMAT "No other skins found" ?>
384						<? ENDIF ?>
385
386				</div>
387
388				<div class="subsection">
389					<div class="inputlabel"><label for="language"><? FORMAT "Language:" ?></label></div>
390
391					<? IF HaveI18N ?>
392					<select id="language" name="language">
393						<? LOOP LanguageLoop ?>
394						<option value="<? VAR Code ?>" <? IF Language TOP == *Code ?>selected="selected"<? ENDIF ?>><? VAR Name ?></option>
395						<? ENDLOOP ?>
396					</select>
397					<? ELSE ?>
398					ZNC is compiled without i18n support
399					<? ENDIF ?>
400				</div>
401
402				<div style="clear: both;"></div>
403			</div>
404		</div>
405	</div>
406
407	<? LOOP EmbeddedModuleLoop ?>
408		<? IF Embed ?>
409		<div class="section">
410			<h3><? FORMAT "Module {1}" ModName ?></h3>
411			<? INC *Embed ?>
412		</div>
413		<? ENDIF ?>
414	<? ENDLOOP ?>
415
416	<div class="submitline">
417		<? IF ImAdmin ?>
418			<? IF Edit ?>
419				<input type="submit" name="submit_return" value="<? FORMAT "Save and return" ?>"/>
420				<input type="submit" name="submit_continue" value="<? FORMAT "Save and continue" ?>"/>
421			<? ELSE IF Clone ?>
422				<input type="submit" name="submit_return" value="<? FORMAT "Clone and return" ?>"/>
423				<input type="submit" name="submit_continue" value="<? FORMAT "Clone and continue" ?>"/>
424			<? ELSE ?>
425				<input type="submit" name="submit_return" value="<? FORMAT "Create and return" ?>"/>
426				<input type="submit" name="submit_continue" value="<? FORMAT "Create and continue" ?>"/>
427			<? ENDIF ?>
428		<? ELSE ?>
429			<? IF Edit ?>
430				<input type="submit" value="<? FORMAT "Save" ?>"/>
431			<? ELSE IF Clone ?>
432				<input type="submit" value="<? FORMAT "Clone" ?>"/>
433			<? ELSE ?>
434				<input type="submit" value="<? FORMAT "Create" ?>"/>
435			<? ENDIF ?>
436		<? ENDIF ?>
437	</div>
438</form>
439<script>make_sortable();</script>
440
441<? INC Footer.tmpl ?>
442