Update copyrights to 2010
[squirrelmail.git] / plugins / squirrelspell / modules / enc_setup.mod
1 <?php
2
3 /**
4 * enc_setup.mod
5 *
6 * Squirrelspell module
7 *
8 * This module shows the user a nice invitation to encrypt or decypt
9 * his/her personal dictionary and explains the caveats of such a decision.
10 *
11 * @author Konstantin Riabitsev <icon at duke.edu>
12 * @copyright 1999-2010 The SquirrelMail Project Team
13 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
14 * @version $Id$
15 * @package plugins
16 * @subpackage squirrelspell
17 */
18
19 global $SQSPELL_CRYPTO;
20
21 /**
22 * Set up some i18n'able wrappers for javascript.
23 */
24 $msg = '<script type="text/javascript"><!--'."\n"
25 . 'var ui_makesel = "' . _("Please make your selection first.") . "\";\n"
26 . 'var ui_encrypt = "'
27 . _("This will encrypt your personal dictionary and store it in an encrypted format. Proceed?")
28 . "\";\n"
29 . 'var ui_decrypt = "'
30 . _("This will decrypt your personal dictionary and store it in a plain text format. Proceed?")
31 . "\";\n"
32 . "//-->\n</script>";
33
34 $crypted=false;
35 $langs=sqspell_getSettings();
36 foreach ($langs as $lang) {
37 $words=sqspell_getLang($lang);
38 if ($SQSPELL_CRYPTO) $crypted = true;
39 }
40
41 /**
42 * When getting the user dictionary, the SQSPELL_CRYPTO flag will be
43 * set to "true" if the dictionary is encrypted, or "false" if it is
44 * in plain text.
45 */
46 if ($crypted){
47 /**
48 * Current format is encrypted.
49 * Unfortunately, the following text needs to be all on one line,
50 * unless someone fixes xgettext. ;(
51 */
52 $msg .=
53 '<p>'
54 . _("Your personal dictionary is currently encrypted.")
55 . '</p><p>'
56 . _("This helps protect your privacy in case the web-mail system gets compromized and your personal dictionary ends up stolen. It is currently encrypted with the password you use to access your mailbox, making it hard for anyone to see what is stored in your personal dictionary.")
57 . '</p><p>'
58 . '<strong>' . _("ATTENTION:") . '</strong><br />'
59 . _("If you forget your password, your personal dictionary will become unaccessible, since it can no longer be decrypted. If you change your mailbox password, SquirrelSpell will recognize it and prompt you for your old password in order to re-encrypt the dictionary with a new key.")
60 . '</p>'
61 . '<form method="post" onsubmit="return checkMe()">'
62 . '<input type="hidden" name="MOD" value="crypto" />'
63 . '<p align="center"><input type="checkbox" name="encaction" '
64 . 'value="decrypt" id="action_decrypt" /> <label for="action_decrypt">'
65 . _("Please decrypt my personal dictionary and store it in a clear-text format." )
66 . '</label></p>'
67 . '<p align="center"><input type="submit" value=" '
68 . _("Change crypto settings")
69 . ' " /></p>'
70 . '</form>';
71 } else {
72 /**
73 * Current format is clear text.
74 * Unfortunately, the following text needs to be all on one line,
75 * unless someone fixes xgettext. ;(
76 */
77 $msg .=
78 '<p>'
79 . _("Your personal dictionary is currently not encrypted.")
80 . '</p><p>'
81 . _("You may wish to encrypt your personal dictionary to protect your privacy in case the webmail system gets compromized and your personal dictionary file gets stolen. When encrypted, the file's contents look garbled and are hard to decrypt without knowing the correct key (which is your mailbox password).")
82 . '</p><p>'
83 . '<strong>' . _("ATTENTION:") . '</strong><br />'
84 . _("If you decide to encrypt your personal dictionary, you must remember that it gets &quot;hashed&quot; with your mailbox password. If you forget your mailbox password and the administrator changes it to a new value, your personal dictionary will become useless and will have to be created anew. However, if you or your system administrator change your mailbox password but you still have the old password at hand, you will be able to enter the old key to re-encrypt the dictionary with the new value.")
85 . '</p>'
86 . '<form method="post" onsubmit="return checkMe()">'
87 . '<input type="hidden" name="MOD" value="crypto" />'
88 . '<p align="center"><input type="checkbox" name="encaction" '
89 . 'value="encrypt" id="action_encrypt" /> <label for="action_encrypt">'
90 . _("Please encrypt my personal dictionary and store it in an encrypted format.")
91 . '</label></p>'
92 . '<p align="center"><input type="submit" value=" '
93 . _("Change crypto settings") . ' " /></p>'
94 . '</form>';
95 }
96 sqspell_makePage(_("Personal Dictionary Crypto Settings"),
97 "crypto_settings.js", $msg);
98
99 /**
100 * For Emacs weenies:
101 * Local variables:
102 * mode: php
103 * End:
104 * vim: syntax=php
105 */