7 * Copyright (c) 1999-2005 The SquirrelMail Project Team
8 * Licensed under the GNU GPL. For full terms see the file COPYING.
10 * This module handles the encryption/decryption of the user dictionary
11 * if the user so chooses from the options page.
13 * @author Konstantin Riabitsev <icon@duke.edu>
16 * @subpackage squirrelspell
20 * Declaring globals for E_ALL
22 global $SQSPELL_CRYPTO;
24 switch ($_POST['action']){
27 * Let's encrypt the file and save it in an encrypted format.
29 $words=sqspell_getWords();
31 * Flip the flag so the sqspell_writeWords function knows to encrypt
32 * the message before writing it to the disk.
36 * Call the function that does the actual encryption_decryption.
38 sqspell_writeWords($words);
40 . _("Your personal dictionary has been encrypted and is now stored in an encrypted format.")
45 * Let's decrypt the file and save it as plain text.
47 $words=sqspell_getWords();
49 * Flip the flag and tell the sqspell_writeWords() function that we
50 * want to save it plaintext.
52 $SQSPELL_CRYPTO=false;
53 sqspell_writeWords($words);
55 . _("Your personal dictionary has been decrypted and is now stored as plain text.")
60 * Wait, this shouldn't happen! :)
62 $msg = '<p>No action requested.</p>';
65 sqspell_makePage( _("Personal Dictionary Crypto Settings"), null, $msg);