8 * This module handles the encryption/decryption of the user dictionary
9 * if the user so chooses from the options page.
11 * @author Konstantin Riabitsev <icon at duke.edu>
12 * @copyright 1999-2020 The SquirrelMail Project Team
13 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
16 * @subpackage squirrelspell
20 * Declaring globals for E_ALL
22 global $SQSPELL_CRYPTO;
24 $langs=sqspell_getSettings();
26 if (! sqgetGlobalVar('encaction', $crypt_action, SQ_POST)) {
27 $crypt_action = 'noaction';
30 switch ($crypt_action){
32 $SQSPELL_CRYPTO_ORIG=$SQSPELL_CRYPTO;
34 foreach ($langs as $lang) {
35 $SQSPELL_CRYPTO = $SQSPELL_CRYPTO_ORIG;
37 * Let's encrypt the file and save it in an encrypted format.
39 $words=sqspell_getLang($lang);
41 * Flip the flag so the sqspell_writeWords function knows to encrypt
42 * the message before writing it to the disk.
46 * Call the function that does the actual encryption_decryption.
48 sqspell_writeWords($words,$lang);
51 . _("Your personal dictionary has been encrypted and is now stored in an encrypted format.")
55 $SQSPELL_CRYPTO_ORIG=$SQSPELL_CRYPTO;
57 foreach ($langs as $lang) {
58 $SQSPELL_CRYPTO = $SQSPELL_CRYPTO_ORIG;
60 * Let's encrypt the file and save it in an encrypted format.
62 $words=sqspell_getLang($lang);
64 * Flip the flag so the sqspell_writeWords function knows to decrypt
65 * the message before writing it to the disk.
67 $SQSPELL_CRYPTO=false;
69 * Call the function that does the actual encryption_decryption.
71 sqspell_writeWords($words,$lang);
74 . _("Your personal dictionary has been decrypted and is now stored as plain text.")
79 * Wait, this shouldn't happen! :)
81 $msg = '<p>'._("No action requested.").'</p>';
84 sqspell_makePage( _("Personal Dictionary Crypto Settings"), null, $msg);