X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fmodules%2Fcrypto.mod;h=4d2078e61f01995795f9f4e5e14fc7187bc59daf;hp=21245041ccd9bc4ef7ba41c782cf6e07a6ce62f8;hb=b71975ad40d8f150d665125b97a04fc02dd4cea9;hpb=0091d9aeba8077d25ac10b3dd8e96fd808af7f87 diff --git a/plugins/squirrelspell/modules/crypto.mod b/plugins/squirrelspell/modules/crypto.mod index 21245041..4d2078e6 100644 --- a/plugins/squirrelspell/modules/crypto.mod +++ b/plugins/squirrelspell/modules/crypto.mod @@ -1,19 +1,19 @@ ($Author$) - * @version $Date$ + * @author Konstantin Riabitsev + * @copyright © 1999-2006 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package plugins + * @subpackage squirrelspell */ /** @@ -21,45 +21,64 @@ */ global $SQSPELL_CRYPTO; -switch ($_POST['action']){ +$langs=sqspell_getSettings(); + +if (! sqgetGlobalVar('action', $crypt_action, SQ_POST)) { + $crypt_action = 'noaction'; +} + +switch ($crypt_action){ case 'encrypt': - /** - * Let's encrypt the file and save it in an encrypted format. - */ - $words=sqspell_getWords(); - /** - * Flip the flag so the sqspell_writeWords function knows to encrypt - * the message before writing it to the disk. - */ - $SQSPELL_CRYPTO=true; - /** - * Call the function that does the actual encryption_decryption. - */ - sqspell_writeWords($words); + $SQSPELL_CRYPTO_ORIG=$SQSPELL_CRYPTO; + + foreach ($langs as $lang) { + $SQSPELL_CRYPTO = $SQSPELL_CRYPTO_ORIG; + /** + * Let's encrypt the file and save it in an encrypted format. + */ + $words=sqspell_getLang($lang); + /** + * Flip the flag so the sqspell_writeWords function knows to encrypt + * the message before writing it to the disk. + */ + $SQSPELL_CRYPTO=true; + /** + * Call the function that does the actual encryption_decryption. + */ + sqspell_writeWords($words,$lang); + } $msg='

' - . _("Your personal dictionary has been encrypted and is now stored in an encrypted format.") + . _("Your personal dictionary has been encrypted and is now stored in an encrypted format.") . '

'; break; case 'decrypt': - /** - * Let's decrypt the file and save it as plain text. - */ - $words=sqspell_getWords(); - /** - * Flip the flag and tell the sqspell_writeWords() function that we - * want to save it plaintext. - */ - $SQSPELL_CRYPTO=false; - sqspell_writeWords($words); + $SQSPELL_CRYPTO_ORIG=$SQSPELL_CRYPTO; + + foreach ($langs as $lang) { + $SQSPELL_CRYPTO = $SQSPELL_CRYPTO_ORIG; + /** + * Let's encrypt the file and save it in an encrypted format. + */ + $words=sqspell_getLang($lang); + /** + * Flip the flag so the sqspell_writeWords function knows to decrypt + * the message before writing it to the disk. + */ + $SQSPELL_CRYPTO=false; + /** + * Call the function that does the actual encryption_decryption. + */ + sqspell_writeWords($words,$lang); + } $msg='

' . _("Your personal dictionary has been decrypted and is now stored as plain text.") . '

'; break; - case '': + default: /** * Wait, this shouldn't happen! :) */ - $msg = '

No action requested.

'; + $msg = '

'._("No action requested.").'

'; break; } sqspell_makePage( _("Personal Dictionary Crypto Settings"), null, $msg); @@ -71,5 +90,3 @@ sqspell_makePage( _("Personal Dictionary Crypto Settings"), null, $msg); * End: * vim: syntax=php */ - -?>