Began rework of options page. Also added 3 plugins (filters, translate, and squirrels...
[squirrelmail.git] / plugins / squirrelspell / modules / crypto.mod.php
1 <?php
2
3 /**
4 CRYPTO.MOD.PHP
5 --------------
6 This module handles the encryption/decryption of the user dictionary
7 if the user so chooses from the options page.
8 **/
9 // Declaring globals for E_ALL
10 global $action, $SQSPELL_CRYPTO;
11 switch ($action){
12 case "encrypt":
13 // Let's encrypt the file.
14 $words=sqspell_getWords();
15 // flip the flag.
16 $SQSPELL_CRYPTO=true;
17 sqspell_writeWords($words);
18 $msg="<p>Your personal dictionary has been <strong>encrypted</strong> and is now stored in an <strong>encrypted format</strong>.</p>";
19 break;
20
21 case "decrypt":
22 // Decrypt the file and save plain text.
23 $words=sqspell_getWords();
24 // flip the flag.
25 $SQSPELL_CRYPTO=false;
26 sqspell_writeWords($words);
27 $msg="<p>Your personal dictionary has been <strong>decrypted</strong> and is now stored as <strong>clear text</strong>.</p>";
28 break;
29
30 case "":
31 // Wait, this shouldn't happen! :)
32 $msg = "<p>No action requested.</p>";
33 break;
34 }
35 sqspell_makePage("Personal Dictionary Crypto Settings", null, $msg);
36 ?>