1 <?php // initialize variables
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
= '';
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;
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
} = '';
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">
91 <h4><?php print_string("enrol_ldap_server_settings", "enrol_ldap") ?> </h4>
95 <td align=
"right">enrol_ldap_host_url:
</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"]); ?>
101 <?php print_string("enrol_ldap_host_url","enrol_ldap") ?>
105 <td align=
"right">enrol_ldap_version:
</td>
110 choose_from_menu($versions, "enrol_ldap_version", $frm->enrol_ldap_version
, "");
111 if (isset($err["enrol_ldap_version"])) formerr($err["enrol_ldap_version"]);
115 <?php print_string("enrol_ldap_version","enrol_ldap") ?>
120 <td align=
"right">enrol_ldap_bind_dn:
</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"]); ?>
125 <?php print_string("enrol_ldap_bind_dn","enrol_ldap") ?>
130 <td align=
"right">ldap_bind_pw:
</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"]); ?>
135 <?php print_string("enrol_ldap_bind_pw","enrol_ldap") ?>
140 <td align=
"right">ldap_search_sub:
</td>
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"]); ?>
150 <?php print_string("enrol_ldap_search_sub","enrol_ldap") ?>
157 <h4><?php print_string("enrol_ldap_student_settings", "enrol_ldap") ?> </h4>
161 <td align="right">enrol_ldap_student_contexts:</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"]); ?>
167 <?php print_string("enrol_ldap_student_contexts","enrol_ldap") ?>
171 <td align="right">enrol_ldap_student_memberattribute:</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"]); ?>
176 <?php print_string("enrol_ldap_student_memberattribute","enrol_ldap") ?>
182 <h4><?php print_string("enrol_ldap_teacher_settings", "enrol_ldap") ?> </h4>
186 <td align="right">enrol_ldap_teacher_contexts:</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"]); ?>
192 <?php print_string("enrol_ldap_teacher_contexts","enrol_ldap") ?>
196 <td align="right">enrol_ldap_teacher_memberattribute:</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"]); ?>
201 <?php print_string("enrol_ldap_teacher_memberattribute","enrol_ldap") ?>
208 <h4><?php print_string('enrol_ldap_roles', 'enrol_ldap'); ?></h4>
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>
219 <?php foreach ($roles as $role) { ?>
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
>
232 <h4><?php print_string("enrol_ldap_course_settings", "enrol_ldap") ?> </h4>
236 <td align=
"right">enrol_ldap_objectclass:
</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"]); ?>
242 <?php print_string("enrol_ldap_objectclass","enrol_ldap") ?>
246 <td align=
"right">enrol_ldap_course_idnumber:
</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>
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>
266 <?php print_string("enrol_ldap_course_idnumber","enrol_ldap") ?>
270 <td align=
"right">enrol_ldap_course_shortname:
</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>
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>
290 <?php print_string("enrol_ldap_course_shortname","enrol_ldap") ?>
295 <td align=
"right">enrol_ldap_course_fullname:
</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>
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>
315 <?php print_string("enrol_ldap_course_fullname","enrol_ldap") ?>
320 <td align=
"right">enrol_ldap_course_summary:
</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>
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>
340 <?php print_string("enrol_ldap_course_summary","enrol_ldap") ?>
346 <h4><?php print_string("enrol_ldap_autocreation_settings", "enrol_ldap") ?> </h4>
350 <td align=
"right">enrol_ldap_autocreate:
</td>
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"]);
358 <?php print_string("enrol_ldap_autocreate","enrol_ldap") ?>
362 <td align=
"right">enrol_ldap_category:
</td>
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"]); ?>
373 <?php print_string("enrol_ldap_category","enrol_ldap") ?>
378 <td align=
"right">enrol_ldap_template:
</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"]); ?>
383 <?php print_string("enrol_ldap_template","enrol_ldap") ?>