More robustness, and some little bug fixes.
[moodle.git] / auth / ldap / config.html
1 <?PHP
2     if (!isset($config->ldap_host_url)) {
3         $config->ldap_host_url = "";
4     }
5     if (!isset($config->ldap_contexts)) {
6         $config->ldap_contexts = "";
7     }
8     if (!isset($config->ldap_user_attribute)) {
9         $config->ldap_user_attribute = "";
10     }
11     if (!isset($config->ldap_search_sub)) {
12         $config->ldap_search_sub = "";
13     }
14     if (!isset($config->ldap_bind_dn)) {
15         $config->ldap_bind_dn = "";
16     }
17     if (!isset($config->ldap_bind_pw)) {
18         $config->ldap_bind_pw = "";
19     }
20 ?>
21 <tr valign="top" BGCOLOR="<?=$THEME->cellheading2 ?>">
22         <TD ALIGN=RIGHT><P>ldap_host_url:</TD>
23         <TD>
24         <INPUT name=ldap_host_url TYPE=text SIZE=30 VALUE="<?=$config->ldap_host_url?>">
25         <? if (isset($err["ldap_host_url"])) formerr($err["ldap_host_url"]); ?>
26         </TD>
27     <TD>
28     <? print_string("auth_ldap_host_url","auth") ?>
29     </TD>
30 </TR>
32 <TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
33         <TD ALIGN=RIGHT><P>ldap_contexts:</TD>
34         <TD>
35     <INPUT name=ldap_contexts TYPE=text SIZE=30 VALUE="<?=$config->ldap_contexts?>">
36     <? if (isset($err["ldap_contexts"])) formerr($err["ldap_contexts"]); ?>
37     </TD>
38     <TD>
39     <? print_string("auth_ldap_contexts","auth") ?>
40     </TD>
41 </TR>
43 <TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
44         <TD ALIGN=RIGHT><P>ldap_user_attribute:</TD>
45         <TD>
46     <INPUT name=ldap_user_attribute TYPE=text SIZE=30 VALUE="<?=$config->ldap_user_attribute?>">
47     <? if (isset($err["ldap_user_attribute"])) formerr($err["ldap_user_attribute"]); ?>
48     </TD>
49     <TD>
50     <? print_string("auth_ldap_user_attribute","auth") ?>
51     </TD>
52 </TR>
54 <TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
55         <TD ALIGN=RIGHT><P>ldap_search_sub:</TD>
56         <TD>
57     <INPUT name=ldap_search_sub TYPE=text SIZE=1 VALUE="<?=$config->ldap_search_sub?>">
58     <? if (isset($err["ldap_search_sub"])) formerr($err["ldap_search_sub"]); ?>
59     </TD>
60     <TD>
61     <? print_string("auth_ldap_search_sub","auth") ?>
62     </TD>
63 </TR>
65 <TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
66         <TD ALIGN=RIGHT><P>ldap_bind_dn:</TD>
67         <TD>
68     <INPUT name=ldap_bind_dn TYPE=text SIZE=30 VALUE="<?=$config->ldap_bind_dn?>">
69     <? if (isset($err["ldap_bind_dn"])) formerr($err["ldap_bind_dn"]); ?>
70     </TD><TD>
71     <? print_string("auth_ldap_bind_dn","auth") ?>
72     </TD>
73 </TR>
75 <TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
76         <TD ALIGN=RIGHT><P>ldap_bind_pw:</TD>
77         <TD>
78     <INPUT name=ldap_bind_pw TYPE=text SIZE=30 VALUE="<?=$config->ldap_bind_pw?>">
79     <? if (isset($err["ldap_bind_pw"])) formerr($err["ldap_bind_pw"]); ?>
80     </TD><TD>
81     <? print_string("auth_ldap_bind_pw","auth") ?>
82     </TD>
83 </TR>
87 <TR>
88         <TD ALIGN=RIGHT><P><? print_string("firstname") ?>:</TD>
89         <TD>
90     <INPUT name="auth_user_firstname" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_firstname?>">
91     </TD>
92     <TD rowspan=12 VALIGN=CENTER>
93     <? print_string("auth_ldapextrafields","auth") ?>
94     </TD>
95 </TR>
97 <TR VALIGN=TOP>
98         <TD ALIGN=RIGHT><P><? print_string("lastname") ?>:</TD>
99         <TD>
100     <INPUT name="auth_user_lastname" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_lastname?>">
101     </TD>
102 </TR>
104 <TR VALIGN=TOP>
105         <TD ALIGN=RIGHT><P><? print_string("email") ?>:</TD>
106         <TD>
107     <INPUT name="auth_user_email" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_email?>">
108     </TD>
109 </TR>
111 <TR VALIGN=TOP>
112         <TD ALIGN=RIGHT><P><? print_string("phone") ?> 1:</TD>
113         <TD>
114     <INPUT name="auth_user_phone1" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_phone1?>">
115     </TD>
116 </TR>
118 <TR VALIGN=TOP>
119         <TD ALIGN=RIGHT><P><? print_string("phone") ?> 2:</TD>
120         <TD>
121     <INPUT name="auth_user_phone2" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_phone2?>">
122     </TD>
123 </TR>
125 <TR VALIGN=TOP>
126         <TD ALIGN=RIGHT><P><? print_string("department") ?>:</TD>
127         <TD>
128     <INPUT name="auth_user_department" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_department?>">
129     </TD>
130 </TR>
132 <TR VALIGN=TOP>
133         <TD ALIGN=RIGHT><P><? print_string("address") ?>:</TD>
134         <TD>
135     <INPUT name="auth_user_address" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_address?>">
136     </TD>
137 </TR>
139 <TR VALIGN=TOP>
140         <TD ALIGN=RIGHT><P><? print_string("city") ?>:</TD>
141         <TD>
142     <INPUT name="auth_user_city" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_city?>">
143     </TD>
144 </TR>
146 <TR VALIGN=TOP>
147         <TD ALIGN=RIGHT><P><? print_string("country") ?>:</TD>
148         <TD>
149     <INPUT name="auth_user_country" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_country?>">
150     </TD>
151 </TR>
153 <TR VALIGN=TOP>
154         <TD ALIGN=RIGHT><P><? print_string("description") ?>:</TD>
155         <TD>
156     <INPUT name="auth_user_description" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_description?>">
157     </TD>
158 </TR>
160 <TR VALIGN=TOP>
161         <TD ALIGN=RIGHT><P><? print_string("idnumber") ?>:</TD>
162         <TD>
163     <INPUT name="auth_user_idnumber" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_idnumber?>">
164     </TD>
165 </TR>
167 <TR VALIGN=TOP>
168         <TD ALIGN=RIGHT><P><? print_string("language") ?>:</TD>
169         <TD>
170     <INPUT name="auth_user_lang" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_lang?>">
171     </TD>
172 </TR>
175 <TR VALIGN=TOP>
176         <TD ALIGN=RIGHT><P><? print_string("instructions", "auth") ?>:</TD>
177         <TD>
178     <TEXTAREA NAME=auth_instructions COLS=30 ROWS=10 WRAP=virtual><? p($config->auth_instructions) ?></TEXTAREA> 
179     </TD>
180     <TD>
181     <? print_string("authinstructions","auth") ?>
182     <? helpbutton("text", get_string("helptext")) ?>
183     </TD>
184 </TR>