Merge branch 'MDL-32777' of git://github.com/danpoltawski/moodle
[moodle.git] / auth / cas / config.html
blob4781cb90ffa74d3f29f7cb93ffec4b29aec86c71
1 <?php
3 include($CFG->dirroot.'/auth/cas/languages.php');
5 // set to defaults if undefined (CAS)
6 if (!isset ($config->hostname)) {
7 $config->hostname = '';
9 if (!isset ($config->port)) {
10 $config->port = '';
12 if (!isset ($config->casversion)) {
13 $config->casversion = CAS_VERSION_2_0;
15 if (!isset ($config->baseuri)) {
16 $config->baseuri = '';
18 if (!isset ($config->language)) {
19 $config->language = '';
21 if (!isset ($config->proxycas)) {
22 $config->proxycas = '';
24 if (!isset ($config->logoutcas)) {
25 $config->logoutcas = '';
27 if (!isset ($config->multiauth)) {
28 $config->multiauth = '';
30 if (!isset ($config->certificate_check)) {
31 $config->certificate_check = '';
33 if (!isset ($config->certificate_path)) {
34 $config->certificate_path = '';
37 // set to defaults if undefined (LDAP)
38 if (!isset($config->host_url)) {
39 $config->host_url = '';
41 if (empty($config->ldapencoding)) {
42 $config->ldapencoding = 'utf-8';
44 if (!isset($config->contexts)) {
45 $config->contexts = '';
47 if (!isset($config->user_type)) {
48 $config->user_type = 'default';
50 if (!isset($config->user_attribute)) {
51 $config->user_attribute = '';
53 if (!isset($config->search_sub)) {
54 $config->search_sub = '';
56 if (!isset($config->opt_deref)) {
57 $config->opt_deref = LDAP_DEREF_NEVER;
59 if (!isset($config->bind_dn)) {
60 $config->bind_dn = '';
62 if (!isset($config->bind_pw)) {
63 $config->bind_pw = '';
65 if (!isset($config->ldap_version)) {
66 $config->ldap_version = '3';
68 if (!isset($config->objectclass)) {
69 $config->objectclass = '';
71 if (!isset($config->memberattribute)) {
72 $config->memberattribute = '';
74 if (!isset($config->memberattribute_isdn)) {
75 $config->memberattribute_isdn = '';
77 if (!isset($config->groupecreators)) {
78 $config->groupecreators = '';
80 if (!isset($config->attrcreators)) {
81 $config->attrcreators = '';
83 if (!isset($config->removeuser)) {
84 $config->removeuser = AUTH_REMOVEUSER_KEEP;
87 $yesno = array( get_string('no'), get_string('yes') );
90 <table cellspacing="0" cellpadding="5" border="0">
91 <tr>
92 <td colspan="2">
93 <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
94 </td>
95 </tr>
96 <tr valign="top" class="required">
97 <td align="right"><?php print_string('auth_cas_hostname_key', 'auth_cas') ?>:</td>
98 <td>
99 <input name="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" />
100 <?php if (isset($err['hostname'])) { echo $OUTPUT->error_text($err['hostname']); } ?>
101 </td>
102 <td>
103 <?php print_string('auth_cas_hostname', 'auth_cas') ?>
104 </td>
105 </tr>
106 <tr valign="top" class="required">
107 <td align="right">
108 <?php print_string('auth_cas_baseuri_key', 'auth_cas') ?>:
109 </td>
110 <td>
111 <input name="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" />
112 <?php if (isset($err['baseuri'])) { echo $OUTPUT->error_text($err['baseuri']); } ?>
113 </td>
114 <td>
115 <?php print_string('auth_cas_baseuri', 'auth_cas') ?>
116 </td>
117 </tr>
118 <tr valign="top" class="required">
119 <td align="right">
120 <?php print_string('auth_cas_port_key', 'auth_cas') ?>:
121 </td>
122 <td>
123 <input name="port" type="text" size="30" value="<?php echo $config->port ?>" />
124 <?php if (isset($err['port'])) { echo $OUTPUT->error_text($err['port']); } ?>
125 </td>
126 <td>
127 <?php print_string('auth_cas_port', 'auth_cas') ?>
128 </td>
129 </tr>
130 <tr valign="top" class="required">
131 <td align="right">
132 <?php print_string('auth_cas_casversion', 'auth_cas') ?>:
133 </td>
134 <td>
135 <?php
136 $casversions = array();
137 $casversions[CAS_VERSION_1_0] = 'CAS 1.0';
138 $casversions[CAS_VERSION_2_0] = 'CAS 2.0';
139 echo html_writer::select($casversions, 'casversion', $config->casversion, false);
140 if (isset($err['casversion'])) { echo $OUTPUT->error_text($err['casversion']); }
142 </td>
143 <td>
144 <?php print_string('auth_cas_version', 'auth_cas') ?>
145 </td>
146 </tr>
147 <tr valign="top" class="required">
148 <td align="right"><?php print_string('auth_cas_language_key', 'auth_cas') ?>:</td>
149 <td>
150 <?php echo html_writer::select($CASLANGUAGES, 'language', $config->language, false); ?>
151 </td>
152 <td>
153 <?php print_string('auth_cas_language', 'auth_cas') ?>
154 </td>
155 </tr>
156 <tr valign="top" class="required">
157 <td align="right">
158 <?php print_string('auth_cas_proxycas_key', 'auth_cas') ?>:
159 </td>
160 <td>
161 <?php echo html_writer::select($yesno, 'proxycas', $config->proxycas, false); ?>
162 </td>
163 <td>
164 <?php print_string('auth_cas_proxycas', 'auth_cas') ?>
165 </td>
166 </tr>
167 <tr valign="top" class="required">
168 <td align="right"><?php print_string('auth_cas_logoutcas_key', 'auth_cas') ?>:</td>
169 <td>
170 <?php echo html_writer::select($yesno, 'logoutcas', $config->logoutcas, false); ?>
171 </td>
172 <td>
173 <?php print_string('auth_cas_logoutcas', 'auth_cas') ?>
174 </td>
175 </tr>
176 <tr valign="top" class="required">
177 <td align="right"><?php print_string('auth_cas_multiauth_key', 'auth_cas') ?>:</td>
178 <td>
179 <?php echo html_writer::select($yesno, 'multiauth', $config->multiauth, false); ?>
180 </td>
181 <td>
182 <?php print_string('auth_cas_multiauth', 'auth_cas') ?>
183 </td>
184 </tr>
185 <tr valign="top" class="required">
186 <td align="right"><?php print_string('auth_cas_certificate_check_key', 'auth_cas') ?>:</td>
187 <td>
188 <?php echo html_writer::select($yesno, 'certificate_check', $config->certificate_check, false); ?>
189 </td>
190 <td>
191 <?php print_string('auth_cas_certificate_check', 'auth_cas') ?>
192 </td>
193 </tr>
194 <tr valign="top" class="required">
195 <td align="right"><?php print_string('auth_cas_certificate_path_key', 'auth_cas') ?>:</td>
196 <td>
197 <input name="certificate_path" id="certificate_path" type="text" size="30" value="<?php echo $config->certificate_path ?>" />
198 <?php if (isset($err['certificate_path'])) echo $OUTPUT->error_text($err['certificate_path']); ?>
199 </td>
200 <td>
201 <?php print_string('auth_cas_certificate_path', 'auth_cas') ?>
202 </td>
203 </tr>
204 <tr>
205 <td colspan="2">
206 <h4><?php print_string('auth_ldap_server_settings', 'auth_ldap') ?></h4>
207 </td>
208 </tr>
209 <tr valign="top" class="required">
210 <td align="right">
211 <label for="host_url"><?php print_string('auth_ldap_host_url_key', 'auth_ldap') ?></label>
212 </td>
213 <td>
214 <input name="host_url" id="host_url" type="text" size="30" value="<?php echo $config->host_url?>" />
215 <?php if (isset($err['host_url'])) { echo $OUTPUT->error_text($err['host_url']); } ?>
216 </td>
217 <td>
218 <?php print_string('auth_ldap_host_url', 'auth_ldap') ?>
219 </td>
220 </tr>
221 <tr valign="top" class="required">
222 <td align="right"><label for="menuversion"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label></td>
223 <td>
224 <?php
225 $versions = array();
226 $versions[2] = '2';
227 $versions[3] = '3';
228 echo html_writer::select($versions, 'ldap_version', $config->ldap_version, false);
229 if (isset($err['ldap_version'])) { echo $OUTPUT->error_text($err['ldap_version']); }
231 </td>
232 <td>
233 <?php print_string('auth_ldap_version', 'auth_ldap') ?>
234 </td>
235 </tr>
236 <tr valign="top" class="required">
237 <td align="right">
238 <label for="ldapencoding"><?php print_string('auth_ldap_ldap_encoding_key', 'auth_ldap') ?></label>
239 </td>
240 <td>
241 <input id="ldapencoding" name="ldapencoding" type="text" value="<?php echo $config->ldapencoding ?>" />
242 <?php if (isset($err['ldapencoding'])) { echo $OUTPUT->error_text($err['ldapencoding']); } ?>
243 </td>
244 <td>
245 <?php print_string('auth_ldap_ldap_encoding', 'auth_ldap') ?>
246 </td>
247 </tr>
248 <tr>
249 <td colspan="2">
250 <h4><?php print_string('auth_ldap_bind_settings', 'auth_ldap') ?></h4>
251 </td>
252 </tr>
253 <tr valign="top" class="required">
254 <td align="right">
255 <label for="bind_dn"><?php print_string('auth_ldap_bind_dn_key', 'auth_ldap') ?></label>
256 </td>
257 <td>
258 <input name="bind_dn" id="bind_dn" type="text" size="30" value="<?php echo $config->bind_dn?>" />
259 <?php if (isset($err['bind_dn'])) { echo $OUTPUT->error_text($err['bind_dn']); } ?>
260 </td>
261 <td>
262 <?php print_string('auth_ldap_bind_dn', 'auth_ldap') ?>
263 </td>
264 </tr>
265 <tr valign="top" class="required">
266 <td align="right">
267 <label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key', 'auth_ldap') ?></label>
268 </td>
269 <td>
270 <input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" />
271 <?php if (isset($err['bind_pw'])) { echo $OUTPUT->error_text($err['bind_pw']); } ?>
272 </td>
273 <td>
274 <?php print_string('auth_ldap_bind_pw', 'auth_ldap') ?>
275 </td>
276 </tr>
277 <tr>
278 <td colspan="2">
279 <h4><?php print_string('auth_ldap_user_settings', 'auth_ldap') ?></h4>
280 </td>
281 </tr>
282 <tr valign="top" class="required">
283 <td align="right">
284 <label for="menuuser_type"><?php print_string('auth_ldap_user_type_key', 'auth_ldap') ?></label>
285 </td>
286 <td>
287 <?php
288 echo html_writer::select(ldap_supported_usertypes(), 'user_type', $config->user_type, false);
289 if (isset($err['user_type'])) { echo $OUTPUT->error_text($err['user_type']); }
291 </td>
292 <td>
293 <?php print_string('auth_ldap_user_type', 'auth_ldap') ?>
294 </td>
295 </tr>
296 <tr valign="top" class="required">
297 <td align="right">
298 <label for="contexts"><?php print_string('auth_ldap_contexts_key', 'auth_ldap') ?></label>
299 </td>
300 <td>
301 <input name="contexts" id="contexts" type="text" size="30" value="<?php echo $config->contexts?>" />
302 <?php if (isset($err['contexts'])) { echo $OUTPUT->error_text($err['contexts']); } ?>
303 </td>
304 <td>
305 <?php print_string('auth_ldap_contexts', 'auth_ldap') ?>
306 </td>
307 </tr>
308 <tr valign="top" class="required">
309 <td align="right">
310 <label for="menusearch_sub"><?php print_string('auth_ldap_search_sub_key', 'auth_ldap') ?></label></td>
311 <td>
312 <?php echo html_writer::select($yesno, 'search_sub', $config->search_sub, false); ?>
313 </td>
314 <td>
315 <?php print_string('auth_ldap_search_sub', 'auth_ldap') ?>
316 </td>
317 </tr>
318 <tr valign="top" class="required">
319 <td align="right"><label for="menuopt_deref"><?php print_string('auth_ldap_opt_deref_key', 'auth_ldap') ?></label></td>
320 <td>
321 <?php
322 $opt_deref = array();
323 $opt_deref[LDAP_DEREF_NEVER] = get_string('no');
324 $opt_deref[LDAP_DEREF_ALWAYS] = get_string('yes');
325 echo html_writer::select($opt_deref, 'opt_deref', $config->opt_deref, false);
326 if (isset($err['opt_deref'])) { echo $OUTPUT->error_text($err['opt_deref']); }
328 </td>
329 <td>
330 <?php print_string('auth_ldap_opt_deref', 'auth_ldap') ?>
331 </td>
332 </tr>
333 <tr valign="top" class="required">
334 <td align="right">
335 <label for="user_attribute"><?php print_string('auth_ldap_user_attribute_key', 'auth_ldap') ?></label>
336 </td>
337 <td>
338 <input name="user_attribute" id="user_attribute" type="text" size="30" value="<?php echo $config->user_attribute?>" />
339 <?php if (isset($err['user_attribute'])) { echo $OUTPUT->error_text($err['user_attribute']); } ?>
340 </td>
341 <td>
342 <?php print_string('auth_ldap_user_attribute', 'auth_ldap') ?>
343 </td>
344 </tr>
345 <tr valign="top" class="required">
346 <td align="right">
347 <label for="memberattribute"><?php print_string('auth_ldap_memberattribute_key', 'auth_ldap') ?></label>
348 </td>
349 <td>
350 <input name="memberattribute" id="memberattribute" type="text" size="30" value="<?php echo $config->memberattribute?>" />
351 <?php if (isset($err['memberattribute'])) { echo $OUTPUT->error_text($err['memberattribute']); } ?>
352 </td>
353 <td>
354 <?php print_string('auth_ldap_memberattribute', 'auth_ldap') ?>
355 </td>
356 </tr>
357 <tr valign="top" class="required">
358 <td align="right">
359 <label for="memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key', 'auth_ldap') ?></label>
360 </td>
361 <td>
362 <input name="memberattribute_isdn" id="memberattribute_isdn" type="text" size="30" value="<?php echo $config->memberattribute_isdn?>" />
363 <?php if (isset($err['memberattribute_isdn'])) { echo $OUTPUT->error_text($err['memberattribute_isdn']); } ?>
364 </td>
365 <td>
366 <?php print_string('auth_ldap_memberattribute_isdn', 'auth_ldap') ?>
367 </td>
368 </tr>
369 <tr valign="top" class="required">
370 <td align="right">
371 <label for="objectclass"><?php print_string('auth_ldap_objectclass_key', 'auth_ldap') ?></label>
372 </td>
373 <td>
374 <input name="objectclass" id="objectclass" type="text" size="30" value="<?php echo $config->objectclass?>" />
375 <?php if (isset($err['objectclass'])) { echo $OUTPUT->error_text($err['objectclass']); } ?>
376 </td>
377 <td>
378 <?php print_string('auth_ldap_objectclass', 'auth_ldap') ?>
379 </td>
380 </tr>
381 <tr>
382 <td colspan="2">
383 <h4><?php print_string('coursecreators') ?></h4>
384 </td>
385 </tr>
386 <tr valign="top" class="required">
387 <td align="right">
388 <label for="attrcreators"><?php print_string('auth_ldap_attrcreators_key', 'auth_ldap') ?></label>
389 </td>
390 <td>
391 <input name="attrcreators" id="attrcreators" type="text" size="30" value="<?php echo $config->attrcreators?>" />
392 <?php if (isset($err['attrcreators'])) { echo $OUTPUT->error_text($err['attrcreators']); } ?>
393 </td>
394 <td>
395 <?php print_string('auth_ldap_attrcreators', 'auth_ldap') ?>
396 </td>
397 </tr>
398 <tr valign="top" class="required">
399 <td align="right">
400 <label for="groupecreators"><?php print_string('auth_ldap_groupecreators_key', 'auth_ldap') ?></label>
401 </td>
402 <td>
403 <input name="groupecreators" id="groupecreators" type="text" size="30" value="<?php echo $config->groupecreators?>" />
404 <?php if (isset($err['groupecreators'])) { echo $OUTPUT->error_text($err['groupecreators']); } ?>
405 </td>
406 <td>
407 <?php print_string('auth_ldap_groupecreators', 'auth_ldap') ?>
408 </td>
409 </tr>
410 <tr>
411 <td colspan="2">
412 <h4><?php print_string('auth_sync_script', 'auth') ?></h4>
413 </td>
414 </tr>
415 <tr valign="top">
416 <td align="right">
417 <label for="menuremoveuser"><?php print_string('auth_remove_user_key', 'auth') ?></label>
418 </td>
419 <td>
420 <?php
421 $deleteopt = array();
422 $deleteopt[AUTH_REMOVEUSER_KEEP] = get_string('auth_remove_keep', 'auth');
423 $deleteopt[AUTH_REMOVEUSER_SUSPEND] = get_string('auth_remove_suspend', 'auth');
424 $deleteopt[AUTH_REMOVEUSER_FULLDELETE] = get_string('auth_remove_delete', 'auth');
425 echo html_writer::select($deleteopt, 'removeuser', $config->removeuser, false);
427 </td>
428 <td>
429 <?php print_string('auth_remove_user', 'auth') ?>
430 </td>
431 </tr>
432 <?php
433 $help = get_string('auth_ldapextrafields', 'auth_ldap');
434 $help .= get_string('auth_updatelocal_expl', 'auth');
435 $help .= get_string('auth_fieldlock_expl', 'auth');
436 $help .= get_string('auth_updateremote_expl', 'auth');
437 $help .= '<hr />';
438 $help .= get_string('auth_updateremote_ldap', 'auth');
440 print_auth_lock_options($this->authtype, $user_fields, $help, true, true);
442 </table>