From 01265fbab60e51c5d97f55cfefe5888abb383ae9 Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Thu, 14 Feb 2002 06:12:51 +0000 Subject: [PATCH] Added signature into multiple identities. Code by: Stefan Meier git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2442 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- AUTHORS | 1 + ChangeLog | 9 ++--- functions/abook_local_file.php | 1 + functions/file_prefs.php | 10 +++--- src/compose.php | 19 ++++++++++ src/load_prefs.php | 6 +--- src/options_identities.php | 64 ++++++++++++++++++++++++++-------- src/options_personal.php | 29 +++++++-------- 8 files changed, 97 insertions(+), 42 deletions(-) diff --git a/AUTHORS b/AUTHORS index 2557a048..9f7116b8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -78,6 +78,7 @@ i18n support: Sergiusz Pawlowicz SquirrelMail logo: Libor Kopecky Web Site Admin/PR: Rick Castello + Multisig support: Stefan Meier Paginator Help: Charles Scheidecker Other Code contributions: diff --git a/ChangeLog b/ChangeLog index ad4f958e..7d05102e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,7 @@ Version 1.2.5 -- CVS -------------------- - - Added the possibility to add special folders through plugins. + - Added the ability to add special folders through plugins. - Made searching on multiple criteria possible, with thanks to Jason Munro - Fixed 'list all' in addressbook (#506624, thanks to Kurt Yoder) - Fixed small bugs in db_prefs @@ -18,15 +18,16 @@ Version 1.2.5 -- CVS - conf.pl can now configure database backed address books and preferences. - Version 0.3.7 of SquirrelSpell. Fixes a potential privacy - vulnerability (symlink attack), plus introduces formatting fixes + vulnerability (symlink attack), plus introduces formatting fixes and javadoc-style comments. - Bugfix in mailfetch reported by Mateusz Mazur - Administrator plugin. A web based conf.pl replacement. - Removed GLOBALS from conf.pl - HTML messages optimization. - - Added support for requesting read receipts (MDN) and delivery receipts. + - Added support for requesting read receipts (MDN) and delivery receipts. - Added the ability to stop users changing their names and email addresses. - + - Added signature into multiple identities (Stefan Meier ) + Version 1.2.4 -- 25 January 2002 -------------------------------- - Fixes a nasty remote arbitrary command execution vulnerability diff --git a/functions/abook_local_file.php b/functions/abook_local_file.php index 904893e4..b91af2bc 100644 --- a/functions/abook_local_file.php +++ b/functions/abook_local_file.php @@ -134,6 +134,7 @@ class abook_local_file extends addressbook_backend { /* Overwrite the file with data from $rows * NOTE! Previous locks are broken by this function */ function overwrite(&$rows) { + $this->unlock(); $newfh = @fopen($this->filename, 'w'); if(!$newfh) { return $this->set_error("$file: " . _("Open failed")); diff --git a/functions/file_prefs.php b/functions/file_prefs.php index 74bf5bdd..d52560a8 100644 --- a/functions/file_prefs.php +++ b/functions/file_prefs.php @@ -175,8 +175,8 @@ function checkForPrefs($data_dir, $username, $filename = '') { /** * Write the User Signature. */ -function setSig($data_dir, $username, $value) { - $filename = getHashedFile($username, $data_dir, "$username.sig"); +function setSig($data_dir, $username, $number, $value) { + $filename = getHashedFile($username, $data_dir, "$username.si$number"); $file = fopen($filename, 'w'); fwrite($file, $value); fclose($file); @@ -185,9 +185,9 @@ function setSig($data_dir, $username, $value) { /** * Get the signature. */ -function getSig($data_dir, $username) { - #$filename = $data_dir . $username . '.sig'; - $filename = getHashedFile($username, $data_dir, "$username.sig"); +function getSig($data_dir, $username, $number) { + #$filename = $data_dir . $username . '.si$number'; + $filename = getHashedFile($username, $data_dir, "$username.si$number"); $sig = ''; if (file_exists($filename)) { $file = fopen($filename, 'r'); diff --git a/src/compose.php b/src/compose.php index c8a3b160..d25a9e39 100644 --- a/src/compose.php +++ b/src/compose.php @@ -213,6 +213,24 @@ if (isset($send)) { displayPageHeader($color, $mailbox); } showInputForm(); +} +elseif (isset($sigappend)) { + $idents = getPref($data_dir, $username, 'identities', 0); + if ($idents > 1) { + if ($identity == 'default') { + $no = 'g'; + } else { + $no = $identity; + } + $signature = getSig($data_dir, $username, $no); + } + $body .= "\n\n".($prefix_sig==true? "-- \n":'').$signature; + if ($compose_new_win == '1') { + compose_Header($color, $mailbox); + } else { + displayPageHeader($color, $mailbox); + } + showInputForm(); } elseif (isset($do_delete)) { if ($compose_new_win == '1') { compose_Header($color, $mailbox); @@ -674,6 +692,7 @@ function showComposeButtonRow() { } echo " \n \n"; + echo "\n \n"; if ($use_javascript_addr_book) { echo "