-switch ($_POST['action']){
- case 'encrypt':
- /**
- * Let's encrypt the file and save it in an encrypted format.
- */
- $words=sqspell_getWords();
- /**
- * Flip the flag so the sqspell_writeWords function knows to encrypt
- * the message before writing it to the disk.
- */
- $SQSPELL_CRYPTO=true;
- /**
- * Call the function that does the actual encryption_decryption.
- */
- sqspell_writeWords($words);
- $msg='<p>'
- . _("Your personal dictionary has been <strong>encrypted</strong> and is now stored in an <strong>encrypted format</strong>.")
- . '</p>';
- break;
- case 'decrypt':
- /**
- * Let's decrypt the file and save it as plain text.
- */
- $words=sqspell_getWords();
- /**
- * Flip the flag and tell the sqspell_writeWords() function that we
- * want to save it plaintext.
- */
- $SQSPELL_CRYPTO=false;
- sqspell_writeWords($words);
- $msg='<p>'
- . _("Your personal dictionary has been <strong>decrypted</strong> and is now stored as <strong>clear text</strong>.")
- . '</p>';
- break;
-
- case "":
- /**
- * Wait, this shouldn't happen! :)
- */
- $msg = "<p>No action requested.</p>";
- break;
+$langs=sqspell_getSettings();
+
+if (! sqgetGlobalVar('encaction', $crypt_action, SQ_POST)) {
+ $crypt_action = 'noaction';
+}
+
+switch ($crypt_action){
+ case 'encrypt':
+ $SQSPELL_CRYPTO_ORIG=$SQSPELL_CRYPTO;
+
+ foreach ($langs as $lang) {
+ $SQSPELL_CRYPTO = $SQSPELL_CRYPTO_ORIG;
+ /**
+ * Let's encrypt the file and save it in an encrypted format.
+ */
+ $words=sqspell_getLang($lang);
+ /**
+ * Flip the flag so the sqspell_writeWords function knows to encrypt
+ * the message before writing it to the disk.
+ */
+ $SQSPELL_CRYPTO=true;
+ /**
+ * Call the function that does the actual encryption_decryption.
+ */
+ sqspell_writeWords($words,$lang);
+ }
+ $msg='<p>'
+ . _("Your personal dictionary has been encrypted and is now stored in an encrypted format.")
+ . '</p>';
+ break;
+ case 'decrypt':
+ $SQSPELL_CRYPTO_ORIG=$SQSPELL_CRYPTO;
+
+ foreach ($langs as $lang) {
+ $SQSPELL_CRYPTO = $SQSPELL_CRYPTO_ORIG;
+ /**
+ * Let's encrypt the file and save it in an encrypted format.
+ */
+ $words=sqspell_getLang($lang);
+ /**
+ * Flip the flag so the sqspell_writeWords function knows to decrypt
+ * the message before writing it to the disk.
+ */
+ $SQSPELL_CRYPTO=false;
+ /**
+ * Call the function that does the actual encryption_decryption.
+ */
+ sqspell_writeWords($words,$lang);
+ }
+ $msg='<p>'
+ . _("Your personal dictionary has been decrypted and is now stored as plain text.")
+ . '</p>';
+ break;
+ default:
+ /**
+ * Wait, this shouldn't happen! :)
+ */
+ $msg = '<p>'._("No action requested.").'</p>';
+ break;