d1ae9d4c |
1 | <?php |
134e4174 |
2 | |
30967a1e |
3 | /** |
d1ae9d4c |
4 | * SquirrelMail configtest script |
5 | * |
47ccfad4 |
6 | * @copyright © 2003-2006 The SquirrelMail Project Team |
4b4abf93 |
7 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
30967a1e |
8 | * @version $Id$ |
9 | * @package squirrelmail |
10 | * @subpackage config |
d1ae9d4c |
11 | */ |
12 | |
13 | /************************************************************ |
14 | * NOTE: you do not need to change this script! * |
15 | * If it throws errors you need to adjust your config. * |
16 | ************************************************************/ |
17 | |
df758744 |
18 | // This script could really use some restructuring as it has grown quite rapidly |
19 | // but is not very 'clean'. Feel free to get some structure into this thing. |
20 | |
5b53b7e0 |
21 | function do_err($str, $exit = TRUE) { |
d18703d3 |
22 | global $IND; |
23 | echo '<p>'.$IND.'<font color="red"><b>ERROR:</b></font> ' .$str. "</p>\n"; |
5b53b7e0 |
24 | if($exit) { |
25 | echo '</body></html>'; |
26 | exit; |
27 | } |
28 | } |
29 | |
30 | $IND = str_repeat(' ',4); |
31 | |
32 | ob_implicit_flush(); |
30967a1e |
33 | /** @ignore */ |
5b53b7e0 |
34 | define('SM_PATH', '../'); |
35 | |
d0184454 |
36 | /* set default value in order to block remote access to script */ |
37 | $allow_remote_configtest=false; |
38 | |
5b53b7e0 |
39 | /* |
91e0dccc |
40 | * Load config before output begins. functions/strings.php depends on |
5b53b7e0 |
41 | * functions/globals.php. functions/global.php needs to be run before |
91e0dccc |
42 | * any html output starts. If config.php is missing, error will be displayed |
5b53b7e0 |
43 | * later. |
44 | */ |
45 | if (file_exists(SM_PATH . 'config/config.php')) { |
46 | include(SM_PATH . 'config/config.php'); |
47 | include(SM_PATH . 'functions/strings.php'); |
48 | } |
d1ae9d4c |
49 | ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
50 | <html> |
51 | <head> |
f9f738dc |
52 | <meta name="robots" content="noindex,nofollow"> |
d1ae9d4c |
53 | <title>SquirrelMail configtest</title> |
54 | </head> |
55 | <body> |
56 | <h1>SquirrelMail configtest</h1> |
57 | |
58 | <p>This script will try to check some aspects of your SquirrelMail configuration |
59 | and point you to errors whereever it can find them. You need to go run <tt>conf.pl</tt> |
d18703d3 |
60 | in the <tt>config/</tt> directory first before you run this script.</p> |
d1ae9d4c |
61 | |
62 | <?php |
63 | |
d1ae9d4c |
64 | $included = array_map('basename', get_included_files() ); |
65 | if(!in_array('config.php', $included)) { |
66 | if(!file_exists(SM_PATH . 'config/config.php')) { |
67 | do_err('Config file '.SM_PATH . 'config/config.php does not exist!<br />'. |
68 | 'You need to run <tt>conf.pl</tt> first.'); |
69 | } |
70 | do_err('Could not read '.SM_PATH.'config/config.php! Check file permissions.'); |
71 | } |
72 | if(!in_array('strings.php', $included)) { |
73 | do_err('Could not include '.SM_PATH.'functions/strings.php!<br />'. |
74 | 'Check permissions on that file.'); |
75 | } |
76 | |
d0184454 |
77 | /* Block remote use of script */ |
78 | if (! $allow_remote_configtest) { |
79 | sqGetGlobalVar('REMOTE_ADDR',$client_ip,SQ_SERVER); |
80 | if (! isset($client_ip) || $client_ip!='127.0.0.1') { |
f8a1ed5a |
81 | do_err('Enable "Allow remote configtest" option in squirrelmail configuration in order to use this script.'); |
d0184454 |
82 | } |
83 | } |
d1ae9d4c |
84 | /* checking PHP specs */ |
85 | |
17fca61d |
86 | echo "<p><table>\n<tr><td>SquirrelMail version:</td><td><b>" . $version . "</b></td></tr>\n" . |
87 | '<tr><td>Config file version:</td><td><b>' . $config_version . "</b></td></tr>\n" . |
91e0dccc |
88 | '<tr><td>Config file last modified:</td><td><b>' . |
17fca61d |
89 | date ('d F Y H:i:s', filemtime(SM_PATH . 'config/config.php')) . |
90 | "</b></td></tr>\n</table>\n</p>\n\n"; |
d1ae9d4c |
91 | |
92 | echo "Checking PHP configuration...<br />\n"; |
93 | |
abd74f7d |
94 | if(!check_php_version(4,1,0)) { |
95 | do_err('Insufficient PHP version: '. PHP_VERSION . '! Minimum required: 4.1.0'); |
d1ae9d4c |
96 | } |
97 | |
17fca61d |
98 | echo $IND . 'PHP version ' . PHP_VERSION . " OK.<br />\n"; |
d1ae9d4c |
99 | |
100 | $php_exts = array('session','pcre'); |
101 | $diff = array_diff($php_exts, get_loaded_extensions()); |
102 | if(count($diff)) { |
103 | do_err('Required PHP extensions missing: '.implode(', ',$diff) ); |
104 | } |
105 | |
17fca61d |
106 | echo $IND . "PHP extensions OK.<br />\n"; |
d1ae9d4c |
107 | |
8f186a2a |
108 | /* dangerous php settings */ |
109 | /** |
110 | * mbstring.func_overload allows to replace original string and regexp functions |
111 | * with their equivalents from php mbstring extension. It causes problems when |
d0184454 |
112 | * scripts analyze 8bit strings byte after byte or use 8bit strings in regexp tests. |
9211bcef |
113 | * Setting can be controlled in php.ini (php 4.2.0), webserver config (php 4.2.0) |
8f186a2a |
114 | * and .htaccess files (php 4.3.5). |
115 | */ |
116 | if (function_exists('mb_internal_encoding') && |
9211bcef |
117 | check_php_version(4,2,0) && |
8f186a2a |
118 | (int)ini_get('mbstring.func_overload')!=0) { |
119 | $mb_error='You have enabled mbstring overloading.' |
120 | .' It can cause problems with SquirrelMail scripts that rely on single byte string functions.'; |
121 | do_err($mb_error); |
122 | } |
d1ae9d4c |
123 | |
124 | /* checking paths */ |
125 | |
126 | echo "Checking paths...<br />\n"; |
127 | |
128 | if(!file_exists($data_dir)) { |
d0184454 |
129 | // data_dir is not that important in db_setups. |
130 | if (isset($prefs_dsn) && ! empty($prefs_dsn)) { |
131 | $data_dir_error = "Data dir ($data_dir) does not exist!\n"; |
132 | echo $IND .'<font color="red"><b>ERROR:</b></font> ' . $data_dir_error; |
133 | } else { |
134 | do_err("Data dir ($data_dir) does not exist!"); |
135 | } |
91e0dccc |
136 | } |
d0184454 |
137 | // don't check if errors |
138 | if(!isset($data_dir_error) && !is_dir($data_dir)) { |
139 | if (isset($prefs_dsn) && ! empty($prefs_dsn)) { |
140 | $data_dir_error = "Data dir ($data_dir) is not a directory!\n"; |
141 | echo $IND . '<font color="red"><b>ERROR:</b></font> ' . $data_dir_error; |
142 | } else { |
143 | do_err("Data dir ($data_dir) is not a directory!"); |
144 | } |
91e0dccc |
145 | } |
d4eaadbe |
146 | // datadir should be executable - but no clean way to test on that |
d0184454 |
147 | if(!isset($data_dir_error) && !is_writable($data_dir)) { |
148 | if (isset($prefs_dsn) && ! empty($prefs_dsn)) { |
149 | $data_dir_error = "Data dir ($data_dir) is not writable!\n"; |
150 | echo $IND . '<font color="red"><b>ERROR:</b></font> ' . $data_dir_error; |
151 | } else { |
152 | do_err("Data dir ($data_dir) is not writable!"); |
153 | } |
d1ae9d4c |
154 | } |
155 | |
d0184454 |
156 | if (isset($data_dir_error)) { |
157 | echo " Some plugins might need access to data directory.<br />\n"; |
158 | } else { |
159 | // todo_ornot: actually write something and read it back. |
160 | echo $IND . "Data dir OK.<br />\n"; |
161 | } |
d1ae9d4c |
162 | |
163 | if($data_dir == $attachment_dir) { |
164 | echo $IND . "Attachment dir is the same as data dir.<br />\n"; |
d0184454 |
165 | if (isset($data_dir_error)) { |
166 | do_err($data_dir_error); |
167 | } |
d1ae9d4c |
168 | } else { |
169 | if(!file_exists($attachment_dir)) { |
170 | do_err("Attachment dir ($attachment_dir) does not exist!"); |
91e0dccc |
171 | } |
d1ae9d4c |
172 | if (!is_dir($attachment_dir)) { |
173 | do_err("Attachment dir ($attachment_dir) is not a directory!"); |
91e0dccc |
174 | } |
d1ae9d4c |
175 | if (!is_writable($attachment_dir)) { |
176 | do_err("I cannot write to attachment dir ($attachment_dir)!"); |
177 | } |
178 | echo $IND . "Attachment dir OK.<br />\n"; |
179 | } |
180 | |
181 | |
182 | /* check plugins and themes */ |
5b53b7e0 |
183 | if (isset($plugins[0])) { |
184 | foreach($plugins as $plugin) { |
185 | if(!file_exists(SM_PATH .'plugins/'.$plugin)) { |
186 | do_err('You have enabled the <i>'.$plugin.'</i> plugin but I cannot find it.', FALSE); |
187 | } elseif (!is_readable(SM_PATH .'plugins/'.$plugin.'/setup.php')) { |
188 | do_err('You have enabled the <i>'.$plugin.'</i> plugin but I cannot read its setup.php file.', FALSE); |
189 | } |
d1ae9d4c |
190 | } |
5b53b7e0 |
191 | echo $IND . "Plugins OK.<br />\n"; |
192 | } else { |
193 | echo $IND . "Plugins are not enabled in config.<br />\n"; |
d1ae9d4c |
194 | } |
d1ae9d4c |
195 | foreach($theme as $thm) { |
196 | if(!file_exists($thm['PATH'])) { |
197 | do_err('You have enabled the <i>'.$thm['NAME'].'</i> theme but I cannot find it ('.$thm['PATH'].').', FALSE); |
198 | } elseif(!is_readable($thm['PATH'])) { |
199 | do_err('You have enabled the <i>'.$thm['NAME'].'</i> theme but I cannot read it ('.$thm['PATH'].').', FALSE); |
200 | } |
201 | } |
202 | |
203 | echo $IND . "Themes OK.<br />\n"; |
204 | |
07337c9b |
205 | if ( $squirrelmail_default_language != 'en_US' ) { |
206 | $loc_path = SM_PATH .'locale/'.$squirrelmail_default_language.'/LC_MESSAGES/squirrelmail.mo'; |
207 | if( ! file_exists( $loc_path ) ) { |
f8a1ed5a |
208 | do_err('You have set <i>' . $squirrelmail_default_language . |
07337c9b |
209 | '</i> as your default language, but I cannot find this translation (should be '. |
210 | 'in <tt>' . $loc_path . '</tt>). Please note that you have to download translations '. |
211 | 'separately from the main SquirrelMail package.', FALSE); |
212 | } elseif ( ! is_readable( $loc_path ) ) { |
f8a1ed5a |
213 | do_err('You have set <i>' . $squirrelmail_default_language . |
07337c9b |
214 | '</i> as your default language, but I cannot read this translation (file '. |
215 | 'in <tt>' . $loc_path . '</tt> unreadable).', FALSE); |
216 | } else { |
217 | echo $IND . "Default language OK.<br />\n"; |
218 | } |
219 | } else { |
220 | echo $IND . "Default language OK.<br />\n"; |
221 | } |
222 | |
23649466 |
223 | echo $IND . "Base URL detected as: <tt>" . htmlspecialchars(get_location()) . "</tt><br />\n"; |
224 | |
d1ae9d4c |
225 | |
226 | /* check outgoing mail */ |
227 | |
228 | if($use_smtp_tls || $use_imap_tls) { |
229 | if(!check_php_version(4,3,0)) { |
230 | do_err('You need at least PHP 4.3.0 for SMTP/IMAP TLS!'); |
231 | } |
232 | if(!extension_loaded('openssl')) { |
233 | do_err('You need the openssl PHP extension to use SMTP/IMAP TLS!'); |
234 | } |
235 | } |
236 | |
237 | echo "Checking outgoing mail service....<br />\n"; |
238 | |
239 | if($useSendmail) { |
240 | // is_executable also checks for existance, but we want to be as precise as possible with the errors |
241 | if(!file_exists($sendmail_path)) { |
242 | do_err("Location of sendmail program incorrect ($sendmail_path)!"); |
91e0dccc |
243 | } |
d1ae9d4c |
244 | if(!is_executable($sendmail_path)) { |
245 | do_err("I cannot execute the sendmail program ($sendmail_path)!"); |
246 | } |
247 | |
248 | echo $IND . "sendmail OK<br />\n"; |
249 | } else { |
250 | $stream = fsockopen( ($use_smtp_tls?'tls://':'').$smtpServerAddress, $smtpPort, |
251 | $errorNumber, $errorString); |
252 | if(!$stream) { |
253 | do_err("Error connecting to SMTP server \"$smtpServerAddress:$smtpPort\".". |
9c941728 |
254 | "Server error: ($errorNumber) ".htmlspecialchars($errorString)); |
d1ae9d4c |
255 | } |
256 | |
257 | // check for SMTP code; should be 2xx to allow us access |
258 | $smtpline = fgets($stream, 1024); |
259 | if(((int) $smtpline{0}) > 3) { |
9c941728 |
260 | do_err("Error connecting to SMTP server. Server error: ". |
134e4174 |
261 | htmlspecialchars($smtpline)); |
d1ae9d4c |
262 | } |
263 | |
264 | fputs($stream, 'QUIT'); |
265 | fclose($stream); |
9c941728 |
266 | echo $IND . 'SMTP server OK (<tt><small>'. |
267 | trim(htmlspecialchars($smtpline))."</small></tt>)<br />\n"; |
d1ae9d4c |
268 | |
269 | /* POP before SMTP */ |
270 | if($pop_before_smtp) { |
271 | $stream = fsockopen($smtpServerAddress, 110, $err_no, $err_str); |
272 | if (!$stream) { |
9c941728 |
273 | do_err("Error connecting to POP Server ($smtpServerAddress:110) " |
274 | . $err_no . ' : ' . htmlspecialchars($err_str)); |
d1ae9d4c |
275 | } |
276 | |
277 | $tmp = fgets($stream, 1024); |
278 | if (substr($tmp, 0, 3) != '+OK') { |
279 | do_err("Error connecting to POP Server ($smtpServerAddress:110)" |
9c941728 |
280 | . ' '.htmlspecialchars($tmp)); |
d1ae9d4c |
281 | } |
282 | fputs($stream, 'QUIT'); |
283 | fclose($stream); |
284 | echo $IND . "POP-before-SMTP OK.<br />\n"; |
285 | } |
286 | } |
287 | |
df758744 |
288 | /** |
289 | * Check the IMAP server |
290 | */ |
d1ae9d4c |
291 | echo "Checking IMAP service....<br />\n"; |
292 | |
df758744 |
293 | /** Can we open a connection? */ |
d1ae9d4c |
294 | $stream = fsockopen( ($use_imap_tls?'tls://':'').$imapServerAddress, $imapPort, |
295 | $errorNumber, $errorString); |
296 | if(!$stream) { |
70b71161 |
297 | do_err("Error connecting to IMAP server \"$imapServerAddress:$imapPort\".". |
9c941728 |
298 | "Server error: ($errorNumber) ". |
134e4174 |
299 | htmlspecialchars($errorString)); |
d1ae9d4c |
300 | } |
301 | |
df758744 |
302 | /** Is the first response 'OK'? */ |
d1ae9d4c |
303 | $imapline = fgets($stream, 1024); |
304 | if(substr($imapline, 0,4) != '* OK') { |
9c941728 |
305 | do_err('Error connecting to IMAP server. Server error: '. |
306 | htmlspecialchars($imapline)); |
d1ae9d4c |
307 | } |
308 | |
df758744 |
309 | echo $IND . 'IMAP server ready (<tt><small>'. |
9c941728 |
310 | htmlspecialchars(trim($imapline))."</small></tt>)<br />\n"; |
d1ae9d4c |
311 | |
df758744 |
312 | /** Check capabilities */ |
313 | fputs($stream, "A001 CAPABILITY\r\n"); |
314 | $capline = fgets($stream, 1024); |
315 | |
316 | echo $IND . 'Capabilities: <tt>'.htmlspecialchars($capline)."</tt><br />\n"; |
317 | |
318 | if($imap_auth_mech == 'login' && stristr($capline, 'LOGINDISABLED') !== FALSE) { |
319 | do_err('Your server doesn\'t allow plaintext logins. '. |
320 | 'Try enabling another authentication mechanism like CRAM-MD5, DIGEST-MD5 or TLS-encryption '. |
321 | 'in the SquirrelMail configuration.', FALSE); |
322 | } |
cafb1343 |
323 | /* don't test for STARTTLS in CAPABILITY */ |
df758744 |
324 | |
325 | /** OK, close connection */ |
326 | fputs($stream, "A002 LOGOUT\r\n"); |
327 | fclose($stream); |
328 | |
17fca61d |
329 | echo "Checking internationalization (i18n) settings...<br />\n"; |
0ed3bdc3 |
330 | echo "$IND gettext - "; |
331 | if (function_exists('gettext')) { |
8f186a2a |
332 | echo 'Gettext functions are available.' |
333 | .' On some systems you must have appropriate system locales compiled.' |
334 | ."<br />\n"; |
0ed3bdc3 |
335 | } else { |
8f186a2a |
336 | echo 'Gettext functions are unavailable.' |
337 | .' SquirrelMail will use slower internal gettext functions.' |
338 | ."<br />\n"; |
0ed3bdc3 |
339 | } |
340 | echo "$IND mbstring - "; |
341 | if (function_exists('mb_detect_encoding')) { |
342 | echo "Mbstring functions are available.<br />\n"; |
343 | } else { |
8f186a2a |
344 | echo 'Mbstring functions are unavailable.' |
345 | ." Japanese translation won't work.<br />\n"; |
0ed3bdc3 |
346 | } |
347 | echo "$IND recode - "; |
348 | if (function_exists('recode')) { |
349 | echo "Recode functions are available.<br />\n"; |
ba17b6c7 |
350 | } elseif (isset($use_php_recode) && $use_php_recode) { |
0ed3bdc3 |
351 | echo "Recode functions are unavailable.<br />\n"; |
352 | do_err('Your configuration requires recode support, but recode support is missing.'); |
353 | } else { |
354 | echo "Recode functions are unavailable.<br />\n"; |
355 | } |
356 | echo "$IND iconv - "; |
357 | if (function_exists('iconv')) { |
358 | echo "Iconv functions are available.<br />\n"; |
ba17b6c7 |
359 | } elseif (isset($use_php_iconv) && $use_php_iconv) { |
0ed3bdc3 |
360 | echo "Iconv functions are unavailable.<br />\n"; |
361 | do_err('Your configuration requires iconv support, but iconv support is missing.'); |
362 | } else { |
363 | echo "Iconv functions are unavailable.<br />\n"; |
364 | } |
365 | // same test as in include/validate.php |
366 | echo "$IND timezone - "; |
367 | if ( (!ini_get('safe_mode')) || |
368 | !strcmp(ini_get('safe_mode_allowed_env_vars'),'') || |
369 | preg_match('/^([\w_]+,)*TZ/', ini_get('safe_mode_allowed_env_vars')) ) { |
134e4174 |
370 | echo "Webmail users can change their time zone settings.<br />\n"; |
0ed3bdc3 |
371 | } else { |
4764a7ff |
372 | echo "Webmail users can't change their time zone settings.<br />\n"; |
373 | } |
374 | |
d18703d3 |
375 | |
4764a7ff |
376 | // Pear DB tests |
d18703d3 |
377 | echo "Checking database functions...<br />\n"; |
378 | if($addrbook_dsn || $prefs_dsn || $addrbook_global_dsn) { |
134e4174 |
379 | @include_once('DB.php'); |
380 | if (class_exists('DB')) { |
381 | echo "$IND PHP Pear DB support is present.<br />\n"; |
382 | $db_functions=array( |
91e0dccc |
383 | 'dbase' => 'dbase_open', |
384 | 'fbsql' => 'fbsql_connect', |
385 | 'interbase' => 'ibase_connect', |
134e4174 |
386 | 'informix' => 'ifx_connect', |
387 | 'msql' => 'msql_connect', |
388 | 'mssql' => 'mssql_connect', |
389 | 'mysql' => 'mysql_connect', |
390 | 'mysqli' => 'mysqli_connect', |
391 | 'oci8' => 'ocilogon', |
392 | 'odbc' => 'odbc_connect', |
7ed4c524 |
393 | 'pgsql' => 'pg_connect', |
134e4174 |
394 | 'sqlite' => 'sqlite_open', |
395 | 'sybase' => 'sybase_connect' |
396 | ); |
397 | |
398 | $dsns = array(); |
399 | if($prefs_dsn) { |
400 | $dsns['preferences'] = $prefs_dsn; |
401 | } |
402 | if($addrbook_dsn) { |
403 | $dsns['addressbook'] = $addrbook_dsn; |
404 | } |
405 | if($addrbook_global_dsn) { |
406 | $dsns['global addressbook'] = $addrbook_global_dsn; |
407 | } |
408 | |
409 | foreach($dsns as $type => $dsn) { |
ba17b6c7 |
410 | $aDsn = explode(':', $dsn); |
411 | $dbtype = array_shift($aDsn); |
134e4174 |
412 | if(isset($db_functions[$dbtype]) && function_exists($db_functions[$dbtype])) { |
413 | echo "$IND$dbtype database support present.<br />\n"; |
414 | |
415 | // now, test this interface: |
416 | |
417 | $dbh = DB::connect($dsn, true); |
418 | if (DB::isError($dbh)) { |
419 | do_err('Database error: '. htmlspecialchars(DB::errorMessage($dbh)) . |
420 | ' in ' .$type .' DSN.'); |
421 | } |
422 | $dbh->disconnect(); |
423 | echo "$IND$type database connect successful.<br />\n"; |
424 | |
425 | } else { |
ba17b6c7 |
426 | do_err($dbtype.' database support not present!'); |
d18703d3 |
427 | } |
134e4174 |
428 | } |
429 | } else { |
8f186a2a |
430 | $db_error='Required PHP PEAR DB support is not available.' |
431 | .' Is PEAR installed and is the include path set correctly to find <tt>DB.php</tt>?' |
432 | .' The include path is now:<tt>' . ini_get('include_path') . '</tt>.'; |
433 | do_err($db_error); |
134e4174 |
434 | } |
4764a7ff |
435 | } else { |
d18703d3 |
436 | echo $IND."not using database functionality.<br />\n"; |
0ed3bdc3 |
437 | } |
7562c55b |
438 | |
439 | // LDAP DB tests |
440 | echo "Checking LDAP functions...<br />\n"; |
441 | if( empty($ldap_server) ) { |
134e4174 |
442 | echo $IND."not using LDAP functionality.<br />\n"; |
7562c55b |
443 | } else { |
d0184454 |
444 | if ( !function_exists('ldap_connect') ) { |
7562c55b |
445 | do_err('Required LDAP support is not available.'); |
446 | } else { |
134e4174 |
447 | echo "$IND LDAP support present.<br />\n"; |
7562c55b |
448 | foreach ( $ldap_server as $param ) { |
449 | |
d0184454 |
450 | $linkid = @ldap_connect($param['host'], (empty($param['port']) ? 389 : $param['port']) ); |
7562c55b |
451 | |
452 | if ( $linkid ) { |
134e4174 |
453 | echo "$IND LDAP connect to ".$param['host']." successful: ".$linkid."<br />\n"; |
91e0dccc |
454 | |
7562c55b |
455 | if ( !empty($param['protocol']) && |
456 | !ldap_set_option($linkid, LDAP_OPT_PROTOCOL_VERSION, $param['protocol']) ) { |
457 | do_err('Unable to set LDAP protocol'); |
91e0dccc |
458 | } |
7562c55b |
459 | |
460 | if ( empty($param['binddn']) ) { |
d0184454 |
461 | $bind = @ldap_bind($linkid); |
7562c55b |
462 | } else { |
d0184454 |
463 | $bind = @ldap_bind($param['binddn'], $param['bindpw']); |
7562c55b |
464 | } |
465 | |
466 | if ( $bind ) { |
467 | echo "$IND LDAP Bind Successful <br />"; |
468 | } else { |
469 | do_err('Unable to Bind to LDAP Server'); |
470 | } |
91e0dccc |
471 | |
d0184454 |
472 | @ldap_close($linkid); |
7562c55b |
473 | } else { |
474 | do_err('Connection to LDAP failed'); |
475 | } |
476 | } |
477 | } |
478 | } |
a2b193bc |
479 | |
d1ae9d4c |
480 | ?> |
481 | |
482 | <p>Congratulations, your SquirrelMail setup looks fine to me!</p> |
483 | |
13721b47 |
484 | <p><a href="login.php">Login now</a></p> |
d1ae9d4c |
485 | |
486 | </body> |
f8a1ed5a |
487 | </html> |