- // List search results
- function display_result($res, $includesource = true) {
- global $color;
-
- if(sizeof($res) <= 0) return;
-
- insert_javascript();
-
- $line = 0;
- print "<TABLE BORDER=0 WIDTH=\"98%\" ALIGN=center>";
- printf("<TR BGCOLOR=\"$color[9]\"><TH ALIGN=left> ".
- "<TH ALIGN=left> %s<TH ALIGN=left> %s".
- "<TH ALIGN=left> %s",
- _("Name"), _("E-mail"), _("Info"));
-
- if($includesource)
- printf("<TH ALIGN=left WIDTH=\"10%%\"> %s", _("Source"));
-
- print "</TR>\n";
-
- while(list($key, $row) = each($res)) {
- printf("<tr%s nowrap><td valign=top nowrap align=center width=\"5%%\">".
- "<small><a href=\"javascript:to_address('%s');\">To</A> | ".
- "<a href=\"javascript:cc_address('%s');\">Cc</A> | ".
- "<a href=\"javascript:bcc_address('%s');\">Bcc</A></small>".
- "<td nowrap valign=top> %s <td nowrap valign=top>".
- " <a href=\"javascript:to_and_close('%s');\">%s</A> ".
- "<td valign=top> %s ",
- ($line % 2) ? " bgcolor=\"$color[0]\"" : "",
- $row["email"], $row["email"], $row["email"],
- $row["name"], $row["email"], $row["email"],
- $row["label"]);
-
- if($includesource)
- printf("<td nowrap valign=top> %s", $row["source"]);
-
- print "</TR>\n";
- $line++;
- }
- print "</TABLE>";
- }
-
- /* ================= End of functions ================= */
-
- session_start();
-
- if(!isset($logged_in)) {
- echo _("You must login first.");
- exit;
- }
- if(!isset($username) || !isset($key)) {
- echo _("You need a valid user and password to access this page!");
- exit;
- }
-
- if (!isset($config_php))
- include("../config/config.php");
- if (!isset($array_php))
- include("../functions/array.php");
- if (!isset($strings_php))
- include("../functions/strings.php");
- if (!isset($imap_php))
- include("../functions/imap.php");
- if (!isset($page_header_php))
- include("../functions/page_header.php");
- if (!isset($addressbook_php))
- include("../functions/addressbook.php");
-
- // Authenticate user and load prefs
- $imapConnection = sqimap_login($username, $key,
- $imapServerAddress, $imapPort, 10);
- include("../src/load_prefs.php");
- sqimap_logout ($imapConnection);
-
- displayHtmlHeader();
+ // List search results
+ function display_result($res, $includesource = true) {
+ global $color;
+
+ if(sizeof($res) <= 0) return;
+
+ insert_javascript();
+
+ $line = 0;
+ echo '<TABLE BORDER="0" WIDTH="98%" ALIGN=center>';
+ printf("<TR BGCOLOR=\"$color[9]\"><TH ALIGN=left> ".
+ "<TH ALIGN=left> %s<TH ALIGN=left> %s".
+ "<TH ALIGN=left> %s",
+ _("Name"), _("E-mail"), _("Info"));
+
+ if($includesource)
+ printf("<TH ALIGN=left WIDTH=\"10%%\"> %s", _("Source"));
+
+ echo "</TR>\n";
+
+ while(list($undef, $row) = each($res)) {
+ printf("<tr%s nowrap><td valign=top nowrap align=center width=\"5%%\">".
+ "<small><a href=\"javascript:to_address('%s');\">To</A> | ".
+ "<a href=\"javascript:cc_address('%s');\">Cc</A> | ".
+ "<a href=\"javascript:bcc_address('%s');\">Bcc</A></small>".
+ "<td nowrap valign=top> %s <td nowrap valign=top>".
+ " <a href=\"javascript:to_and_close('%s');\">%s</A> ".
+ "<td valign=top> %s ",
+ ($line % 2) ? " bgcolor=\"$color[0]\"" : "",
+ $row["email"], $row["email"], $row["email"],
+ $row["name"], $row["email"], $row["email"],
+ $row["label"]);
+
+ if($includesource)
+ printf("<td nowrap valign=top> %s", $row["source"]);
+
+ echo "</TR>\n";
+ $line++;
+ }
+ echo '</TABLE>';
+ }