1{* $Id$ *}
2<form action="tiki-admin.php?page=intertiki" method="post" name="intertiki">
3	{ticket}
4	<div class="t_navbar mb-4 clearfix">
5		{include file='admin/include_apply_top.tpl'}
6	</div>
7
8	{tabset name="admin_interwiki"}
9		{tab name="{tr}Intertiki Client{/tr}"}
10			<em>{tr}Set up this Tiki site as the Intertiki client{/tr}</em><br><br>
11			<fieldset>
12				<legend>{tr}Activate the feature{/tr}</legend>
13				{preference name=feature_intertiki}
14			</fieldset>
15			<fieldset>
16				<legend>{tr}Client server settings{/tr}</legend>
17				{preference name=tiki_key}
18				{preference name=feature_intertiki_sharedcookie}
19			</fieldset>
20			<fieldset>
21				<legend>{tr}Currently linked master server{/tr}</legend>
22				{preference name=feature_intertiki_mymaster mode=notempty}
23				<div class="adminoptionboxchild feature_intertiki_mymaster_childcontainer">
24					{preference name=feature_intertiki_import_preferences}
25					{preference name=feature_intertiki_import_groups}
26					{preference name=feature_intertiki_imported_groups}
27				</div>
28			</fieldset>
29			<fieldset>
30				<legend>{tr}Add an available master server{/tr}{help desc='{tr}The InterTiki Server fields are for defining for every master server you want to have access to from this client{/tr}'}</legend>
31					<div class="form-group row">
32						<label class="col-sm-4 col-form-label">{tr}Server name{/tr}{help desc='{tr}Set the name of your target server as defined in the server name field of the master. Use a distinct, but easily understood value.{/tr}'}</label>
33						<div class="col-sm-8">
34							<input type="text" name="new[name]" value="" class="form-control">
35						</div>
36					</div>
37					<div class="form-group row">
38						<label class="col-sm-4 col-form-label">{tr}Server host{/tr}{help desc='{tr}The full URL of the master servers primary Tiki (ex: https://tiki.org). Even if your Tiki is not at the top level of your web directory, you will still use the site\'s URL per the ex. above.{/tr}'}</label>
39						<div class="col-sm-8">
40							<input type="text" name="new[host]" value="" class="form-control">
41						</div>
42					</div>
43					<div class="form-group row">
44						<label class="col-sm-4 col-form-label">{tr}Server port{/tr}{help desc='{tr}The port number the master tiki responds to HTTP on (usually 80).{/tr}'}</label>
45						<div class="col-sm-8">
46							<input type="text" name="new[port]" value="" class="form-control">
47						</div>
48					</div>
49					<div class="form-group row">
50						<label class="col-sm-4 col-form-label">{tr}Server path{/tr}{help desc='{tr}The full path (from the URL root) to the PHP file containing the XMLRPC handler on the server. EX 1: If the master tiki resides at the root of the site, you would enter "/remote.php". EX 2: Say the master tiki is found at http://www.mydomain.com/tiki/mytiki, you would enter "/tiki/mytiki/remote.php" in this field.{/tr}'}</label>
51						<div class="col-sm-8">
52							<input type="text" name="new[path]" value="" class="form-control">
53						</div>
54					</div>
55					<div class="form-group row">
56						<label class="col-sm-4 col-form-label">{tr}Server groups{/tr}{help desc='{tr}Groups on the master to authenticate to (only auth users in the groups defined, case-sensitive).{/tr}'}</label>
57						<div class="col-sm-8">
58							<input type="text" name="new[groups]" value="" class="form-control">
59						</div>
60					</div>
61			</fieldset>
62			{if $prefs.interlist}
63				<fieldset>
64					<legend>{tr}Available master Tiki servers{/tr}</legend>
65					<div class="form-group row">
66						<div class="col-sm-12">
67							<table class="table">
68								<thead>
69								<tr>
70									<td>{tr}Name{/tr}</td>
71									<td>{tr}Host{/tr}</td>
72									<td>{tr}Port{/tr}</td>
73									<td>{tr}Path{/tr}</td>
74									<td>{tr}Group{/tr}</td>
75									<td></td>
76								</tr>
77								</thead>
78								<tbody>
79								{foreach key=k item=i from=$prefs.interlist}
80									<tr>
81										<td><input type="text" class="form-control" name="interlist[{$k}][name]" value="{$i.name}"></td>
82										<td><input type="text" class="form-control" name="interlist[{$k}][host]" value="{$i.host}"></td>
83										<td><input type="text" class="form-control" name="interlist[{$k}][port]" value="{$i.port}"></td>
84										<td><input type="text" class="form-control" name="interlist[{$k}][path]" value="{$i.path}"></td>
85										<td><input type="text" class="form-control" name="interlist[{$k}][groups]" value="{foreach item=g from=$i.groups name=f}{$g}{if !$smarty.foreach.f.last},{/if}{/foreach}"></td>
86										<td>
87											<button
88												type="submit"
89												name="del"
90												value="{$k}"
91												class="btn btn-link tips"
92												title="{tr}Delete master server{/tr}:{$k}"
93												onclick="confirmSimple(event, '{tr}Remove this server?{/tr}')"
94											>
95												{icon name='delete'}
96											</button>
97										</td>
98									</tr>
99								{/foreach}
100								<tbody>
101							</table>
102						</div>
103					</div>
104				</fieldset>
105			{/if}
106		{/tab}
107		{if $prefs.feature_intertiki_mymaster eq ''}
108			{tab name="{tr}Intertiki Master Server{/tr}"}
109				<em>{tr}Set up this Tiki site as the InterTiki master server{/tr}</em><br><br>
110				<fieldset>
111					<legend>{tr}Activate the feature{/tr}</legend>
112					{preference name=feature_intertiki_server}
113				</fieldset>
114				<fieldset>
115					<legend>{tr}Master server settings{/tr}</legend>
116					{preference name=intertiki_logfile}
117					{preference name=intertiki_errfile}
118				</fieldset>
119				<fieldset>
120					<legend>{tr}Allowed client servers{/tr}</legend>
121					<div class="form-group row">
122						<div class="col-sm-12">
123							<table class="table">
124								<thead>
125								<tr>
126									<td>&nbsp;</td>
127									<td><label for="known_hosts_name">{tr}Name{/tr}</label>{help desc="{tr}Arbitrary name used to uniquely identify this configuration (does not effect operation). Recommend use of a name that indicates the client server (ex: doc.tw.o){/tr}"}</td>
128									<td><label for="known_hosts_key">{tr}Key{/tr}</label>{help desc="{tr}This is the shared key you define. It has to match the client configuration for your server. It can be as short or as long as you like. It is recommended you follow the same kind of password policies your organization would have for something like a wireless WEP key.{/tr}"}</td>
129									<td><label for="known_hosts_ip">{tr}IP{/tr}</label>{help desc="{tr}The physical IP address the client machine will be making requests to the server from. If the client is on the same machine, you should be able to use 127.0.0.1{/tr}"}</td>
130									<td><label for="known_hosts_contact">{tr}Contact{/tr}</label>{help desc="{tr}Username of primary contact on client machine. Useful for adminstration{/tr}"}</td>
131									<td><label for="known_hosts_can_register">{tr}Can register{/tr}</label></td>
132								</tr>
133								</thead>
134								<tbody>
135								{if $prefs.known_hosts}
136									{foreach key=k item=i from=$prefs.known_hosts}
137										<tr>
138											<td>
139												<button
140													type="submit"
141													name="delk"
142													class="btn btn-link tips"
143													value="{$k|escape:'attr'}"
144													title=":{tr}Delete{/tr}"
145													onclick="confirmSimple(event, '{tr}Remove this host?{/tr}')"
146												>
147													{icon name='delete'}
148												</button>
149											</td>
150											<td>
151												<input type="text" class="form-control" id="known_hosts_name" name="known_hosts[{$k}][name]" value="{$i.name}">
152											</td>
153											<td>
154												<input type="text" class="form-control tips" id="known_hosts_key" name="known_hosts[{$k}][key]" value="{$i.key}"
155													readonly="readonly" title="|{tr}To change the host key you need to remove and add it as a new one{/tr}">
156											</td>
157											<td>
158												<input type="text" class="form-control" id="known_hosts_ip" name="known_hosts[{$k}][ip]" value="{$i.ip}">
159											</td>
160											<td>
161												<input type="text" class="form-control" id="known_hosts_contact" name="known_hosts[{$k}][contact]" value="{$i.contact}">
162											</td>
163											<td>
164												<input type="checkbox" class="form-control" id="known_hosts_can_register" name="known_hosts[{$k}][allowusersregister]" {if isset($i.allowusersregister) && $i.allowusersregister eq 'y'}checked="checked"{/if} />
165											</td>
166										</tr>
167									{/foreach}
168								{/if}
169								<tr>
170									<td>{tr}New:{/tr}</td>
171									<td><label class="sr-only" for="new_host_name">{tr}New{/tr}</label><input type="text" class="form-control" id="new_host_name" name="newhost[name]" value=""/></td>
172									<td><label class="sr-only" for="new_host_key">{tr}Key{/tr}</label><input type="text" class="form-control" id="new_host_key" name="newhost[key]" value=""/></td>
173									<td><label class="sr-only" for="new_host_ip">{tr}IP{/tr}</label><input type="text" class="form-control" id="new_host_ip" name="newhost[ip]" value=""/></td>
174									<td><label class="sr-only" for="new_host_contact">{tr}Contact{/tr}</label><input type="text" class="form-control" id="new_host_contact" name="newhost[contact]" value=""/></td>
175									<td><label class="sr-only" for="new_host_can_register">{tr}Can register{/tr}</label><input type="checkbox" id="new_host_can_register" name="newhost[allowusersregister]"/></td>
176								</tr>
177								</tbody>
178							</table>
179						</div>
180					</div>
181				</fieldset>
182			{/tab}
183		{/if}
184	{/tabset}
185	{include file='admin/include_apply_bottom.tpl'}
186</form>
187
188