예제 #1
0
 /**
  * Function to be executed in script shutdown
  * Registered with register_shutdown_function()
  */
 public function shutdown()
 {
     if (is_object($this->imap)) {
         $this->imap->close();
     }
     if (is_object($this->smtp)) {
         $this->smtp->disconnect();
     }
     foreach ($this->books as $book) {
         if (is_object($book)) {
             $book->close();
         }
     }
     // before closing the database connection, write session data
     if ($_SERVER['REMOTE_ADDR']) {
         session_write_close();
     }
     // write performance stats to logs/console
     if ($this->config->get('devel_mode')) {
         if (function_exists('memory_get_usage')) {
             $mem = show_bytes(memory_get_usage());
         }
         if (function_exists('memory_get_peak_usage')) {
             $mem .= '/' . show_bytes(memory_get_peak_usage());
         }
         $log = $this->task . ($this->action ? '/' . $this->action : '') . ($mem ? " [{$mem}]" : '');
         if (defined('RCMAIL_START')) {
             rcube_print_time(RCMAIL_START, $log);
         } else {
             console($log);
         }
     }
 }
예제 #2
0
        $imap_ssl = isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl', 'imaps', 'tls')) ? $a_host['scheme'] : null;
        if (isset($a_host['port'])) {
            $imap_port = $a_host['port'];
        } else {
            if ($imap_ssl && $imap_ssl != 'tls' && (!$imap_port || $imap_port == 143)) {
                $imap_port = 993;
            }
        }
    }
    $imap_host = idn_to_ascii($imap_host);
    $imap_user = idn_to_ascii($_POST['_user']);
    $imap = new rcube_imap(null);
    $imap->set_options(array('auth_type' => $RCI->getprop('imap_auth_type'), 'debug' => $RCI->getprop('imap_debug'), 'socket_options' => $RCI->getprop('imap_conn_options')));
    if ($imap->connect($imap_host, $imap_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());
    }
}
?>

<p><input type="submit" name="imaptest" value="Check login" /></p>

</form>

<hr />

<p class="warning">

After completing the installation and the final tests please <b>remove</b> the whole