From e0ddd4e6c03d533cc3f8427624e026cc20c88fa6 Mon Sep 17 00:00:00 2001 From: thomascube Date: Sun, 6 Nov 2005 16:37:45 +0000 Subject: Added 'changed' col to contacts table and support for 160-bit session hashes --- program/steps/addressbook/save.inc | 6 +++--- program/steps/mail/addcontact.inc | 4 ++-- program/steps/mail/func.inc | 12 +++++++++++- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'program/steps') diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc index 3e2cfae8f..c80707fcf 100644 --- a/program/steps/addressbook/save.inc +++ b/program/steps/addressbook/save.inc @@ -40,7 +40,7 @@ if ($_POST['_cid']) if (sizeof($a_write_sql)) { $DB->query("UPDATE ".get_table_name('contacts')." - SET ".join(', ', $a_write_sql)." + SET changed=now(), ".join(', ', $a_write_sql)." WHERE contact_id=? AND user_id=? AND del<>'1'", @@ -109,8 +109,8 @@ else if (sizeof($a_insert_cols)) { $DB->query("INSERT INTO ".get_table_name('contacts')." - (user_id, ".join(', ', $a_insert_cols).") - VALUES (?, ".join(', ', $a_insert_values).")", + (user_id, changedm ".join(', ', $a_insert_cols).") + VALUES (?, now(), ".join(', ', $a_insert_values).")", $_SESSION['user_id']); $insert_id = $DB->insert_id(); diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc index 6ead67812..ad1544e71 100644 --- a/program/steps/mail/addcontact.inc +++ b/program/steps/mail/addcontact.inc @@ -42,8 +42,8 @@ if ($_GET['_address']) else if ($contact['mailto']) { $DB->query("INSERT INTO ".get_table_name('contacts')." - (user_id, name, email) - VALUES (?, ?, ?)", + (user_id, changed, name, email) + VALUES (?, now(), ?, ?)", $_SESSION['user_id'], $contact['name'], $contact['mailto']); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 04196541b..e6c58a7c1 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -274,7 +274,8 @@ function rcmail_message_list($attrib) $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary')); $out = '\n"; - + + // define list of cols to be displayed $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); $a_sort_cols = array('subject', 'date', 'from', 'to'); @@ -283,6 +284,15 @@ function rcmail_message_list($attrib) if (strtolower($IMAP->get_mailbox_name())=='sent' && ($f = array_search('from', $a_show_cols))) $a_show_cols[$f] = 'to'; + // add col definition + $out .= ''; + $out .= ''; + + foreach ($a_show_cols as $col) + $out .= sprintf('', $col); + + $out .= ''; + $out .= "\n"; // add table title $out .= "\n \n"; -- cgit v1.2.3