Back to "SpellChecker Options" page |
SquirrelSpell |
SquirrelSpell |
ATTENTION:
SquirrelSpell was unable to decrypt your personal dictionary. This is most likely
due to the fact that you have changed your mailbox password. In order to proceed,
you will have to supply your old password so that SquirrelSpell can decrypt your
personal dictionary. It will be re-encrypted with your new password after this.
If you haven't encrypted your dictionary, then it got mangled and is no longer
valid. You will have to delete it and start anew. This is also true if you don't
remember your old password -- without it, the encrypted data is no longer
accessible.
"; // See if this happened in the pop-up window or when accessing // the SpellChecker options page. global $SCRIPT_NAME; if (strstr($SCRIPT_NAME, "sqspell_options")) sqspell_makePage("Error Decrypting Dictionary", "decrypt_error.js", $msg); else sqspell_makeWindow(null, "Error Decrypting Dictionary", "decrypt_error.js", $msg); exit; } else { // OK! Phew. Set the encryption flag to true so we can later on // encrypt it again before saving to HDD. $SQSPELL_CRYPTO=true; } } else { // No encryption is used. Set $SQSPELL_CRYPTO to false, in case we have to // save the dictionary later. $SQSPELL_CRYPTO=false; } // Check if we need to upgrade the dictionary from version 0.2.x if (strstr($words, "Dictionary v0.2")) $words=sqspell_upgradeWordsFile($words); return $words; } function sqspell_writeWords($words){ // // Writes user dictionary into the $username.words file, then changes mask // to 0600. If encryption is needed -- does that, too. // global $SQSPELL_WORDS_FILE, $SQSPELL_CRYPTO; // if $words is empty, create a template entry. if (!$words) $words=sqspell_makeDummy(); if ($SQSPELL_CRYPTO){ // User wants to encrypt the file. So be it. // get his password to use as a key. global $key, $onetimepad; $clear_key=OneTimePadDecrypt($key, $onetimepad); // Try encrypting it. If fails, scream bloody hell. $save_words = sqspell_crypto("encrypt", $clear_key, $words); if ($save_words=="PANIC"){ // AAAAAAAAH! I'm not handling this yet, since obviously // the admin of the site forgot to compile the MCRYPT support in. // I will add a handler for this case later, when I can come up // with some work-around... Right now, do nothing. Let the Admin's // head hurt.. ;))) } } else { $save_words = $words; } $fp=fopen($SQSPELL_WORDS_FILE, "w"); fwrite($fp, $save_words); fclose($fp); chmod($SQSPELL_WORDS_FILE, 0600); } function sqspell_deleteWords(){ // // so I open the door to my enemies, // and I ask can we wipe the slate clean, // but they tell me to please go... // uhm... Well, this just erases the user dictionary file. // global $SQSPELL_WORDS_FILE; if (file_exists($SQSPELL_WORDS_FILE)) unlink($SQSPELL_WORDS_FILE); } function sqspell_makeDummy(){ // // Creates an empty user dictionary for the sake of saving prefs or // whatever. // global $SQSPELL_VERSION, $SQSPELL_APP_DEFAULT; $words="# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: $SQSPELL_APP_DEFAULT\n# End\n"; return $words; } /** VERSION: --------- SquirrelSpell version. Don't modify, since it identifies the format of the user dictionary files and messing with this can do ugly stuff. :) **/ $SQSPELL_VERSION="v0.3.5"; ?>