/**
* addrbook_search.php
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* Handle addressbook searching in the popup window.
* $Id$
*/
-require_once('../src/validate.php');
-require_once('../functions/strings.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'include/validate.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'functions/html.php');
+
+/* lets get the global vars we may need */
+$key = $_COOKIE['key'];
+$username = $_SESSION['username'];
+$onetimepad = $_SESSION['onetimepad'];
+$base_uri = $_SESSION['base_uri'];
+
+sqextractGlobalVar('show');
+if ( isset($_POST['query']) ) {
+ $query = $_POST['query'];
+}
+if ( isset($_POST['listall']) ) {
+ $listall = $_POST['listall'];
+}
+if ( isset($_POST['backend'] ) ) {
+ $backend = $_POST['backend'];
+}
/* Function to include JavaScript code */
function insert_javascript() {
while (list($undef, $row) = each($res)) {
$tr_bgcolor = '';
+ $email = htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES);
if ($line % 2) { $tr_bgcolor = $color[0]; }
echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .
html_tag( 'td',
'<small><a href="javascript:to_address(' .
- "'" . $row['email'] . "');\">To</A> | " .
+ "'" . $email . "');\">To</A> | " .
'<a href="javascript:cc_address(' .
- "'" . $row['email'] . "');\">Cc</A> | " .
+ "'" . $email . "');\">Cc</A> | " .
'<a href="javascript:bcc_address(' .
- "'" . $row['email'] . "');\">Bcc</A></small>",
+ "'" . $email . "');\">Bcc</A></small>",
'center', '', 'valign="top" width="5%" nowrap' ) .
- html_tag( 'td', ' ' . $row['name'], 'left', '', 'valign="top" nowrap' ) .
+ html_tag( 'td', ' ' . htmlspecialchars($row['name']), 'left', '', 'valign="top" nowrap' ) .
html_tag( 'td', ' ' .
'<a href="javascript:to_and_close(' .
- "'" . $row['email'] . "');\">" . $row['email'] . '</A>'
+ "'" . $email . "');\">" . htmlspecialchars($row['email']) . '</A>'
, 'left', '', 'valign="top"' ) .
- html_tag( 'td', $row['label'], 'left', '', 'valign="top" nowrap' );
+ html_tag( 'td', htmlspecialchars($row['label']), 'left', '', 'valign="top" nowrap' );
if ($includesource) {
echo html_tag( 'td', ' ' . $row['source'], 'left', '', 'valign="top" nowrap' );
}
/* ================= End of functions ================= */
-require_once('../functions/array.php');
require_once('../functions/strings.php');
require_once('../functions/addressbook.php');