X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fmodules%2Fcrypto_badkey.mod.php;h=3acb2f55acb550e86f2ace73d59e91ba8881e3d6;hp=2fd94091d6b9d2f06977e145065b81e77527f44e;hb=2b5a715784c5414a95c4eba8b20e3dd47f45131b;hpb=48a8f454eb431c08105a90fc92c720d406e2d8f1 diff --git a/plugins/squirrelspell/modules/crypto_badkey.mod.php b/plugins/squirrelspell/modules/crypto_badkey.mod.php index 2fd94091..3acb2f55 100644 --- a/plugins/squirrelspell/modules/crypto_badkey.mod.php +++ b/plugins/squirrelspell/modules/crypto_badkey.mod.php @@ -1,54 +1,64 @@ Your personal dictionary was erased.

"; - sqspell_makePage("Dictionary Erased", null, $msg); - } else { - $msg = "

Your personal dictionary was erased. Please close this window and - click \"Check Spelling\" button again to start your spellcheck over.

-

- -

"; - sqspell_makeWindow(null, "Dictionary Erased", null, $msg); - } - exit; - } - if ($old_key){ - // User provided another key to try and decrypt the dictionary. - // call sqspell_getWords. If this key fails, the function will - // handle it. - $words=sqspell_getWords(); - // It worked! Pinky, you're a genius! - // Write it back this time encrypted with a new key. - sqspell_writeWords($words); - // See where we are and call a necessary GUI-wrapper. - if (strstr($SCRIPT_NAME, "sqspell_options")){ - $msg="

Your personal dictionary was re-encrypted successfully. Now - return to the "SpellChecker options" menu and make your selection - again.

"; - sqspell_makePage("Successful Re-encryption", null, $msg); - } else { - $msg = "

Your personal dictionary was re-encrypted successfully. Please - close this window and click \"Check Spelling\" button again to start your - spellcheck over.

-

"; - sqspell_makeWindow(null, "Dictionary re-encrypted", null, $msg); - } - exit; - } -?> + /** + ** CRYPTO_BADKEY.MOD.PHP -- Squirrelspell module + ** + ** Copyright (c) 1999-2001 The SquirrelMail development team + ** Licensed under the GNU GPL. For full terms see the file COPYING. + ** + ** This module tries to decrypt the user dictionary with a newly provided + ** old password, or erases the file if everything else fails. :( + ** + ** $Id$ + **/ + + // Just for fidian! :) + global $delete_words, $SCRIPT_NAME, $old_key; + if ($delete_words=='ON'){ + // All attemts to decrypt the file were futile. Erase the bastard and + // hope this never happens again. + sqspell_deleteWords(); + // See where we were called from -- pop-up window or options page + // and call whichever wrapper is appropriate. + if (strstr($SCRIPT_NAME, 'sqspell_options')){ + $msg='

' . _("Your personal dictionary was erased.") . '

'; + sqspell_makePage(_("Dictionary Erased"), null, $msg); + } else { + $msg = '

' . ("Your personal dictionary was erased. Please close this window and click \"Check Spelling\" button again to start your spellcheck over." ) . + '

'. + '

'. + ''. + '

'; + sqspell_makeWindow(null, _("Dictionary Erased"), null, $msg); + } + exit; + } + + if ($old_key){ + // User provided another key to try and decrypt the dictionary. + // call sqspell_getWords. If this key fails, the function will + // handle it. + $words=sqspell_getWords(); + // It worked! Pinky, you're a genius! + // Write it back this time encrypted with a new key. + sqspell_writeWords($words); + // See where we are and call a necessary GUI-wrapper. + if (strstr($SCRIPT_NAME, 'sqspell_options')){ + $msg = '

' . + _("Your personal dictionary was re-encrypted successfully. Now " + "return to the "SpellChecker options" menu and make your selection " + "again." ) . '

'; + sqspell_makePage(_("Successful Re-encryption"), null, $msg); + } else { + $msg = '

'. + _("Your personal dictionary was re-encrypted successfully. Please " + "close this window and click \"Check Spelling\" button again to start your " + "spellcheck over.") . '

' . + '

'; + sqspell_makeWindow(null, _("Dictionary re-encrypted"), null, $msg); + } + exit; + } + +?> \ No newline at end of file