7 * Copyright (c) 1999-2005 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. :(
13 * @author Konstantin Riabitsev <icon@duke.edu>
16 * @subpackage squirrelspell
21 $delete_words = $_POST['delete_words'];
22 if(isset($_POST['old_key'])) {
23 $old_key = $_POST['old_key'];
26 if ($delete_words=='ON'){
28 * $delete_words is passed via the query_string. If it's set, then
29 * the user asked to delete the file. Erase the bastard and hope
30 * this never happens again.
32 sqspell_deleteWords();
34 * See where we were called from -- pop-up window or options page
35 * and call whichever wrapper is appropriate.
36 * I agree, this is dirty. TODO: make it so it's not dirty.
38 if (strstr($SCRIPT_NAME, 'sqspell_options')){
39 $msg='<p>' . _("Your personal dictionary was erased.") . '</p>';
40 sqspell_makePage(_("Dictionary Erased"), null, $msg);
43 * The _("Your....") has to be on one line. Otherwise xgettext borks
44 * on getting the strings.
47 . _("Your personal dictionary was erased. Please close this window and click \"Check Spelling\" button again to start your spellcheck over.")
49 . '<p align="center"><form>'
50 . '<input type="button" value=" '
51 . _("Close this Window") . ' " onclick="self.close()" />'
53 sqspell_makeWindow(null, _("Dictionary Erased"), null, $msg);
60 * User provided another key to try and decrypt the dictionary.
61 * Call sqspell_getWords. If this key fails, the function will
64 $words=sqspell_getWords();
66 * It worked! Pinky, you're a genius!
67 * Write it back this time encrypted with a new key.
69 sqspell_writeWords($words);
71 * See where we are and call a necessary GUI-wrapper.
72 * Also dirty. TODO: Make this not dirty.
74 if (strstr($SCRIPT_NAME, 'sqspell_options')){
76 . _("Your personal dictionary was re-encrypted successfully. Now return to the "SpellChecker options" menu and make your selection again." )
78 sqspell_makePage(_("Successful re-encryption"), null, $msg);
81 . _("Your personal dictionary was re-encrypted successfully. Please close this window and click \"Check Spelling\" button again to start your spellcheck over.")
82 . '</p><form><p align="center"><input type="button" value=" '
83 . _("Close this Window") . ' "'
84 . 'onclick="self.close()" /></p></form>';
85 sqspell_makeWindow(null, _("Dictionary re-encrypted"), null, $msg);