From e8b140ab102cbad01c36685d7e8e2779e0a8ddb4 Mon Sep 17 00:00:00 2001 From: centaurix Date: Thu, 27 Jun 2002 10:37:57 +0000 Subject: [PATCH] updated/moved plugin from plugins/abook_take to squirrelmail/plugins/abook_take fixed bug [ 574135 ] git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3019 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/abook_take/INSTALL | 16 +++ plugins/abook_take/README | 66 +++++++++++ plugins/abook_take/setup.php | 215 +++++++++++++++++++++++++++++++++++ plugins/abook_take/take.php | 94 +++++++++++++++ 4 files changed, 391 insertions(+) create mode 100644 plugins/abook_take/INSTALL create mode 100755 plugins/abook_take/README create mode 100755 plugins/abook_take/setup.php create mode 100644 plugins/abook_take/take.php diff --git a/plugins/abook_take/INSTALL b/plugins/abook_take/INSTALL new file mode 100644 index 00000000..af088c6c --- /dev/null +++ b/plugins/abook_take/INSTALL @@ -0,0 +1,16 @@ +Installing Plugins +================== +Simply untar the file in the plugins directory, and make sure it is +in its own directory, and that the name of the directory is the name +of the plugin. Example below uses "plug_demo" as the name of the +plugin: + + $ cd plugins + $ tar -zxvf /usr/archives/plug_demo.tar.gz + +Then go to your config directory and run conf.pl. Choose option +8 and add the plugin (+). Save and exit, then that should be all +if the plugin was made correctly. :) + + $ cd ../config + $ ./conf.pl diff --git a/plugins/abook_take/README b/plugins/abook_take/README new file mode 100755 index 00000000..0f237cbf --- /dev/null +++ b/plugins/abook_take/README @@ -0,0 +1,66 @@ +Address Book Take -- Version 1.3 + +If you would like to add the sender of a message you're reading to your +address book quickly and easily without cutting and pasting, then this +plugin simplifies the process. It scans the mail message you're reading +for any email address and lets you add it with a quick form. + + +Features +======== + +* Saves you the need to Cut & Paste +* Steals from the To, From, Reply-To, and CC fields +* Steals from the body of the message +* Address verification (pretty good) + + +Description +=========== + +By pulling down a list and selecting the address you want to add, you +are then presented with a familiar Add to Personal Address Book screen. +By filling out this form, you will then add the email address to your +personal address book. + +The user can decide if the box is shown, where it is shown on the bottom +of the Read screen, and whether or not to attempt to verify that the +address works. + +When trying to verify if the address works, it checks to see if the host +has any DNS record available. Usually this will work. + + +Future Work +=========== + +* Maybe grab the name, if available +* Search more headers (when they become available) +* Steal from the body of the message directly (when possible) +* When new domains are added, update the email verification function + + +Installation +============ + +As with other plugins, just uncompress the archive in the plugins +directory, go back to the main directory, run configure and add the plugin. + +Questions/comments/flames/etc can be sent to + Tyler Akins + + +Changes +======= +1.2 -> 1.3 + * Removed warning created when all warning were enabled in PHP + +1.1 -> 1.2 + * Fixed some HTML + * Fixed how message body is grabbed + +1.0 -> 1.1 + * Fixed where a color was hardcoded + * Moved address \n"; + $abook_found_email[$chances[$i]] = 1; + } + $i ++; + } +} + + +function abook_take_read_array($array) +{ + $i = 0; + while ($i < count($array)) + { + abook_take_read_string($array[$i]); + $i ++; + } +} + + +function abook_take_read() +{ + global $color, $abook_take_location; + global $body, $abook_take_hide, $message, $imapConnection; + + if ($abook_take_hide) + return; + + ?> +
+ + + + +
+ + + + +
+ header->from); + abook_take_read_array($message->header->cc); + abook_take_read_array($message->header->reply_to); + abook_take_read_array($message->header->to); + + + $new_body = $body; + $pos = strpos($new_body, + '">Download this as a file
'); + if (is_int($pos)) + { + $new_body = substr($new_body, 0, $pos); + } + + $trans = get_html_translation_table(HTML_ENTITIES); + $trans[' '] = ' '; + $trans = array_flip($trans); + $new_body = strtr($new_body, $trans); + + $new_body = urldecode($new_body); + $new_body = strip_tags($new_body); + + $new_body = strtr($new_body, "\n", ' '); + + abook_take_read_string($body); + ?> + +
+
+
+ Address Book Take: + on the Read screen
+ > Hide the box
+ > Try to verify addresses + diff --git a/plugins/abook_take/take.php b/plugins/abook_take/take.php new file mode 100644 index 00000000..a72c6faa --- /dev/null +++ b/plugins/abook_take/take.php @@ -0,0 +1,94 @@ + + +
+ + +
localbackendname); +?>
+ +", + _("Nickname")); + printf("\n", + $color[4], $name, _("Must be unique")); + printf("", + _("E-mail address")); + + echo "", + _("First name")); + printf("\n", + $color[4], $name); + printf("", + _("Last name")); + printf("\n", + $color[4], $name); + printf("", + _("Additional info")); + printf("\n", + $color[4], $name); + + printf("\n", + $color[4], $name, _("Add address")); + + print "
%s:". + "". + " %s
%s:\n"; + echo '\n"; + + printf("
%s:". + "
%s:". + "
%s:". + "
\n". + "
\n"; +?> +
+ -- 2.25.1