<?php
+
/**
* enc_setup.mod
- * --------------
- * Squirrelspell module
*
- * Copyright (c) 1999-2004 The SquirrelMail development team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
+ * Squirrelspell module
*
- * This module shows the user a nice invitation to encrypt or decypt
- * his/her personal dictionary and explains the caveats of such a decision.
+ * This module shows the user a nice invitation to encrypt or decypt
+ * his/her personal dictionary and explains the caveats of such a decision.
*
- * @author Konstantin Riabitsev <icon@duke.edu>
+ * @author Konstantin Riabitsev <icon at duke.edu>
+ * @copyright 1999-2020 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package plugins
* @subpackage squirrelspell
*/
-global $SQSPELL_CRYPTO;
+global $SQSPELL_CRYPTO;
/**
* Set up some i18n'able wrappers for javascript.
*/
$msg = '<script type="text/javascript"><!--'."\n"
. 'var ui_makesel = "' . _("Please make your selection first.") . "\";\n"
- . 'var ui_encrypt = "'
- . _("This will encrypt your personal dictionary and store it in an encrypted format. Proceed?")
+ . 'var ui_encrypt = "'
+ . _("This will encrypt your personal dictionary and store it in an encrypted format. Proceed?")
. "\";\n"
. 'var ui_decrypt = "'
. _("This will decrypt your personal dictionary and store it in a plain text format. Proceed?")
. "\";\n"
. "//-->\n</script>";
-$words=sqspell_getWords();
+$crypted=false;
+$langs=sqspell_getSettings();
+foreach ($langs as $lang) {
+ $words=sqspell_getLang($lang);
+ if ($SQSPELL_CRYPTO) $crypted = true;
+}
+
/**
* When getting the user dictionary, the SQSPELL_CRYPTO flag will be
* set to "true" if the dictionary is encrypted, or "false" if it is
* in plain text.
*/
-if ($SQSPELL_CRYPTO){
+if ($crypted){
/**
* Current format is encrypted.
* Unfortunately, the following text needs to be all on one line,
. '</p>'
. '<form method="post" onsubmit="return checkMe()">'
. '<input type="hidden" name="MOD" value="crypto" />'
- . '<p align="center"><input type="checkbox" name="action" '
- . 'value="decrypt" /> '
+ . '<p align="center"><input type="checkbox" name="encaction" '
+ . 'value="decrypt" id="action_decrypt" /> <label for="action_decrypt">'
. _("Please decrypt my personal dictionary and store it in a clear-text format." )
- . '</p>'
+ . '</label></p>'
. '<p align="center"><input type="submit" value=" '
. _("Change crypto settings")
. ' " /></p>'
. '</p>'
. '<form method="post" onsubmit="return checkMe()">'
. '<input type="hidden" name="MOD" value="crypto" />'
- . '<p align="center"><input type="checkbox" name="action" '
- . 'value="encrypt" /> '
+ . '<p align="center"><input type="checkbox" name="encaction" '
+ . 'value="encrypt" id="action_encrypt" /> <label for="action_encrypt">'
. _("Please encrypt my personal dictionary and store it in an encrypted format.")
- . '</p>'
+ . '</label></p>'
. '<p align="center"><input type="submit" value=" '
. _("Change crypto settings") . ' " /></p>'
. '</form>';
}
-sqspell_makePage(_("Personal Dictionary Crypto Settings"),
- "crypto_settings.js", $msg);
+sqspell_makePage(_("Personal Dictionary Crypto Settings"),
+ "crypto_settings.js", $msg);
/**
* For Emacs weenies:
* mode: php
* End:
* vim: syntax=php
- */
-
-?>
\ No newline at end of file
+ */