Added check for <text> fields that contain markup (an error!)
[moodle-linuxchix.git] / enrol / ldap / config.html
blob4aedf992391b4b20796490bec1511ae442761372
1 <?php // initialize variables
3 // general
4 if (!isset ($frm->enrol_ldap_host_url)) {
5 $frm->enrol_ldap_host_url = '';
7 if (!isset ($frm->enrol_ldap_version )) {
8 $frm->enrol_ldap_version = '';
10 if (!isset ($frm->enrol_ldap_bind_dn)) {
11 $frm->enrol_ldap_bind_dn = '';
13 if (!isset ($frm->enrol_ldap_bind_pw)) {
14 $frm->enrol_ldap_bind_pw = '';
16 if (!isset ($frm->enrol_ldap_search_sub)) {
17 $frm->enrol_ldap_search_sub = '0';
19 if (!isset ($frm->enrol_ldap_objectclass)) {
20 $frm->enrol_ldap_objectclass = '';
22 if (!isset ($frm->enrol_ldap_course_idnumber_updatelocal)) {
23 $frm->enrol_ldap_course_idnumber_updatelocal = '';
25 // fields
26 if (!isset ($frm->enrol_ldap_course_idnumber)) {
27 $frm->enrol_ldap_course_idnumber = '';
29 if (!isset ($frm->enrol_ldap_course_idnumber_updatelocal)) {
30 $frm->enrol_ldap_course_idnumber_updatelocal = false;
32 if (!isset ($frm->enrol_ldap_course_idnumber_editlock)) {
33 $frm->enrol_ldap_course_idnumber_editlock = false;
35 if (!isset ($frm->enrol_ldap_course_fullname)) {
36 $frm->enrol_ldap_course_fullname = '';
38 if (!isset ($frm->enrol_ldap_course_fullname_updatelocal)) {
39 $frm->enrol_ldap_course_fullname_updatelocal = false;
41 if (!isset ($frm->enrol_ldap_course_fullname_editlock)) {
42 $frm->enrol_ldap_course_fullname_editlock = false;
44 if (!isset ($frm->enrol_ldap_course_shortname)) {
45 $frm->enrol_ldap_course_shortname = '';
47 if (!isset ($frm->enrol_ldap_course_shortname_updatelocal)) {
48 $frm->enrol_ldap_course_shortname_updatelocal = false;
50 if (!isset ($frm->enrol_ldap_course_shortname_editlock)) {
51 $frm->enrol_ldap_course_shortname_editlock = false;
53 if (!isset ($frm->enrol_ldap_course_summary)) {
54 $frm->enrol_ldap_course_summary = '';
56 if (!isset ($frm->enrol_ldap_course_summary_updatelocal)) {
57 $frm->enrol_ldap_course_summary_updatelocal = false;
59 if (!isset ($frm->enrol_ldap_course_summary_editlock)) {
60 $frm->enrol_ldap_course_summary_editlock = false;
63 // Roles
64 $roles = get_records('role');
65 foreach($roles as $role) {
66 if (!isset($frm->{'enrol_ldap_contexts_role'.$role->id})) {
67 $frm->{'enrol_ldap_contexts_role'.$role->id} = '';
70 if (!isset($frm->{'enrol_ldap_memberattribute_role'.$role->id})) {
71 $frm->{'enrol_ldap_memberattribute_role'.$role->id} = '';
75 // autocreate
76 if (!isset($frm->enrol_ldap_autocreate)) {
77 $frm->enrol_ldap_autocreate = false;
79 if (!isset($frm->enrol_ldap_category)) {
80 $frm->enrol_ldap_category = 1;
82 if (!isset($frm->enrol_ldap_template)) {
83 $frm->enrol_ldap_template = '';
88 <table cellspacing="0" cellpadding="5" border="0" class="boxaligncenter">
89 <tr>
90 <td colspan="2">
91 <h4><?php print_string("enrol_ldap_server_settings", "enrol_ldap") ?> </h4>
92 </td>
93 </tr>
94 <tr>
95 <td align="right">enrol_ldap_host_url:</td>
96 <td>
97 <input name="enrol_ldap_host_url" type="text" size="30" value="<?php echo $frm->enrol_ldap_host_url?>" />
98 <?php if (isset($err["enrol_ldap_host_url"])) formerr($err["enrol_ldap_host_url"]); ?>
99 </td>
100 <td>
101 <?php print_string("enrol_ldap_host_url","enrol_ldap") ?>
102 </td>
103 </tr>
104 <tr>
105 <td align="right">enrol_ldap_version:</td>
106 <td>
107 <?php
108 $versions[2] = "2";
109 $versions[3] = "3";
110 choose_from_menu($versions, "enrol_ldap_version", $frm->enrol_ldap_version, "");
111 if (isset($err["enrol_ldap_version"])) formerr($err["enrol_ldap_version"]);
113 </td>
114 <td>
115 <?php print_string("enrol_ldap_version","enrol_ldap") ?>
116 </td>
117 </tr>
119 <tr>
120 <td align="right">enrol_ldap_bind_dn:</td>
121 <td>
122 <input name="enrol_ldap_bind_dn" type="text" size="30" value="<?php echo $frm->enrol_ldap_bind_dn?>" />
123 <?php if (isset($err["enrol_ldap_bind_dn"])) formerr($err["ldap_bind_dn"]); ?>
124 </td><td>
125 <?php print_string("enrol_ldap_bind_dn","enrol_ldap") ?>
126 </td>
127 </tr>
129 <tr>
130 <td align="right">ldap_bind_pw:</td>
131 <td>
132 <input name="enrol_ldap_bind_pw" type="password" size="30" value="<?php echo $frm->enrol_ldap_bind_pw?>" />
133 <?php if (isset($err["enrol_ldap_bind_pw"])) formerr($err["enrol_ldap_bind_pw"]); ?>
134 </td><td>
135 <?php print_string("enrol_ldap_bind_pw","enrol_ldap") ?>
136 </td>
137 </tr>
139 <tr>
140 <td align="right">ldap_search_sub:</td>
141 <td>
142 <?php
143 $choices = array();
144 $choices["0"] = get_string("no");
145 $choices["1"] = get_string("yes");
146 choose_from_menu ($choices, "enrol_ldap_search_sub", $frm->enrol_ldap_search_sub, "");
148 <?php if (isset($err["enrol_ldap_search_sub"])) formerr($err["enrol_ldap_search_sub"]); ?>
149 </td><td>
150 <?php print_string("enrol_ldap_search_sub","enrol_ldap") ?>
151 </td>
152 </tr>
154 <?php /*
155 <tr>
156 <td colspan="2">
157 <h4><?php print_string("enrol_ldap_student_settings", "enrol_ldap") ?> </h4>
158 </td>
159 </tr>
160 <tr>
161 <td align="right">enrol_ldap_student_contexts:</td>
162 <td>
163 <input name="enrol_ldap_student_contexts" type="text" SIZE="30 "value="<?php echo $frm->enrol_ldap_student_contexts?>" />
164 <?php if (isset($err["enrol_ldap_student_contexts"])) formerr($err["enrol_ldap_student_contexts"]); ?>
165 </td>
166 <td>
167 <?php print_string("enrol_ldap_student_contexts","enrol_ldap") ?>
168 </td>
169 </tr>
170 <tr>
171 <td align="right">enrol_ldap_student_memberattribute:</td>
172 <td>
173 <input name="enrol_ldap_student_memberattribute" type="text" size="30" value="<?php echo $frm->enrol_ldap_student_memberattribute?>" />
174 <?php if (isset($err["enrol_ldap_student_memberattribute"])) formerr($err["enrol_ldap_student_memberattribute"]); ?>
175 </td><td>
176 <?php print_string("enrol_ldap_student_memberattribute","enrol_ldap") ?>
177 </td>
178 </tr>
180 <tr>
181 <td colspan="2">
182 <h4><?php print_string("enrol_ldap_teacher_settings", "enrol_ldap") ?> </h4>
183 </td>
184 </tr>
185 <tr valign="top">
186 <td align="right">enrol_ldap_teacher_contexts:</td>
187 <td>
188 <input name="enrol_ldap_teacher_contexts" type="text" SIZE="30 "value="<?php echo $frm->enrol_ldap_teacher_contexts?>" />
189 <?php if (isset($err["enrol_ldap_teacher_contexts"])) formerr($err["enrol_ldap_teacher_contexts"]); ?>
190 </td>
191 <td>
192 <?php print_string("enrol_ldap_teacher_contexts","enrol_ldap") ?>
193 </td>
194 </tr>
195 <tr>
196 <td align="right">enrol_ldap_teacher_memberattribute:</td>
197 <td>
198 <input name="enrol_ldap_teacher_memberattribute" type="text" size="30" value="<?php echo $frm->enrol_ldap_teacher_memberattribute?>" />
199 <?php if (isset($err["enrol_ldap_teacher_memberattribute"])) formerr($err["enrol_ldap_teacher_memberattribute"]); ?>
200 </td><td>
201 <?php print_string("enrol_ldap_teacher_memberattribute","enrol_ldap") ?>
202 </td>
203 </tr>
204 */ ?>
206 <tr>
207 <td colspan="2">
208 <h4><?php print_string('enrol_ldap_roles', 'enrol_ldap'); ?></h4>
209 </td>
210 </tr>
211 <tr>
212 <td colspan="3">
213 <table>
214 <tr>
215 <th><?php print_string('roles', 'role'); ?></th>
216 <th><?php print_string('enrol_ldap_contexts', 'enrol_ldap'); ?></th>
217 <th><?php print_string('enrol_ldap_memberattribute', 'enrol_ldap'); ?></th>
218 </tr>
219 <?php foreach ($roles as $role) { ?>
220 <tr>
221 <td><?php echo htmlspecialchars($role->name, ENT_COMPAT, 'UTF-8'); ?></td>
222 <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>
223 <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>
224 </tr>
225 <?php } ?>
226 </table>
227 </td>
228 </tr>
230 <tr>
231 <td colspan="2">
232 <h4><?php print_string("enrol_ldap_course_settings", "enrol_ldap") ?> </h4>
233 </td>
234 </tr>
235 <tr>
236 <td align="right">enrol_ldap_objectclass:</td>
237 <td>
238 <input name="enrol_ldap_objectclass" type="text" size="30" value="<?php echo $frm->enrol_ldap_objectclass?>"/>
239 <?php if (isset($err["enrol_ldap_objectclass"])) formerr($err["enrol_ldap_objectclass"]); ?>
240 </td>
241 <td>
242 <?php print_string("enrol_ldap_objectclass","enrol_ldap") ?>
243 </td>
244 </tr>
245 <tr>
246 <td align="right">enrol_ldap_course_idnumber:</td>
247 <td>
248 <input name="enrol_ldap_course_idnumber" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_idnumber?>"/>
249 <?php if (isset($err["enrol_ldap_course_idnumber"])) formerr($err["enrol_ldap_course_idnumber"]); ?>
250 <div style="text-align:right;margin-left:auto;margin-right:0">
251 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
252 <select name="enrol_ldap_course_idnumber_updatelocal">
253 <option value="0" <?php echo ($frm->enrol_ldap_course_idnumber_updatelocal ? '' : 'selected="selected"') ?> >
254 <?php print_string("no") ?></option>
255 <option value="1" <?php echo ($frm->enrol_ldap_course_idnumber_updatelocal ? 'selected="selected"' : '') ?> >
256 <?php print_string("yes") ?></option>
257 </select><br/>
258 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
259 <select name="enrol_ldap_course_idnumber_editlock">
260 <option value="0" <?php echo ($frm->enrol_ldap_course_idnumber_editlock ? '' : 'selected="selected"') ?> >
261 <?php print_string("no") ?></option>
262 <option value="1" <?php echo ($frm->enrol_ldap_course_idnumber_editlock ? 'selected="selected"' : '') ?> >
263 <?php print_string("yes") ?></option>
264 </select></div>
265 </td><td>
266 <?php print_string("enrol_ldap_course_idnumber","enrol_ldap") ?>
267 </td>
268 </tr>
269 <tr>
270 <td align="right">enrol_ldap_course_shortname:</td>
271 <td>
272 <input name="enrol_ldap_course_shortname" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_shortname?>"/>
273 <?php if (isset($err["enrol_ldap_course_shortname"])) formerr($err["enrol_ldap_course_shortname"]); ?>
274 <div style="text-align:right;margin-left:auto;margin-right:0">
275 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
276 <select name="enrol_ldap_course_shortname_updatelocal">
277 <option value="0" <?php echo ($frm->enrol_ldap_course_shortname_updatelocal ? '' : 'selected="selected"') ?> >
278 <?php print_string("no") ?></option>
279 <option value="1" <?php echo ($frm->enrol_ldap_course_shortname_updatelocal ? 'selected="selected"' : '') ?> >
280 <?php print_string("yes") ?></option>
281 </select><br/>
282 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
283 <select name="enrol_ldap_course_shortname_editlock">
284 <option value="0" <?php echo ($frm->enrol_ldap_course_shortname_editlock ? '' : 'selected="selected"') ?> >
285 <?php print_string("no") ?></option>
286 <option value="1" <?php echo ($frm->enrol_ldap_course_shortname_editlock ? 'selected="selected"' : '') ?> >
287 <?php print_string("yes") ?></option>
288 </select></div>
289 </td><td>
290 <?php print_string("enrol_ldap_course_shortname","enrol_ldap") ?>
291 </td>
292 </tr>
294 <tr>
295 <td align="right">enrol_ldap_course_fullname:</td>
296 <td>
297 <input name="enrol_ldap_course_fullname" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_fullname ?>"/>
298 <?php if (isset($err["enrol_ldap_course_fullname"])) formerr($err["enrol_ldap_course_fullname"]); ?>
299 <div style="text-align:right;margin-left:auto;margin-right:0">
300 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
301 <select name="enrol_ldap_course_fullname_updatelocal">
302 <option value="0" <?php echo ($frm->enrol_ldap_course_fullname_updatelocal ? '' : 'selected="selected"') ?> >
303 <?php print_string("no") ?></option>
304 <option value="1" <?php echo ($frm->enrol_ldap_course_fullname_updatelocal ? 'selected="selected"' : '') ?> >
305 <?php print_string("yes") ?></option>
306 </select><br/>
307 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
308 <select name="enrol_ldap_course_idnumber_editlock">
309 <option value="0" <?php echo ($frm->enrol_ldap_course_fullname_editlock ? '' : 'selected="selected"') ?> >
310 <?php print_string("no") ?></option>
311 <option value="1" <?php echo ($frm->enrol_ldap_course_fullname_editlock ? 'selected="selected"' : '') ?> >
312 <?php print_string("yes") ?></option>
313 </select></div>
314 </td><td>
315 <?php print_string("enrol_ldap_course_fullname","enrol_ldap") ?>
316 </td>
317 </tr>
319 <tr>
320 <td align="right">enrol_ldap_course_summary:</td>
321 <td>
322 <input name="enrol_ldap_course_summary" type="text" size="30" value="<?php echo $frm->enrol_ldap_course_summary?>"/>
323 <?php if (isset($err["enrol_ldap_course_summary"])) formerr($err["enrol_ldap_course_summary"]); ?>
324 <div style="text-align:right;margin-left:auto;margin-right:0">
325 <?php print_string("enrol_ldap_updatelocal", "enrol_ldap") ?>
326 <select name="enrol_ldap_course_summary_updatelocal">
327 <option value="0" <?php echo ($frm->enrol_ldap_course_summary_updatelocal ? '' : 'selected="selected"') ?> >
328 <?php print_string("no") ?></option>
329 <option value="1" <?php echo ($frm->enrol_ldap_course_summary_updatelocal ? 'selected="selected"' : '') ?> >
330 <?php print_string("yes") ?></option>
331 </select><br/>
332 <?php print_string("enrol_ldap_editlock", "enrol_ldap") ?>
333 <select name="enrol_ldap_course_summary_editlock">
334 <option value="0" <?php echo ($frm->enrol_ldap_course_summary_editlock ? '' : 'selected="selected"') ?> >
335 <?php print_string("no") ?></option>
336 <option value="1" <?php echo ($frm->enrol_ldap_course_summary_editlock ? 'selected="selected"' : '') ?> >
337 <?php print_string("yes") ?></option>
338 </select></div>
339 </td><td>
340 <?php print_string("enrol_ldap_course_summary","enrol_ldap") ?>
341 </td>
342 </tr>
344 <tr>
345 <td colspan="2">
346 <h4><?php print_string("enrol_ldap_autocreation_settings", "enrol_ldap") ?> </h4>
347 </td>
348 </tr>
349 <tr valign="top">
350 <td align="right">enrol_ldap_autocreate:</td>
351 <td>
352 <?php
353 choose_from_menu(array('0'=>'no','1'=>'yes'), "enrol_ldap_autocreate", $frm->enrol_ldap_autocreate, "");
354 if (isset($err["enrol_ldap_autocreate"])) formerr($err["enrol_ldap_autocreate"]);
356 </td>
357 <td>
358 <?php print_string("enrol_ldap_autocreate","enrol_ldap") ?>
359 </td>
360 </tr>
361 <tr>
362 <td align="right">enrol_ldap_category:</td>
363 <td>
364 <?php
365 $displaylist = array();
366 $parentlist = array();
367 make_categories_list($displaylist, $parentlist);
368 choose_from_menu($displaylist, "enrol_ldap_category", $frm->enrol_ldap_category, "");
371 <?php if (isset($err["enrol_ldap_category"])) formerr($err["enrol_ldap_category"]); ?>
372 </td><td>
373 <?php print_string("enrol_ldap_category","enrol_ldap") ?>
374 </td>
375 </tr>
377 <tr>
378 <td align="right">enrol_ldap_template:</td>
379 <td>
380 <input name="enrol_ldap_template" type="text" size="30" value="<?php echo $frm->enrol_ldap_template?>" />
381 <?php if (isset($err["enrol_ldap_template"])) formerr($err["enrol_ldap_template"]); ?>
382 </td><td>
383 <?php print_string("enrol_ldap_template","enrol_ldap") ?>
384 </td>
385 </tr>
387 </table>