X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fmodules%2Fcrypto_badkey.mod;h=050145bb018f304488490bd36d741ecaf2fbad5c;hb=30460a05016c7e066ad7b28df7788539e4054a99;hp=ff238204842b0ae0f62655812fdab8fa178fee93;hpb=d8aa9efe1122e427f1db3736df0b6e9a4ddca831;p=squirrelmail.git
diff --git a/plugins/squirrelspell/modules/crypto_badkey.mod b/plugins/squirrelspell/modules/crypto_badkey.mod
index ff238204..050145bb 100644
--- a/plugins/squirrelspell/modules/crypto_badkey.mod
+++ b/plugins/squirrelspell/modules/crypto_badkey.mod
@@ -1,39 +1,49 @@
($Author$)
- * @version $Date$
+ * @author Konstantin Riabitsev ' . _("Your personal dictionary was erased.") . ' '
- . _("Your personal dictionary was erased. Please close this window and click \"Check Spelling\" button again to start your spellcheck over.")
- . '
' + . _("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); + +/** + * Displays information about reencrypted dictionary + * @since 1.5.1 (sqspell 0.5) + */ +function sqspell_dict_reencrypted() { + global $SCRIPT_NAME; /** * See where we are and call a necessary GUI-wrapper. - * Also dirty. TODO: Make this not dirty. + * Also dirty. + * TODO: Make this not dirty. + * TODO: add upgrade handing */ 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); + . _("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.") - . '
'; + . _("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; } +// main code +if (! $old_setup && $delete_words=='ON') { + if (sqgetGlobalVar('dict_lang',$dict_lang,SQ_POST)) { + sqspell_deleteWords($dict_lang); + sqspell_dict_deleted(); + } +} elseif ($delete_words=='ON'){ + /** + * $delete_words is passed via the query_string. If it's set, then + * the user asked to delete the file. Erase the bastard and hope + * this never happens again. + */ + sqspell_deleteWords_old(); + sqspell_dict_deleted(); +} + +if (! $old_setup && $old_key) { + if (sqgetGlobalVar('dict_lang',$dict_lang,SQ_POST)) { + $words=sqspell_getLang($dict_lang); + sqspell_writeWords($words,$dict_lang); + sqspell_dict_reencrypted(); + } +} elseif ($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_old(); + /** + * It worked! Pinky, you're a genius! + * Write it back this time encrypted with a new key. + */ + sqspell_writeWords_old($words); + sqspell_dict_reencrypted(); +} + +// TODO: handle broken calls + /** * For Emacs weenies: * Local variables: * mode: php * End: - */ -?> + * vim: syntax=php + */