update enrol/database to use roles.
[moodle.git] / enrol / ldap / config.html
CommitLineData
64031bbb 1<?php // initialize variables
2
64031bbb 3// general
5a0345c2 4if (!isset ($frm->enrol_ldap_host_url)) {
5 $frm->enrol_ldap_host_url = '';
6}
7if (!isset ($frm->enrol_ldap_version )) {
8 $frm->enrol_ldap_version = '';
9}
10if (!isset ($frm->enrol_ldap_bind_dn)) {
11 $frm->enrol_ldap_bind_dn = '';
12}
13if (!isset ($frm->enrol_ldap_bind_pw)) {
14 $frm->enrol_ldap_bind_pw = '';
15}
16if (!isset ($frm->enrol_ldap_search_sub)) {
17 $frm->enrol_ldap_search_sub = '0';
18}
64031bbb 19// student & teacher enrol
5a0345c2 20if (!isset ($frm->enrol_ldap_student_contexts)) {
21 $frm->enrol_ldap_student_contexts = '';
22}
23if (!isset ($frm->enrol_ldap_student_memberattribute)) {
24 $frm->enrol_ldap_student_memberattribute = '';
25}
26if (!isset ($frm->enrol_ldap_teacher_contexts)) {
27 $frm->enrol_ldap_teacher_contexts = '';
28}
29if (!isset ($frm->enrol_ldap_teacher_memberattribute)) {
30 $frm->enrol_ldap_teacher_memberattribute = '';
31}
32if (!isset ($frm->enrol_ldap_objectclass)) {
33 $frm->enrol_ldap_objectclass = '';
34}
35if (!isset ($frm->enrol_ldap_course_idnumber_updatelocal)) {
36 $frm->enrol_ldap_course_idnumber_updatelocal = '';
37}
64031bbb 38// fields
5a0345c2 39if (!isset ($frm->enrol_ldap_course_idnumber)) {
40 $frm->enrol_ldap_course_idnumber = '';
41}
42if (!isset ($frm->enrol_ldap_course_idnumber_updatelocal)) {
43 $frm->enrol_ldap_course_idnumber_updatelocal = false;
44}
45if (!isset ($frm->enrol_ldap_course_idnumber_editlock)) {
46 $frm->enrol_ldap_course_idnumber_editlock = false;
47}
48if (!isset ($frm->enrol_ldap_course_fullname)) {
49 $frm->enrol_ldap_course_fullname = '';
50}
51if (!isset ($frm->enrol_ldap_course_fullname_updatelocal)) {
52 $frm->enrol_ldap_course_fullname_updatelocal = false;
53}
54if (!isset ($frm->enrol_ldap_course_fullname_editlock)) {
55 $frm->enrol_ldap_course_fullname_editlock = false;
56}
57if (!isset ($frm->enrol_ldap_course_shortname)) {
58 $frm->enrol_ldap_course_shortname = '';
59 }
60if (!isset ($frm->enrol_ldap_course_shortname_updatelocal)) {
61 $frm->enrol_ldap_course_shortname_updatelocal = false;
62}
63if (!isset ($frm->enrol_ldap_course_shortname_editlock)) {
64 $frm->enrol_ldap_course_shortname_editlock = false;
65}
66if (!isset ($frm->enrol_ldap_course_summary)) {
67 $frm->enrol_ldap_course_summary = '';
68}
69if (!isset ($frm->enrol_ldap_course_summary_updatelocal)) {
70 $frm->enrol_ldap_course_summary_updatelocal = false;
71}
72if (!isset ($frm->enrol_ldap_course_summary_editlock)) {
73 $frm->enrol_ldap_course_summary_editlock = false;
74}
64031bbb 75// autocreate
f9667a5a 76optional_variable($frm->enrol_ldap_autocreate, false);
77optional_variable($frm->enrol_ldap_category, 1);
78optional_variable($frm->enrol_ldap_template, '');
79
64031bbb 80?>
81
82<table cellspacing="0" cellpadding="5" border="0" align="center">
83<tr>
84 <td colspan="2">
85 <h4><?php print_string("enrol_ldap_server_settings", "enrol_ldap") ?> </h4>
86 </td>
87</tr>
210eddc7 88<tr valign="top">
894ff63f 89 <td align="right">enrol_ldap_host_url:</td>
90 <td>
64031bbb 91 <input name="enrol_ldap_host_url" TYPE="text" SIZE="30" value="<?php echo $frm->enrol_ldap_host_url?>">
894ff63f 92 <?php if (isset($err["enrol_ldap_host_url"])) formerr($err["enrol_ldap_host_url"]); ?>
93 </td>
64031bbb 94 <td>
95 <?php print_string("enrol_ldap_host_url","enrol_ldap") ?>
96 </td>
97</tr>
210eddc7 98<tr valign="top">
894ff63f 99 <td align="right">enrol_ldap_version:</td>
100 <td>
64031bbb 101 <?php
102 $versions[2] = "2";
103 $versions[3] = "3";
104 choose_from_menu($versions, "enrol_ldap_version", $frm->enrol_ldap_version, "");
894ff63f 105 if (isset($err["enrol_ldap_version"])) formerr($err["enrol_ldap_version"]);
64031bbb 106 ?>
894ff63f 107 </td>
64031bbb 108 <td>
109 <?php print_string("enrol_ldap_version","enrol_ldap") ?>
110 </td>
111</tr>
112
210eddc7 113<tr valign="top">
114 <td align="right">enrol_ldap_bind_dn:</td>
64031bbb 115 <td>
116 <input name="enrol_ldap_bind_dn" type="text" size="30" value="<?php echo $frm->enrol_ldap_bind_dn?>">
117 <?php if (isset($err["enrol_ldap_bind_dn"])) formerr($err["ldap_bind_dn"]); ?>
118 </td><td>
119 <?php print_string("enrol_ldap_bind_dn","enrol_ldap") ?>
120 </td>
121</tr>
122
210eddc7 123<tr valign="top">
124 <td align="right">ldap_bind_pw:</td>
64031bbb 125 <td>
126 <input name="enrol_ldap_bind_pw" type="text" size="30" value="<?php echo $frm->enrol_ldap_bind_pw?>">
127 <?php if (isset($err["enrol_ldap_bind_pw"])) formerr($err["enrol_ldap_bind_pw"]); ?>
128 </td><td>
129 <?php print_string("enrol_ldap_bind_pw","enrol_ldap") ?>
130 </td>
131</tr>
132
bdf09a84 133<tr valign="top">
134 <td align="right">ldap_search_sub:</td>
135 <td>
136<?php
1007a3f1 137 $choices = array();
bdf09a84 138 $choices["0"] = get_string("no");
139 $choices["1"] = get_string("yes");
1007a3f1 140 choose_from_menu ($choices, "enrol_ldap_search_sub", $frm->enrol_ldap_search_sub, "");
bdf09a84 141?>
142 <?php if (isset($err["enrol_ldap_search_sub"])) formerr($err["enrol_ldap_search_sub"]); ?>
143 </td><td>
144 <?php print_string("enrol_ldap_search_sub","enrol_ldap") ?>
145 </td>
146</tr>
147
64031bbb 148<tr>
149 <td colspan="2">
150 <h4><?php print_string("enrol_ldap_student_settings", "enrol_ldap") ?> </h4>
151 </td>
152</tr>
210eddc7 153<tr valign="top">
894ff63f 154 <td align="right">enrol_ldap_student_contexts:</td>
155 <td>
64031bbb 156 <input name="enrol_ldap_student_contexts" TYPE="text" SIZE="30 "value="<?php echo $frm->enrol_ldap_student_contexts?>">
157 <?php if (isset($err["enrol_ldap_student_contexts"])) formerr($err["enrol_ldap_student_contexts"]); ?>
158 </td>
159 <td>
160 <?php print_string("enrol_ldap_student_contexts","enrol_ldap") ?>
161 </td>
162</tr>
210eddc7 163<tr valign="top">
164 <td align="right">enrol_ldap_student_memberattribute:</td>
64031bbb 165 <td>
166 <input name="enrol_ldap_student_memberattribute" type="text" size="30" value="<?php echo $frm->enrol_ldap_student_memberattribute?>">
167 <?php if (isset($err["enrol_ldap_student_memberattribute"])) formerr($err["enrol_ldap_student_memberattribute"]); ?>
168 </td><td>
169 <?php print_string("enrol_ldap_student_memberattribute","enrol_ldap") ?>
170 </td>
171</tr>
172
173<tr>
174 <td colspan="2">
175 <h4><?php print_string("enrol_ldap_teacher_settings", "enrol_ldap") ?> </h4>
176 </td>
177</tr>
210eddc7 178<tr valign="top">
894ff63f 179 <td align="right">enrol_ldap_teacher_contexts:</td>
180 <td>
64031bbb 181 <input name="enrol_ldap_teacher_contexts" TYPE="text" SIZE="30 "value="<?php echo $frm->enrol_ldap_teacher_contexts?>">
182 <?php if (isset($err["enrol_ldap_teacher_contexts"])) formerr($err["enrol_ldap_teacher_contexts"]); ?>
183 </td>
184 <td>
185 <?php print_string("enrol_ldap_teacher_contexts","enrol_ldap") ?>
186 </td>
187</tr>
210eddc7 188<tr valign="top">
189 <td align="right">enrol_ldap_teacher_memberattribute:</td>
64031bbb 190 <td>
191 <input name="enrol_ldap_teacher_memberattribute" type="text" size="30" value="<?php echo $frm->enrol_ldap_teacher_memberattribute?>">
192 <?php if (isset($err["enrol_ldap_teacher_memberattribute"])) formerr($err["enrol_ldap_teacher_memberattribute"]); ?>
193 </td><td>
194 <?php print_string("enrol_ldap_teacher_memberattribute","enrol_ldap") ?>
195 </td>
196</tr>
197
198<tr>
199 <td colspan="2">
200 <h4><?php print_string("enrol_ldap_course_settings", "enrol_ldap") ?> </h4>
201 </td>
202</tr>
210eddc7 203<tr valign="top">
204 <td align="right">enrol_ldap_objectclass:</td>
64031bbb 205 <td>
206 <input name=enrol_ldap_objectclass type="text" size="30" value="<?php echo $frm->enrol_ldap_objectclass?>">
207 <?php if (isset($err["enrol_ldap_objectclass"])) formerr($err["enrol_ldap_objectclass"]); ?>
208 </td>
209 <td>
210 <?php print_string("enrol_ldap_objectclass","enrol_ldap") ?>
211 </td>
212</tr>
210eddc7 213<tr valign="top">
214 <td align="right">enrol_ldap_course_idnumber:</td>
64031bbb 215 <td>
216 <input name="enrol_ldap_course_idnumber" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_idnumber?>">
217 <?php if (isset($err["enrol_ldap_course_idnumber"])) formerr($err["enrol_ldap_course_idnumber"]); ?>
218 <div align="right">
219 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
220 <select name="enrol_ldap_course_idnumber_updatelocal">
221 <option value="0" <?php echo ($frm->enrol_ldap_course_idnumber_updatelocal ? '' : 'selected="yes"') ?> >
222 <?php print_string("no") ?></option>
223 <option value="1" <?php echo ($frm->enrol_ldap_course_idnumber_updatelocal ? 'selected="yes"' : '') ?> >
224 <?php print_string("yes") ?></option>
225 </select><BR>
226 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
227 <select name="enrol_ldap_course_idnumber_editlock">
228 <option value="0" <?php echo ($frm->enrol_ldap_course_idnumber_editlock ? '' : 'selected="yes"') ?> >
229 <?php print_string("no") ?></option>
230 <option value="1" <?php echo ($frm->enrol_ldap_course_idnumber_editlock ? 'selected="yes"' : '') ?> >
231 <?php print_string("yes") ?></option>
232 </select></div>
233 </td><td>
234 <?php print_string("enrol_ldap_course_idnumber","enrol_ldap") ?>
235 </td>
236</tr>
210eddc7 237<tr valign="top">
238 <td align="right">enrol_ldap_course_shortname:</td>
64031bbb 239 <td>
240 <input name="enrol_ldap_course_shortname" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_shortname?>">
241 <?php if (isset($err["enrol_ldap_course_shortname"])) formerr($err["enrol_ldap_course_shortname"]); ?>
242 <div align="right">
243 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
244 <select name="enrol_ldap_course_shortname_updatelocal">
245 <option value="0" <?php echo ($frm->enrol_ldap_course_shortname_updatelocal ? '' : 'selected="yes"') ?> >
246 <?php print_string("no") ?></option>
247 <option value="1" <?php echo ($frm->enrol_ldap_course_shortname_updatelocal ? 'selected="yes"' : '') ?> >
248 <?php print_string("yes") ?></option>
249 </select><BR>
250 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
251 <select name="enrol_ldap_course_shortname_editlock">
252 <option value="0" <?php echo ($frm->enrol_ldap_course_shortname_editlock ? '' : 'selected="yes"') ?> >
253 <?php print_string("no") ?></option>
254 <option value="1" <?php echo ($frm->enrol_ldap_course_shortname_editlock ? 'selected="yes"' : '') ?> >
255 <?php print_string("yes") ?></option>
256 </select></div>
257 </td><td>
258 <?php print_string("enrol_ldap_course_shortname","enrol_ldap") ?>
259 </td>
260</tr>
261
210eddc7 262<tr valign="top">
263 <td align="right">enrol_ldap_course_fullname:</td>
64031bbb 264 <td>
265 <input name="enrol_ldap_course_fullname" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_fullname ?>">
266 <?php if (isset($err["enrol_ldap_course_fullname"])) formerr($err["enrol_ldap_course_fullname"]); ?>
267 <div align="right">
268 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
269 <select name="enrol_ldap_course_fullname_updatelocal">
270 <option value="0" <?php echo ($frm->enrol_ldap_course_fullname_updatelocal ? '' : 'selected="yes"') ?> >
271 <?php print_string("no") ?></option>
272 <option value="1" <?php echo ($frm->enrol_ldap_course_fullname_updatelocal ? 'selected="yes"' : '') ?> >
273 <?php print_string("yes") ?></option>
274 </select><BR>
275 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
276 <select name="enrol_ldap_course_idnumber_editlock">
277 <option value="0" <?php echo ($frm->enrol_ldap_course_fullname_editlock ? '' : 'selected="yes"') ?> >
278 <?php print_string("no") ?></option>
279 <option value="1" <?php echo ($frm->enrol_ldap_course_fullname_editlock ? 'selected="yes"' : '') ?> >
280 <?php print_string("yes") ?></option>
281 </select></div>
282 </td><td>
283 <?php print_string("enrol_ldap_course_fullname","enrol_ldap") ?>
284 </td>
285</tr>
286
210eddc7 287<tr valign="top">
288 <td align="right">enrol_ldap_course_summary:</td>
64031bbb 289 <td>
290 <input name="enrol_ldap_course_summary" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_summary?>">
291 <?php if (isset($err["enrol_ldap_course_summary"])) formerr($err["enrol_ldap_course_summary"]); ?>
292 <div align="right">
293 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
294 <select name="enrol_ldap_course_summary_updatelocal">
295 <option value="0" <?php echo ($frm->enrol_ldap_course_summary_updatelocal ? '' : 'selected="yes"') ?> >
296 <?php print_string("no") ?></option>
297 <option value="1" <?php echo ($frm->enrol_ldap_course_summary_updatelocal ? 'selected="yes"' : '') ?> >
298 <?php print_string("yes") ?></option>
299 </select><BR>
300 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
301 <select name="enrol_ldap_course_summary_editlock">
302 <option value="0" <?php echo ($frm->enrol_ldap_course_summary_editlock ? '' : 'selected="yes"') ?> >
303 <?php print_string("no") ?></option>
304 <option value="1" <?php echo ($frm->enrol_ldap_course_summary_editlock ? 'selected="yes"' : '') ?> >
305 <?php print_string("yes") ?></option>
306 </select></div>
307 </td><td>
308 <?php print_string("enrol_ldap_course_summary","enrol_ldap") ?>
309 </td>
310</tr>
311
312<tr>
313 <td colspan="2">
314 <h4><?php print_string("enrol_ldap_autocreation_settings", "enrol_ldap") ?> </h4>
315 </td>
316</tr>
210eddc7 317<tr valign="top">
894ff63f 318 <td align="right">enrol_ldap_autocreate:</td>
319 <td>
64031bbb 320 <?php
321 choose_from_menu(array('0'=>'no','1'=>'yes'), "enrol_ldap_autocreate", $frm->enrol_ldap_autocreate, "");
894ff63f 322 if (isset($err["enrol_ldap_autocreate"])) formerr($err["enrol_ldap_autocreate"]);
64031bbb 323 ?>
894ff63f 324 </td>
64031bbb 325 <td>
326 <?php print_string("enrol_ldap_autocreate","enrol_ldap") ?>
327 </td>
328</tr>
210eddc7 329<tr valign="top">
330 <td align="right">enrol_ldap_category:</td>
64031bbb 331 <td>
332 <?php
333 $displaylist = array();
334 $parentlist = array();
335 make_categories_list($displaylist, $parentlist);
336 choose_from_menu($displaylist, "enrol_ldap_category", $frm->enrol_ldap_category, "");
337
338 ?>
339 <?php if (isset($err["enrol_ldap_category"])) formerr($err["enrol_ldap_category"]); ?>
340 </td><td>
341 <?php print_string("enrol_ldap_category","enrol_ldap") ?>
342 </td>
343</tr>
344
210eddc7 345<tr valign="top">
346 <td align="right">enrol_ldap_template:</td>
64031bbb 347 <td>
348 <input name=enrol_ldap_template type="text" size="30" value="<?php echo $frm->enrol_ldap_template?>">
349 <?php if (isset($err["enrol_ldap_template"])) formerr($err["enrol_ldap_template"]); ?>
350 </td><td>
351 <?php print_string("enrol_ldap_template","enrol_ldap") ?>
352 </td>
353</tr>
354
f7d18493 355<tr>
356 <td colspan="2">
357 <h4><?php print_string("enrol_ldap_general_options", "enrol_ldap") ?> </h4>
358 </td>
359</tr>
360
64031bbb 361</table>