Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / auth / ldap / config.html
blob9279638e11a7f778e8df9ed5e14ca71cb90b5460
1 <?php
3 // set to defaults if undefined
4 if (!isset($config->host_url))
5 { $config->host_url = ''; }
6 if (empty($config->ldapencoding))
7 { $config->ldapencoding = 'utf-8'; }
8 if (!isset($config->contexts))
9 { $config->contexts = ''; }
10 if (!isset($config->user_type))
11 { $config->user_type = 'default'; }
12 if (!isset($config->user_attribute))
13 { $config->user_attribute = ''; }
14 if (!isset($config->search_sub))
15 { $config->search_sub = ''; }
16 if (!isset($config->opt_deref))
17 { $config->opt_deref = LDAP_DEREF_NEVER; }
18 if (!isset($config->preventpassindb))
19 { $config->preventpassindb = 0; }
20 if (!isset($config->bind_dn))
21 {$config->bind_dn = ''; }
22 if (!isset($config->bind_pw))
23 {$config->bind_pw = ''; }
24 if (!isset($config->version))
25 {$config->version = '2'; }
26 if (!isset($config->objectclass))
27 {$config->objectclass = ''; }
28 if (!isset($config->memberattribute))
29 {$config->memberattribute = ''; }
30 if (!isset($config->memberattribute_isdn))
31 {$config->memberattribute_isdn = ''; }
32 if (!isset($config->creators))
33 {$config->creators = ''; }
34 if (!isset($config->create_context))
35 {$config->create_context = ''; }
36 if (!isset($config->expiration))
37 {$config->expiration = ''; }
38 if (!isset($config->expiration_warning))
39 {$config->expiration_warning = '10'; }
40 if (!isset($config->expireattr))
41 {$config->expireattr = ''; }
42 if (!isset($config->gracelogins))
43 {$config->gracelogins = ''; }
44 if (!isset($config->graceattr))
45 {$config->graceattr = ''; }
46 if (!isset($config->auth_user_create))
47 {$config->auth_user_create = ''; }
48 if (!isset($config->forcechangepassword))
49 {$config->forcechangepassword = 0; }
50 if (!isset($config->stdchangepassword))
51 {$config->stdchangepassword = 0; }
52 if (!isset($config->passtype))
53 {$config->passtype = 'plaintext';}
54 if (!isset($config->changepasswordurl))
55 {$config->changepasswordurl = ''; }
56 if (!isset($config->removeuser))
57 {$config->removeuser = 0; }
58 if (!isset($config->ntlmsso_enabled))
59 {$config->ntlmsso_enabled = 0; }
60 if (!isset($config->ntlmsso_subnet))
61 {$config->ntlmsso_subnet = ''; }
63 $yesno = array( get_string('no'), get_string('yes') );
65 if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
66 notify(get_string('auth_ldap_noextension','auth'));
70 <table cellspacing="0" cellpadding="5" border="0">
72 <tr>
73 <td colspan="2">
74 <h4><?php print_string('auth_ldap_server_settings', 'auth') ?> </h4>
75 </td>
76 </tr>
78 <tr valign="top" class="required">
79 <td align="right"><label for="host_url"><?php print_string('auth_ldap_host_url_key','auth') ?></label></td>
80 <td>
81 <input name="host_url" id="host_url" type="text" size="30" value="<?php echo $config->host_url?>" />
82 <?php if (isset($err['host_url'])) formerr($err['host_url']); ?>
83 </td>
84 <td>
85 <?php print_string('auth_ldap_host_url','auth') ?>
86 </td>
87 </tr>
89 <tr valign="top" class="required">
90 <td align="right"><label for="menuversion"><?php print_string('auth_ldap_version_key','auth') ?></label></td>
91 <td>
92 <?php
93 $varsions = array();
94 $versions[2] = '2';
95 $versions[3] = '3';
96 choose_from_menu($versions, 'version', $config->version, '');
97 if (isset($err['version'])) formerr($err['version']);
99 </td>
100 <td>
101 <?php print_string('auth_ldap_version','auth') ?>
102 </td>
103 </tr>
105 <tr valign="top" class="required">
106 <td align="right"><label for="ldapencoding"><?php print_string("auth_ldap_ldap_encoding_key", "auth") ?></label></td>
107 <td>
108 <input id="ldapencoding" name="ldapencoding" type="text" value="<?php echo $config->ldapencoding ?>" />
109 <?php
111 if (isset($err['ldapencoding'])) {
112 formerr($err['ldapencoding']);
116 </td>
117 <td><?php print_string('auth_ldap_ldap_encoding', 'auth') ?></td>
118 </tr>
120 <tr>
121 <td colspan="2">
122 <h4><?php print_string('auth_ldap_bind_settings', 'auth') ?> </h4>
123 </td>
124 </tr>
126 <tr valign="top" class="required">
127 <td align="right"><label for="menupreventpassindb"><?php print_string('auth_ldap_preventpassindb_key','auth') ?></label></td>
128 <td>
129 <?php choose_from_menu($yesno, 'preventpassindb', $config->preventpassindb, ''); ?>
130 </td><td>
131 <?php print_string('auth_ldap_preventpassindb','auth') ?>
132 </td>
133 </tr>
135 <tr valign="top" class="required">
136 <td align="right"><label for="bind_dn"><?php print_string('auth_ldap_bind_dn_key','auth') ?></label></td>
137 <td>
138 <input name="bind_dn" id="bind_dn" type="text" size="30" value="<?php echo $config->bind_dn?>" />
139 <?php if (isset($err['bind_dn'])) formerr($err['bind_dn']); ?>
140 </td><td>
141 <?php print_string('auth_ldap_bind_dn','auth') ?>
142 </td>
143 </tr>
145 <tr valign="top" class="required">
146 <td align="right"><label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key','auth') ?></label></td>
147 <td>
148 <input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" />
149 <?php if (isset($err['bind_pw'])) formerr($err['bind_pw']); ?>
150 </td><td>
151 <?php print_string('auth_ldap_bind_pw','auth') ?>
152 </td>
153 </tr>
155 <tr>
156 <td colspan="2">
157 <h4><?php print_string('auth_ldap_user_settings', 'auth') ?> </h4>
158 </td>
159 </tr>
161 <tr valign="top" class="required">
162 <td align="right"><label for="menuuser_type"><?php print_string('auth_ldap_user_type_key','auth') ?></label></td>
163 <td>
164 <?php choose_from_menu($this->ldap_suppported_usertypes(), 'user_type', $config->user_type, ''); ?>
165 <?php if (isset($err['user_type'])) formerr($err['user_type']); ?>
166 </td>
167 <td>
168 <?php print_string('auth_ldap_user_type', 'auth') ?>
169 </td>
170 </tr>
172 <tr valign="top" class="required">
173 <td align="right"><label for="contexts"><?php print_string('auth_ldap_contexts_key','auth') ?></label></td>
174 <td>
175 <input name="contexts" id="contexts" type="text" size="30" value="<?php echo $config->contexts?>" />
176 <?php if (isset($err['contexts'])) formerr($err['contexts']); ?>
177 </td>
178 <td>
179 <?php print_string('auth_ldap_contexts', 'auth') ?>
180 </td>
181 </tr>
183 <tr valign="top" class="required">
184 <td align="right"><label for="menusearch_sub"><?php print_string('auth_ldap_search_sub_key','auth') ?></label></td>
185 <td>
186 <?php choose_from_menu($yesno, 'search_sub', $config->search_sub, ''); ?>
187 </td>
188 <td>
189 <?php print_string('auth_ldap_search_sub','auth') ?>
190 </td>
191 </tr>
193 <tr valign="top" class="required">
194 <td align="right"><label for="menuopt_deref"><?php print_string('auth_ldap_opt_deref_key','auth') ?></label></td>
195 <td>
196 <?php
197 $opt_deref = array();
198 $opt_deref[LDAP_DEREF_NEVER] = get_string('no');
199 $opt_deref[LDAP_DEREF_ALWAYS] = get_string('yes');
200 choose_from_menu($opt_deref, 'opt_deref', $config->opt_deref, LDAP_DEREF_NEVER, '');
201 if (isset($err['opt_deref'])) formerr($err['opt_deref']);
203 </td>
204 <td>
205 <?php print_string('auth_ldap_opt_deref','auth') ?>
206 </td>
207 </tr>
211 <tr valign="top" class="required">
212 <td align="right"><label for="user_attribute"><?php print_string('auth_ldap_user_attribute_key','auth') ?></label></td>
213 <td>
214 <input name="user_attribute" id="user_attribute" type="text" size="30" value="<?php echo $config->user_attribute?>" />
215 <?php if (isset($err['user_attribute'])) formerr($err['user_attribute']); ?>
216 </td>
217 <td>
218 <?php print_string('auth_ldap_user_attribute','auth') ?>
219 </td>
220 </tr>
222 <tr valign="top" class="required">
223 <td align="right"><label for="memberattribute"><?php print_string('auth_ldap_memberattribute_key','auth') ?></label></td>
224 <td>
225 <input name="memberattribute" id="memberattribute" type="text" size="30" value="<?php echo $config->memberattribute?>" />
226 <?php if (isset($err['memberattribute'])) formerr($err['memberattribute']); ?>
227 </td><td>
228 <?php print_string('auth_ldap_memberattribute','auth') ?>
229 </td>
230 </tr>
232 <tr valign="top" class="required">
233 <td align="right"><label for="memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key','auth') ?></label></td>
234 <td>
235 <input name="memberattribute_isdn" id="memberattribute_isdn" type="text" size="30" value="<?php echo $config->memberattribute_isdn?>" />
236 <?php if (isset($err['memberattribute_isdn'])) formerr($err['memberattribute_isdn']); ?>
237 </td><td>
238 <?php print_string('auth_ldap_memberattribute_isdn','auth') ?>
239 </td>
240 </tr>
242 <tr valign="top" class="required">
243 <td align="right"><label for="objectclass"><?php print_string('auth_ldap_objectclass_key','auth') ?></label></td>
244 <td>
245 <input name="objectclass" id="objectclass" type="text" size="30" value="<?php echo $config->objectclass?>" />
246 <?php if (isset($err['objectclass'])) formerr($err['objectclass']); ?>
247 </td>
248 <td>
249 <?php print_string('auth_ldap_objectclass','auth') ?>
250 </td>
251 </tr>
253 <tr>
254 <td colspan="2">
255 <h4><?php print_string('forcechangepassword', 'auth') ?> </h4>
256 </td>
257 </tr>
259 <tr valign="top" class="required">
260 <td align="right" valign="top"><label for="menuforcechangepassword"><?php print_string('forcechangepassword', 'auth') ?></label></td>
261 <td>
262 <?php choose_from_menu($yesno, 'forcechangepassword', $config->forcechangepassword, ''); ?>
263 </td>
264 <td align="left" valign="top">
265 <p><?php print_string('forcechangepasswordfirst_help', 'auth') ?></p>
266 </td>
267 </tr>
269 <tr valign="top" class="required">
270 <td align="right" valign="top"><label for="menustdchangepassword"><?php print_string('stdchangepassword', 'auth') ?></label></td>
271 <td>
272 <?php choose_from_menu($yesno, 'stdchangepassword', $config->stdchangepassword, ''); ?>
273 </td>
274 <td align="left" valign="top">
275 <p><?php print_string('stdchangepassword_expl', 'auth') ?></p>
276 <p><?php print_string('stdchangepassword_explldap', 'auth') ?></p>
277 </td>
278 </tr>
280 <tr valign="top" class="required">
281 <td align="right"><label for="menupasstype"><?php print_string('auth_ldap_passtype_key', 'auth') ?></label></td>
282 <td>
283 <?php
284 $passtype = array();
285 $passtype['plaintext'] = get_string('plaintext', 'auth');
286 $passtype['md5'] = get_string('md5', 'auth');
287 $passtype['sha1'] = get_string('sha1', 'auth');
288 choose_from_menu($passtype, 'passtype', $config->passtype, '');
291 </td>
292 <td><?php print_string('auth_ldap_passtype', 'auth') ?></td>
293 </tr>
295 <tr valign="top">
296 <td align="right"><label for="changepasswordurl"><?php print_string('auth_ldap_changepasswordurl_key','auth') ?></label></td>
297 <td>
298 <input name="changepasswordurl" id="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
299 <?php
301 if (isset($err['changepasswordurl'])) {
302 formerr($err['changepasswordurl']);
306 </td>
307 <td><?php print_string('changepasswordhelp', 'auth') ?></td>
308 </tr>
310 <tr>
311 <td colspan="2">
312 <h4><?php print_string('auth_ldap_passwdexpire_settings', 'auth') ?> </h4>
313 </td>
314 </tr>
316 <tr valign="top" class="required">
317 <td align="right"><label for="menuexpiration"><?php print_string('auth_ldap_expiration_key','auth') ?></label></td>
318 <td>
319 <?php
320 $expiration = array();
321 $expiration['0'] = 'no';
322 $expiration['1'] = 'LDAP';
323 choose_from_menu($expiration, 'expiration', $config->expiration, '');
324 if (isset($err['expiration'])) formerr($err['expiration']);
326 </td>
327 <td>
328 <?php print_string('auth_ldap_expiration_desc','auth') ?>
329 </td>
330 </tr>
333 <tr valign="top" class="required">
334 <td align="right"><label for="expiration_warning"><?php print_string('auth_ldap_expiration_warning_key','auth') ?></label></td>
335 <td>
336 <input name="expiration_warning" id="expiration_warning" type="text" size="2" value="<?php echo $config->expiration_warning?>" />
337 <?php if (isset($err['expiration_warning'])) formerr($err['expiration_warning']);
339 </td>
340 <td>
341 <?php print_string('auth_ldap_expiration_warning_desc','auth') ?>
342 </td>
343 </tr>
345 <tr valign="top" class="required">
346 <td align="right"><label for="expireattr"><?php print_string('auth_ldap_expireattr_key','auth') ?></label></td>
347 <td>
348 <input name="expireattr" id="expireattr" type="text" size="30" value="<?php echo $config->expireattr?>" />
349 <?php if (isset($err['expireattr'])) formerr($err['expireattr']);
351 </td>
352 <td>
353 <?php print_string('auth_ldap_expireattr_desc','auth') ?>
354 </td>
355 </tr>
357 <tr valign="top" class="required">
358 <td align="right"><label for="menugracelogins"><?php print_string('auth_ldap_gracelogins_key','auth') ?></label></td>
359 <td>
360 <?php choose_from_menu($yesno, 'gracelogins', $config->gracelogins, ''); ?>
361 </td>
362 <td>
363 <?php print_string('auth_ldap_gracelogins_desc','auth') ?>
364 </td>
365 </tr>
367 <tr valign="top" class="required">
368 <td align="right"><label for="graceattr"><?php print_string('auth_ldap_gracelogin_key','auth') ?></label></td>
369 <td>
370 <input name="graceattr" id="graceattr" type="text" size="30" value="<?php echo $config->graceattr?>" />
371 <?php if (isset($err['graceattr'])) formerr($err['graceattr']);
373 </td>
374 <td>
375 <?php print_string('auth_ldap_graceattr_desc','auth') ?>
376 </td>
377 </tr>
381 <tr>
382 <td colspan="2">
383 <h4><?php print_string('auth_user_create', 'auth') ?> </h4>
384 </td>
385 </tr>
387 <tr valign="top">
388 <td align="right"><label for="menuauth_user_create"><?php print_string('auth_ldap_auth_user_create_key','auth') ?></label></td>
389 <td>
390 <?php choose_from_menu($yesno, 'auth_user_create', $config->auth_user_create, ''); ?>
391 </td>
392 <td>
393 <?php print_string("auth_user_creation","auth"); ?>
394 </td>
395 </tr>
397 <tr valign="top" class="required">
398 <td align="right"><label for="create_context"><?php print_string('auth_ldap_create_context_key','auth') ?></label></td>
399 <td>
400 <input name="create_context" id="create_context" type="text" size="30" value="<?php echo $config->create_context?>" />
401 <?php if (isset($err['create_context'])) formerr($err['create_context']); ?>
402 </td><td>
403 <?php print_string('auth_ldap_create_context','auth') ?>
404 </td>
405 </tr>
408 <tr>
409 <td colspan="2">
410 <h4><?php print_string('coursecreators') ?> </h4>
411 </td>
412 </tr>
414 <tr valign="top" class="required">
415 <td align="right"><label for="creators"><?php print_string('auth_ldap_creators_key','auth') ?></label></td>
416 <td>
417 <input name="creators" id="creators" type="text" size="30" value="<?php echo $config->creators?>" />
418 <?php if (isset($err['creators'])) formerr($err['creators']); ?>
419 </td><td>
420 <?php print_string('auth_ldap_creators','auth') ?>
421 </td>
422 </tr>
424 <tr>
425 <td colspan="2">
426 <h4><?php print_string('auth_sync_script', 'auth') ?> </h4>
427 </td>
428 </tr>
430 <tr valign="top">
431 <td align="right"><label for="menuremoveuser"><?php print_string('auth_remove_user_key','auth') ?></label></td>
432 <td>
433 <?php
434 $deleteopt = array();
435 $deleteopt['0'] = get_string('auth_remove_keep','auth');
436 $deleteopt['1'] = get_string('auth_remove_suspend','auth');
437 $deleteopt['2'] = get_string('auth_remove_delete','auth');
438 choose_from_menu($deleteopt, 'removeuser', $config->removeuser, '');
440 </td>
441 <td>
442 <?php print_string('auth_remove_user','auth') ?>
443 </td>
444 </tr>
446 <tr>
447 <td colspan="2">
448 <h4><?php print_string('auth_ntlmsso', 'auth') ?> </h4>
449 </td>
450 </tr>
452 <tr valign="top">
453 <td align="right"><label for="menuntlmsso_enabled"><?php print_string('auth_ntlmsso_enabled_key','auth') ?></label></td>
454 <td>
455 <?php
456 choose_from_menu($yesno, 'ntlmsso_enabled', $config->ntlmsso_enabled, '0');
458 </td>
459 <td>
460 <?php print_string('auth_ntlmsso_enabled','auth') ?>
461 </td>
462 </tr>
463 <tr valign="top">
464 <td align="right"><label for="ntlmsso_subnet"><?php print_string('auth_ntlmsso_subnet_key','auth') ?></label></td>
465 <td><input name="ntlmsso_subnet" id="ntlmsso_subnet" type="text" size="30" value="<?php p($config->ntlmsso_subnet) ?>" />
466 </td>
467 <td>
468 <?php print_string('auth_ntlmsso_subnet','auth') ?>
469 </td>
470 </tr>
472 <?php
474 $help = get_string('auth_ldapextrafields','auth');
475 $help .= get_string('auth_updatelocal_expl','auth');
476 $help .= get_string('auth_fieldlock_expl','auth');
477 $help .= get_string('auth_updateremote_expl','auth');
478 $help .= '<hr />';
479 $help .= get_string('auth_updateremote_ldap','auth');
481 print_auth_lock_options('ldap', $user_fields, $help, true, true);
485 </table>