From: kink Date: Fri, 17 Jan 2003 18:15:24 +0000 (+0000) Subject: Fix abook_take X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b755a6b10b48829e0ba137ad77ac47b9da4a2a10;p=squirrelmail.git Fix abook_take git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4430 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/plugins/abook_take/INSTALL b/plugins/abook_take/INSTALL deleted file mode 100644 index af088c6c..00000000 --- a/plugins/abook_take/INSTALL +++ /dev/null @@ -1,16 +0,0 @@ -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/setup.php b/plugins/abook_take/setup.php index dd36b662..9bdb8409 100755 --- a/plugins/abook_take/setup.php +++ b/plugins/abook_take/setup.php @@ -1,212 +1,118 @@ \n"; + $abook_found_email[$hits[0]] = 1; + } + } - while (eregi('(' . $Email_RegExp_Match . ')', $str, $hits)) - { - $str = substr(strstr($str, $hits[0]), strlen($hits[0])); - if (! isset($abook_found_email[$hits[0]])) - { - echo "\n"; - $abook_found_email[$hits[0]] = 1; - } - } - return; + return; } - function abook_take_read_array($array) { - $i = 0; - while ($i < count($array)) - { - abook_take_read_string($array[$i]->getAddress()); - $i ++; - } + foreach ($array as $item) + abook_take_read_string($item->getAddress()); } - function abook_take_read() { - global $color, $abook_take_location; - global $body, $abook_take_hide, $message, $imapConnection; + global $message; - if ($abook_take_hide) - return; - - echo '
' . "\n" . - html_tag( 'table', '', $abook_take_location, $color[10], 'cellpadding="3" cellspacing="0" border="0"' ) . - html_tag( 'tr' ) . - html_tag( 'td', '', 'left' ) . - html_tag( 'table', '', '', $color[5], 'cellpadding="2" cellspacing="1" border="0"' ) . - html_tag( 'tr' ) . - html_tag( 'td' ); - - if (isset($message->rfc822_header->from)) - abook_take_read_array($message->rfc822_header->from); - if (isset($message->rfc822_header->cc)) - abook_take_read_array($message->rfc822_header->cc); - if (isset($message->rfc822_header->reply_to)) - abook_take_read_array($message->rfc822_header->reply_to); - if (isset($message->rfc822_header->to)) - abook_take_read_array($message->rfc822_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); - - echo ''; - ?> - - - - - - -
-
'."\n"; + + if (isset($message->rfc822_header->reply_to)) + abook_take_read_array($message->rfc822_header->reply_to); + if (isset($message->rfc822_header->from)) + abook_take_read_array($message->rfc822_header->from); + if (isset($message->rfc822_header->cc)) + abook_take_read_array($message->rfc822_header->cc); + if (isset($message->rfc822_header->to)) + abook_take_read_array($message->rfc822_header->to); + + echo '' . + '
'; } function abook_take_pref() { - global $username, $data_dir; - global $abook_take_hide, $abook_take_location, $abook_take_verify; + global $username, $data_dir, $abook_take_verify; - $abook_take_location = getPref($data_dir, $username, 'abook_take_location'); - if ($abook_take_location == '') - $abook_take_location = 'center'; - - $abook_take_hide = getPref($data_dir, $username, 'abook_take_hide'); - $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify'); + $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify'); } - function abook_take_options() { - global $abook_take_location, $abook_take_hide, $abook_take_verify; - - echo html_tag( 'tr' ) . - html_tag( 'td', _("Address Book Take") . ':', 'right', '', 'nowrap valign="top"' ) . - html_tag( 'td', '', 'left' ) . - ' ' . _("on the Read screen") .'
' . - ' ' . _("Hide the box") . '
' . - ' ' . _("Try to verify addresses") . ''; + global $abook_take_verify; + + echo '' . _("Address Book Take:") . "\n" . + ' ' . _("Try to verify addresses") . "\n"; } function abook_take_save() { - global $username, $data_dir; - global $abook_take_abook_take_location; - global $abook_take_abook_take_hide; - global $abook_take_abook_take_verify; - + global $username, $data_dir; - if (isset($abook_take_abook_take_location)) - { - setPref($data_dir, $username, 'abook_take_location', $abook_take_abook_take_location); - } - else - { - setPref($data_dir, $username, 'abook_take_location', 'center'); - } - - if (isset($abook_take_abook_take_hide)) - { - setPref($data_dir, $username, 'abook_take_hide', '1'); - } - else - { - setPref($data_dir, $username, 'abook_take_hide', ''); - } - - if (isset($abook_take_abook_take_verify)) - { - setPref($data_dir, $username, 'abook_take_verify', '1'); - } - else - { - setPref($data_dir, $username, 'abook_take_verify', ''); - } + if (sqgetGlobalVar('abook_take_abook_take_verify', $abook_take_abook_take_verify, SQ_POST)) + setPref($data_dir, $username, 'abook_take_verify', '1'); + else + setPref($data_dir, $username, 'abook_take_verify', ''); } ?> diff --git a/plugins/abook_take/take.php b/plugins/abook_take/take.php index b062552e..81c96ae4 100644 --- a/plugins/abook_take/take.php +++ b/plugins/abook_take/take.php @@ -1,11 +1,16 @@ ' ."\n" . html_tag( 'table', html_tag( 'tr', @@ -44,39 +53,38 @@ echo '
' ."\n html_tag( 'td', _("E-mail address") . ':', 'right', $color[4], 'width="50"' ) . "\n" . html_tag( 'td', '', 'left', $color[4] ) . '' . "\n" . + } + } + echo '' . "\n" . - html_tag( 'tr', "\n" . - html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) . - html_tag( 'td', '', 'left', $color[4] ) - ) . "\n" . - html_tag( 'tr', "\n" . - html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) . - html_tag( 'td', '', 'left', $color[4] ) - ) . "\n" . - html_tag( 'tr', "\n" . - html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) . - html_tag( 'td', '', 'left', $color[4] ) - ) . "\n" . - html_tag( 'tr', "\n" . - html_tag( 'td', - '' , - 'center', $color[4], 'colspan="2"' ) - ) . "\n" . - ''; + html_tag( 'tr', "\n" . + html_tag( 'td', _("First name") . ':', 'right', $color[4], 'width="50"' ) . + html_tag( 'td', '', 'left', $color[4] ) + ) . "\n" . + html_tag( 'tr', "\n" . + html_tag( 'td', _("Last name") . ':', 'right', $color[4], 'width="50"' ) . + html_tag( 'td', '', 'left', $color[4] ) + ) . "\n" . + html_tag( 'tr', "\n" . + html_tag( 'td', _("Additional info") . ':', 'right', $color[4], 'width="50"' ) . + html_tag( 'td', '', 'left', $color[4] ) + ) . "\n" . + html_tag( 'tr', "\n" . + html_tag( 'td', + '' , + 'center', $color[4], 'colspan="2"' ) + ) . "\n" . + ''; ?>