7 * Copyright (c) 1999-2002 The SquirrelMail development team
8 * Licensed under the GNU GPL. For full terms see the file COPYING.
10 * This module tries to decrypt the user dictionary with a newly provided
11 * old password, or erases the file if everything else fails. :(
15 * @author Konstantin Riabitsev <icon@duke.edu> ($Author$)
19 global $delete_words, $SCRIPT_NAME, $old_key;
20 if ($delete_words=='ON'){
22 * $delete_words is passed via the query_string. If it's set, then
23 * the user asked to delete the file. Erase the bastard and hope
24 * this never happens again.
26 sqspell_deleteWords();
28 * See where we were called from -- pop-up window or options page
29 * and call whichever wrapper is appropriate.
30 * I agree, this is dirty. TODO: make it so it's not dirty.
32 if (strstr($SCRIPT_NAME, 'sqspell_options')){
33 $msg='<p>' . _("Your personal dictionary was erased.") . '</p>';
34 sqspell_makePage(_("Dictionary Erased"), null, $msg);
37 * The _("Your....") has to be on one line. Otherwise xgettext borks
38 * on getting the strings.
41 . _("Your personal dictionary was erased. Please close this window and click \"Check Spelling\" button again to start your spellcheck over.")
43 . '<p align="center"><form>'
44 . '<input type="button" value=" '
45 . _("Close this Window") . ' " onclick="self.close()">'
47 sqspell_makeWindow(null, _("Dictionary Erased"), null, $msg);
54 * User provided another key to try and decrypt the dictionary.
55 * Call sqspell_getWords. If this key fails, the function will
58 $words=sqspell_getWords();
60 * It worked! Pinky, you're a genius!
61 * Write it back this time encrypted with a new key.
63 sqspell_writeWords($words);
65 * See where we are and call a necessary GUI-wrapper.
66 * Also dirty. TODO: Make this not dirty.
68 if (strstr($SCRIPT_NAME, 'sqspell_options')){
70 . _("Your personal dictionary was re-encrypted successfully. Now return to the "SpellChecker options" menu and make your selection again." )
72 sqspell_makePage(_("Successful Re-encryption"), null, $msg);
75 . _("Your personal dictionary was re-encrypted successfully. Please close this window and click \"Check Spelling\" button again to start your spellcheck over.")
76 . '</p><form><p align="center"><input type="button" value=" '
77 . _("Close this Window") . ' "'
78 . 'onclick="self.close()"></p></form>';
79 sqspell_makeWindow(null, _("Dictionary re-encrypted"), null, $msg);