Removed warnings that were appearing
[squirrelmail.git] / plugins / squirrelspell / modules / crypto.mod.php
CommitLineData
849bdf42 1<?php
2
9804bcde 3 /**
4 ** crypto.mod.php -- Squirrelspell module
5 **
6 ** Copyright (c) 1999-2001 The SquirrelMail development team
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>' .
25 _("Your personal dictionary has been <strong>encrypted</strong> and is now stored in an <strong>encrypted format"=.
26 '</strong>.</p>';
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>' .
36 _("Your personal dictionary has been <strong>decrypted</strong> and is now stored as <strong>clear text") .
37 '</strong>.</p>';
38 break;
39
40 case "":
41 // Wait, this shouldn't happen! :)
42 $msg = "<p>No action requested.</p>";
43 break;
44 }
45 sqspell_makePage( _("Personal Dictionary Crypto Settings"), null, $msg);
849bdf42 46?>