MDL-8029 obsoleted html_entity_decode() and file_get_contents() emulation removed...
[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}
5a0345c2 19if (!isset ($frm->enrol_ldap_objectclass)) {
20 $frm->enrol_ldap_objectclass = '';
21}
22if (!isset ($frm->enrol_ldap_course_idnumber_updatelocal)) {
23 $frm->enrol_ldap_course_idnumber_updatelocal = '';
24}
64031bbb 25// fields
5a0345c2 26if (!isset ($frm->enrol_ldap_course_idnumber)) {
27 $frm->enrol_ldap_course_idnumber = '';
28}
29if (!isset ($frm->enrol_ldap_course_idnumber_updatelocal)) {
30 $frm->enrol_ldap_course_idnumber_updatelocal = false;
31}
32if (!isset ($frm->enrol_ldap_course_idnumber_editlock)) {
33 $frm->enrol_ldap_course_idnumber_editlock = false;
34}
35if (!isset ($frm->enrol_ldap_course_fullname)) {
36 $frm->enrol_ldap_course_fullname = '';
37}
38if (!isset ($frm->enrol_ldap_course_fullname_updatelocal)) {
39 $frm->enrol_ldap_course_fullname_updatelocal = false;
40}
41if (!isset ($frm->enrol_ldap_course_fullname_editlock)) {
42 $frm->enrol_ldap_course_fullname_editlock = false;
43}
44if (!isset ($frm->enrol_ldap_course_shortname)) {
45 $frm->enrol_ldap_course_shortname = '';
87c75906 46}
5a0345c2 47if (!isset ($frm->enrol_ldap_course_shortname_updatelocal)) {
48 $frm->enrol_ldap_course_shortname_updatelocal = false;
49}
50if (!isset ($frm->enrol_ldap_course_shortname_editlock)) {
51 $frm->enrol_ldap_course_shortname_editlock = false;
52}
53if (!isset ($frm->enrol_ldap_course_summary)) {
54 $frm->enrol_ldap_course_summary = '';
55}
56if (!isset ($frm->enrol_ldap_course_summary_updatelocal)) {
57 $frm->enrol_ldap_course_summary_updatelocal = false;
58}
59if (!isset ($frm->enrol_ldap_course_summary_editlock)) {
60 $frm->enrol_ldap_course_summary_editlock = false;
61}
87c75906 62
63// Roles
64$roles = get_records('role');
65foreach($roles as $role) {
66 if (!isset($frm->{'enrol_ldap_contexts_role'.$role->id})) {
67 $frm->{'enrol_ldap_contexts_role'.$role->id} = '';
68 }
69
70 if (!isset($frm->{'enrol_ldap_memberattribute_role'.$role->id})) {
71 $frm->{'enrol_ldap_memberattribute_role'.$role->id} = '';
72 }
73}
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
87c75906 148<?php /*
64031bbb 149<tr>
150 <td colspan="2">
151 <h4><?php print_string("enrol_ldap_student_settings", "enrol_ldap") ?> </h4>
152 </td>
153</tr>
210eddc7 154<tr valign="top">
894ff63f 155 <td align="right">enrol_ldap_student_contexts:</td>
156 <td>
64031bbb 157 <input name="enrol_ldap_student_contexts" TYPE="text" SIZE="30 "value="<?php echo $frm->enrol_ldap_student_contexts?>">
158 <?php if (isset($err["enrol_ldap_student_contexts"])) formerr($err["enrol_ldap_student_contexts"]); ?>
159 </td>
160 <td>
161 <?php print_string("enrol_ldap_student_contexts","enrol_ldap") ?>
162 </td>
163</tr>
210eddc7 164<tr valign="top">
165 <td align="right">enrol_ldap_student_memberattribute:</td>
64031bbb 166 <td>
167 <input name="enrol_ldap_student_memberattribute" type="text" size="30" value="<?php echo $frm->enrol_ldap_student_memberattribute?>">
168 <?php if (isset($err["enrol_ldap_student_memberattribute"])) formerr($err["enrol_ldap_student_memberattribute"]); ?>
169 </td><td>
170 <?php print_string("enrol_ldap_student_memberattribute","enrol_ldap") ?>
171 </td>
172</tr>
173
174<tr>
175 <td colspan="2">
176 <h4><?php print_string("enrol_ldap_teacher_settings", "enrol_ldap") ?> </h4>
177 </td>
178</tr>
210eddc7 179<tr valign="top">
894ff63f 180 <td align="right">enrol_ldap_teacher_contexts:</td>
181 <td>
64031bbb 182 <input name="enrol_ldap_teacher_contexts" TYPE="text" SIZE="30 "value="<?php echo $frm->enrol_ldap_teacher_contexts?>">
183 <?php if (isset($err["enrol_ldap_teacher_contexts"])) formerr($err["enrol_ldap_teacher_contexts"]); ?>
184 </td>
185 <td>
186 <?php print_string("enrol_ldap_teacher_contexts","enrol_ldap") ?>
187 </td>
188</tr>
210eddc7 189<tr valign="top">
190 <td align="right">enrol_ldap_teacher_memberattribute:</td>
64031bbb 191 <td>
192 <input name="enrol_ldap_teacher_memberattribute" type="text" size="30" value="<?php echo $frm->enrol_ldap_teacher_memberattribute?>">
193 <?php if (isset($err["enrol_ldap_teacher_memberattribute"])) formerr($err["enrol_ldap_teacher_memberattribute"]); ?>
194 </td><td>
195 <?php print_string("enrol_ldap_teacher_memberattribute","enrol_ldap") ?>
196 </td>
197</tr>
87c75906 198*/ ?>
199
200<tr>
201 <td colspan="2">
202 <h4><?php print_string('enrol_ldap_roles', 'enrol_ldap'); ?></h4>
203 </td>
204</tr>
205<tr>
206 <td colspan="3">
207 <table>
208 <tr>
209 <th><?php print_string('role_name', 'enrol_ldap'); ?></th>
210 <th><?php print_string('enrol_ldap_contexts', 'enrol_ldap'); ?></th>
211 <th><?php print_string('enrol_ldap_memberattribute', 'enrol_ldap'); ?></th>
212 </tr>
213<?php foreach ($roles as $role): ?>
214 <tr>
215 <td><?php echo htmlspecialchars($role->name, ENT_COMPAT, 'UTF-8'); ?></td>
216 <td><input type="text" size="30" name="enrol_ldap_contexts_role<?php echo $role->id; ?>" value="<?php echo htmlspecialchars($frm->{'enrol_ldap_contexts_role'.$role->id}); ?>" /></td>
217 <td><input type="text" size="30" name="enrol_ldap_memberattribute_role<?php echo $role->id; ?>" value="<?php echo htmlspecialchars($frm->{'enrol_ldap_memberattribute_role'.$role->id}); ?>" /></td>
218 </tr>
219<?php endforeach; ?>
220 </table>
221 </td>
222</tr>
64031bbb 223
224<tr>
225 <td colspan="2">
226 <h4><?php print_string("enrol_ldap_course_settings", "enrol_ldap") ?> </h4>
227 </td>
228</tr>
210eddc7 229<tr valign="top">
230 <td align="right">enrol_ldap_objectclass:</td>
64031bbb 231 <td>
232 <input name=enrol_ldap_objectclass type="text" size="30" value="<?php echo $frm->enrol_ldap_objectclass?>">
233 <?php if (isset($err["enrol_ldap_objectclass"])) formerr($err["enrol_ldap_objectclass"]); ?>
234 </td>
235 <td>
236 <?php print_string("enrol_ldap_objectclass","enrol_ldap") ?>
237 </td>
238</tr>
210eddc7 239<tr valign="top">
240 <td align="right">enrol_ldap_course_idnumber:</td>
64031bbb 241 <td>
242 <input name="enrol_ldap_course_idnumber" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_idnumber?>">
243 <?php if (isset($err["enrol_ldap_course_idnumber"])) formerr($err["enrol_ldap_course_idnumber"]); ?>
244 <div align="right">
245 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
246 <select name="enrol_ldap_course_idnumber_updatelocal">
247 <option value="0" <?php echo ($frm->enrol_ldap_course_idnumber_updatelocal ? '' : 'selected="yes"') ?> >
248 <?php print_string("no") ?></option>
249 <option value="1" <?php echo ($frm->enrol_ldap_course_idnumber_updatelocal ? 'selected="yes"' : '') ?> >
250 <?php print_string("yes") ?></option>
251 </select><BR>
252 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
253 <select name="enrol_ldap_course_idnumber_editlock">
254 <option value="0" <?php echo ($frm->enrol_ldap_course_idnumber_editlock ? '' : 'selected="yes"') ?> >
255 <?php print_string("no") ?></option>
256 <option value="1" <?php echo ($frm->enrol_ldap_course_idnumber_editlock ? 'selected="yes"' : '') ?> >
257 <?php print_string("yes") ?></option>
258 </select></div>
259 </td><td>
260 <?php print_string("enrol_ldap_course_idnumber","enrol_ldap") ?>
261 </td>
262</tr>
210eddc7 263<tr valign="top">
264 <td align="right">enrol_ldap_course_shortname:</td>
64031bbb 265 <td>
266 <input name="enrol_ldap_course_shortname" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_shortname?>">
267 <?php if (isset($err["enrol_ldap_course_shortname"])) formerr($err["enrol_ldap_course_shortname"]); ?>
268 <div align="right">
269 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
270 <select name="enrol_ldap_course_shortname_updatelocal">
271 <option value="0" <?php echo ($frm->enrol_ldap_course_shortname_updatelocal ? '' : 'selected="yes"') ?> >
272 <?php print_string("no") ?></option>
273 <option value="1" <?php echo ($frm->enrol_ldap_course_shortname_updatelocal ? 'selected="yes"' : '') ?> >
274 <?php print_string("yes") ?></option>
275 </select><BR>
276 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
277 <select name="enrol_ldap_course_shortname_editlock">
278 <option value="0" <?php echo ($frm->enrol_ldap_course_shortname_editlock ? '' : 'selected="yes"') ?> >
279 <?php print_string("no") ?></option>
280 <option value="1" <?php echo ($frm->enrol_ldap_course_shortname_editlock ? 'selected="yes"' : '') ?> >
281 <?php print_string("yes") ?></option>
282 </select></div>
283 </td><td>
284 <?php print_string("enrol_ldap_course_shortname","enrol_ldap") ?>
285 </td>
286</tr>
287
210eddc7 288<tr valign="top">
289 <td align="right">enrol_ldap_course_fullname:</td>
64031bbb 290 <td>
291 <input name="enrol_ldap_course_fullname" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_fullname ?>">
292 <?php if (isset($err["enrol_ldap_course_fullname"])) formerr($err["enrol_ldap_course_fullname"]); ?>
293 <div align="right">
294 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
295 <select name="enrol_ldap_course_fullname_updatelocal">
296 <option value="0" <?php echo ($frm->enrol_ldap_course_fullname_updatelocal ? '' : 'selected="yes"') ?> >
297 <?php print_string("no") ?></option>
298 <option value="1" <?php echo ($frm->enrol_ldap_course_fullname_updatelocal ? 'selected="yes"' : '') ?> >
299 <?php print_string("yes") ?></option>
300 </select><BR>
301 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
302 <select name="enrol_ldap_course_idnumber_editlock">
303 <option value="0" <?php echo ($frm->enrol_ldap_course_fullname_editlock ? '' : 'selected="yes"') ?> >
304 <?php print_string("no") ?></option>
305 <option value="1" <?php echo ($frm->enrol_ldap_course_fullname_editlock ? 'selected="yes"' : '') ?> >
306 <?php print_string("yes") ?></option>
307 </select></div>
308 </td><td>
309 <?php print_string("enrol_ldap_course_fullname","enrol_ldap") ?>
310 </td>
311</tr>
312
210eddc7 313<tr valign="top">
314 <td align="right">enrol_ldap_course_summary:</td>
64031bbb 315 <td>
316 <input name="enrol_ldap_course_summary" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_summary?>">
317 <?php if (isset($err["enrol_ldap_course_summary"])) formerr($err["enrol_ldap_course_summary"]); ?>
318 <div align="right">
319 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
320 <select name="enrol_ldap_course_summary_updatelocal">
321 <option value="0" <?php echo ($frm->enrol_ldap_course_summary_updatelocal ? '' : 'selected="yes"') ?> >
322 <?php print_string("no") ?></option>
323 <option value="1" <?php echo ($frm->enrol_ldap_course_summary_updatelocal ? 'selected="yes"' : '') ?> >
324 <?php print_string("yes") ?></option>
325 </select><BR>
326 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
327 <select name="enrol_ldap_course_summary_editlock">
328 <option value="0" <?php echo ($frm->enrol_ldap_course_summary_editlock ? '' : 'selected="yes"') ?> >
329 <?php print_string("no") ?></option>
330 <option value="1" <?php echo ($frm->enrol_ldap_course_summary_editlock ? 'selected="yes"' : '') ?> >
331 <?php print_string("yes") ?></option>
332 </select></div>
333 </td><td>
334 <?php print_string("enrol_ldap_course_summary","enrol_ldap") ?>
335 </td>
336</tr>
337
338<tr>
339 <td colspan="2">
340 <h4><?php print_string("enrol_ldap_autocreation_settings", "enrol_ldap") ?> </h4>
341 </td>
342</tr>
210eddc7 343<tr valign="top">
894ff63f 344 <td align="right">enrol_ldap_autocreate:</td>
345 <td>
64031bbb 346 <?php
347 choose_from_menu(array('0'=>'no','1'=>'yes'), "enrol_ldap_autocreate", $frm->enrol_ldap_autocreate, "");
894ff63f 348 if (isset($err["enrol_ldap_autocreate"])) formerr($err["enrol_ldap_autocreate"]);
64031bbb 349 ?>
894ff63f 350 </td>
64031bbb 351 <td>
352 <?php print_string("enrol_ldap_autocreate","enrol_ldap") ?>
353 </td>
354</tr>
210eddc7 355<tr valign="top">
356 <td align="right">enrol_ldap_category:</td>
64031bbb 357 <td>
358 <?php
359 $displaylist = array();
360 $parentlist = array();
361 make_categories_list($displaylist, $parentlist);
362 choose_from_menu($displaylist, "enrol_ldap_category", $frm->enrol_ldap_category, "");
363
364 ?>
365 <?php if (isset($err["enrol_ldap_category"])) formerr($err["enrol_ldap_category"]); ?>
366 </td><td>
367 <?php print_string("enrol_ldap_category","enrol_ldap") ?>
368 </td>
369</tr>
370
210eddc7 371<tr valign="top">
372 <td align="right">enrol_ldap_template:</td>
64031bbb 373 <td>
374 <input name=enrol_ldap_template type="text" size="30" value="<?php echo $frm->enrol_ldap_template?>">
375 <?php if (isset($err["enrol_ldap_template"])) formerr($err["enrol_ldap_template"]); ?>
376 </td><td>
377 <?php print_string("enrol_ldap_template","enrol_ldap") ?>
378 </td>
379</tr>
380
f7d18493 381<tr>
382 <td colspan="2">
383 <h4><?php print_string("enrol_ldap_general_options", "enrol_ldap") ?> </h4>
384 </td>
385</tr>
386
64031bbb 387</table>