849bdf42 |
1 | <?php |
2 | |
9804bcde |
3 | /** |
4 | ** crypto.mod.php -- Squirrelspell module |
5 | ** |
15e6162e |
6 | ** Copyright (c) 1999-2002 The SquirrelMail development team |
9804bcde |
7 | ** Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | ** |
9 | ** This module handles the encryption/decryption of the user dictionary |
10 | ** if the user so chooses from the options page. |
11 | ** |
12 | ** $Id$ |
13 | **/ |
849bdf42 |
14 | |
9804bcde |
15 | // Declaring globals for E_ALL |
16 | global $action, $SQSPELL_CRYPTO; |
17 | switch ($action){ |
18 | case 'encrypt': |
19 | // Let's encrypt the file. |
20 | $words=sqspell_getWords(); |
21 | // flip the flag. |
22 | $SQSPELL_CRYPTO=true; |
23 | sqspell_writeWords($words); |
24 | $msg='<p>' . |
38a7b6a0 |
25 | _("Your personal dictionary has been <strong>encrypted</strong> and is now stored in an <strong>encrypted format</strong>."). |
26 | '</p>'; |
9804bcde |
27 | break; |
28 | |
29 | case 'decrypt': |
30 | // Decrypt the file and save plain text. |
31 | $words=sqspell_getWords(); |
32 | // flip the flag. |
33 | $SQSPELL_CRYPTO=false; |
34 | sqspell_writeWords($words); |
35 | $msg='<p>' . |
38a7b6a0 |
36 | _("Your personal dictionary has been <strong>decrypted</strong> and is now stored as <strong>clear text</strong>.") . '</p>'; |
9804bcde |
37 | break; |
38 | |
39 | case "": |
40 | // Wait, this shouldn't happen! :) |
41 | $msg = "<p>No action requested.</p>"; |
42 | break; |
43 | } |
44 | sqspell_makePage( _("Personal Dictionary Crypto Settings"), null, $msg); |
849bdf42 |
45 | ?> |