Changeset 1155 in subversion for trunk/roundcubemail/installer/test.php
- Timestamp:
- Feb 28, 2008 4:52:57 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/roundcubemail/installer/test.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/installer/test.php
r1147 r1155 137 137 if ($user == '%u') { 138 138 $user_field = new textfield(array('name' => '_user')); 139 $user = $user_field->show( );139 $user = $user_field->show($_POST['_user']); 140 140 } 141 141 if ($pass == '%p') { … … 147 147 echo "Password: $pass<br />"; 148 148 } 149 150 $from_field = new textfield(array('name' => '_from', 'id' => 'sendmailfrom')); 151 $to_field = new textfield(array('name' => '_to', 'id' => 'sendmailto')); 149 152 150 153 ?> … … 218 221 <table> 219 222 <tbody> 220 <tr><td><label for="sendmailfrom">Sender</label></td><td><input type="text" name="_from" value="" id="sendmailfrom" /></td></tr> 221 <tr><td><label for="sendmailto">Recipient</label></td><td><input type="text" name="_to" value="" id="sendmailto" /></td></tr> 223 <tr> 224 <td><label for="sendmailfrom">Sender</label></td> 225 <td><?php echo $from_field->show($_POST['_from']); ?></td> 226 </tr> 227 <tr> 228 <td><label for="sendmailto">Recipient</label></td> 229 <td><?php echo $to_field->show($_POST['_to']); ?></td> 230 </tr> 222 231 </tbody> 223 232 </table> … … 226 235 227 236 228 <p>[@todo Add tests for IMAP settings]</p> 237 <h3>Test IMAP configuration</h3> 238 239 <?php 240 241 $default_hosts = (array)$RCI->getprop('default_host'); 242 $select_imaphost = new select(array('name' => '_host', 'id' => 'imaphost')); 243 $select_imaphost->add(array_values($default_hosts)); 244 245 $user_field = new textfield(array('name' => '_user', 'id' => 'imapuser')); 246 $pass_field = new passwordfield(array('name' => '_pass', 'id' => 'imappass')); 247 248 ?> 249 250 <table> 251 <tbody> 252 <tr> 253 <td><label for="imaphost">Server</label></td> 254 <td><?php echo $select_imaphost->show($_POST['_host'] ? $_POST['_host'] : '0'); ?></td> 255 </tr> 256 <tr> 257 <td>Port</td> 258 <td><?php echo $RCI->getprop('default_port'); ?></td> 259 </tr> 260 <tr> 261 <td><label for="imapuser">Username</label></td> 262 <td><?php echo $user_field->show($_POST['_user']); ?></td> 263 </tr> 264 <tr> 265 <td><label for="imappass">Password</label></td> 266 <td><?php echo $pass_field->show(); ?></td> 267 </tr> 268 </tbody> 269 </table> 270 271 <?php 272 273 if (isset($_POST['imaptest']) && !empty($_POST['_host']) && !empty($_POST['_user'])) { 274 275 require_once 'include/rcube_imap.inc'; 276 277 echo '<p>Connecting to ' . Q($_POST['_host']) . '...<br />'; 278 279 $a_host = parse_url($_POST['_host']); 280 if ($a_host['host']) { 281 $imap_host = $a_host['host']; 282 $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null; 283 $imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']); 284 } 285 else { 286 $imap_host = trim($_POST['_host']); 287 $imap_port = $RCI->getprop('default_port'); 288 } 289 290 $imap = new rcube_imap(null); 291 if ($imap->connect($imap_host, $_POST['_user'], $_POST['_pass'], $imap_port, $imap_ssl)) { 292 $RCI->pass('IMAP connect', 'SORT capability: ' . ($imap->get_capability('SORT') ? 'yes' : 'no')); 293 $imap->close(); 294 } 295 else { 296 $RCI->fail('IMAP connect', $RCI->get_error()); 297 } 298 } 299 300 ?> 301 302 <p><input type="submit" name="imaptest" value="Check login" /></p> 229 303 230 304 </form> 305 306 <hr /> 231 307 232 308 <p class="warning">
Note: See TracChangeset
for help on using the changeset viewer.
