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