From 27564f1a22d42cdcdb1d2972ca79cc537876c44c Mon Sep 17 00:00:00 2001 From: thomascube Date: Thu, 28 Feb 2008 21:52:57 +0000 Subject: Add IMAP test and some more options to installer script --- installer/test.php | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 4 deletions(-) (limited to 'installer/test.php') diff --git a/installer/test.php b/installer/test.php index 8a8b3457d..62535ac33 100644 --- a/installer/test.php +++ b/installer/test.php @@ -136,7 +136,7 @@ if ($RCI->getprop('smtp_server')) { if ($user == '%u') { $user_field = new textfield(array('name' => '_user')); - $user = $user_field->show(); + $user = $user_field->show($_POST['_user']); } if ($pass == '%p') { $pass_field = new passwordfield(array('name' => '_pass')); @@ -147,6 +147,9 @@ if ($RCI->getprop('smtp_server')) { echo "Password: $pass
"; } +$from_field = new textfield(array('name' => '_from', 'id' => 'sendmailfrom')); +$to_field = new textfield(array('name' => '_to', 'id' => 'sendmailto')); + ?>

@@ -217,18 +220,91 @@ echo '

'; - - + + + + + + + +
show($_POST['_from']); ?>
show($_POST['_to']); ?>

-

[@todo Add tests for IMAP settings]

+

Test IMAP configuration

+ +getprop('default_host'); +$select_imaphost = new select(array('name' => '_host', 'id' => 'imaphost')); +$select_imaphost->add(array_values($default_hosts)); + +$user_field = new textfield(array('name' => '_user', 'id' => 'imapuser')); +$pass_field = new passwordfield(array('name' => '_pass', 'id' => 'imappass')); + +?> + + + + + + + + + + + + + + + + + + + + +
show($_POST['_host'] ? $_POST['_host'] : '0'); ?>
Portgetprop('default_port'); ?>
show($_POST['_user']); ?>
show(); ?>
+ +Connecting to ' . Q($_POST['_host']) . '...
'; + + $a_host = parse_url($_POST['_host']); + if ($a_host['host']) { + $imap_host = $a_host['host']; + $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null; + $imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']); + } + else { + $imap_host = trim($_POST['_host']); + $imap_port = $RCI->getprop('default_port'); + } + + $imap = new rcube_imap(null); + if ($imap->connect($imap_host, $_POST['_user'], $_POST['_pass'], $imap_port, $imap_ssl)) { + $RCI->pass('IMAP connect', 'SORT capability: ' . ($imap->get_capability('SORT') ? 'yes' : 'no')); + $imap->close(); + } + else { + $RCI->fail('IMAP connect', $RCI->get_error()); + } +} + +?> + +

+
+

After completing the installation and the final tests please remove the whole -- cgit v1.2.3