SquirrelSpell-v0.3.1
---------------------
-Untar SquirrelSpell into your squirrelmail/plugins directory. Move
-sqspell_config.dist to sqspell_config.php if this is a fresh install. If
-upgrading, just untar over your old installation.
-
-Modify the sqspell_config.php file making sure you have ispell or aspell
+Untar SquirrelSpell into your squirrelmail/plugins directory. Modify the
+sqspell_config.php file making sure you have ispell or aspell
available on your system and located in PHP's path. The squirrelspell
doesn't check for that and if it is not available, you're just going to
get a "No errors found" message every time. :) Quite pleasing, but not
Enjoy and report bugs. ;)
-This is a commented sqspell_config.php
+This is an options commented sqspell_config.php
<?php
<?php
-/**
- CRYPTO_BADKEY.MOD.PHP
- ---------------------
- This module tries to decrypt the user dictionary with a newly provided
- old password, or erases the file if everything else fails. :(
- **/
- // 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="<p>Your personal dictionary was erased.</p>";
- sqspell_makePage("Dictionary Erased", null, $msg);
- } else {
- $msg = "<p>Your personal dictionary was erased. Please close this window and
- click \"Check Spelling\" button again to start your spellcheck over.</p>
- <p align=\"center\"><form>
- <input type=\"button\" value=\" Close this Window \" onclick=\"self.close()\">
- </form></p>";
- 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="<p>Your personal dictionary was re-encrypted successfully. Now
- return to the "SpellChecker options" menu and make your selection
- again.</p>";
- sqspell_makePage("Successful Re-encryption", null, $msg);
- } else {
- $msg = "<p>Your personal dictionary was re-encrypted successfully. Please
- close this window and click \"Check Spelling\" button again to start your
- spellcheck over.</p>
- <form><p align=\"center\"><input type=\"button\" value=\" Close this Window \"
- onclick=\"self.close()\"></p></form>";
- 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='<p>' . _("Your personal dictionary was erased.") . '</p>';
+ sqspell_makePage(_("Dictionary Erased"), null, $msg);
+ } else {
+ $msg = '<p>' . ("Your personal dictionary was erased. Please close this window and click \"Check Spelling\" button again to start your spellcheck over." ) .
+ '</p> '.
+ '<p align="center"><form>'.
+ '<input type="button" value=" ' _("Close this Window") . ' " onclick="self.close()">'.
+ '</form></p>';
+ 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 = '<p>' .
+ _("Your personal dictionary was re-encrypted successfully. Now "
+ "return to the "SpellChecker options" menu and make your selection "
+ "again." ) . '</p>';
+ sqspell_makePage(_("Successful Re-encryption"), null, $msg);
+ } else {
+ $msg = '<p>'.
+ _("Your personal dictionary was re-encrypted successfully. Please "
+ "close this window and click \"Check Spelling\" button again to start your "
+ "spellcheck over.") . '</p>' .
+ '<form><p align="center"><input type="button" value=" ' . _("Close this Window") . ' "'.
+ 'onclick="self.close()"></p></form>';
+ sqspell_makeWindow(null, _("Dictionary re-encrypted"), null, $msg);
+ }
+ exit;
+ }
+
+?>
\ No newline at end of file
<?php
-/**
- EDIT_DIC.MOD.PHP
- ----------------
- This module displays the words in your dictionary for editing.
- **/
- // fidian, you owe me a pack of Guinness! :)
- global $color;
- $words=sqspell_getWords();
- if (!$words){
- // Agt. Smith: "You're empty."
- // Neo: "So are you."
- sqspell_makePage("Personal Dictionary", null, "<p>No words in your personal dictionary.</p>");
- } else {
- // We're loaded with booty.
- $pre_msg = "<p>Please check any words you wish to delete from your dictionary.</p>\n";
- $pre_msg .= "<table border=\"0\" width=\"95%\" align=\"center\">\n";
- $langs=sqspell_getSettings($words);
- for ($i=0; $i<sizeof($langs); $i++){
- $lang_words = sqspell_getLang($words, $langs[$i]);
- if ($lang_words){
- // No words in this dictionary.
- if (!$msg) $msg = $pre_msg;
- $msg .= "<tr bgcolor=\"$color[0]\" align=\"center\"><th>$langs[$i] dictionary</th></tr>
- <tr><td align=\"center\">
- <form method=\"post\">
- <input type=\"hidden\" name=\"MOD\" value=\"forget_me\">
- <input type=\"hidden\" name=\"sqspell_use_app\" value=\"$langs[$i]\">
- <table border=\"0\" width=\"95%\" align=\"center\">
- <tr>
- <td valign=\"top\">\n";
- $words_ary=explode("\n", $lang_words);
- array_pop($words_ary);
- array_shift($words_ary);
- // Do some fancy stuff to separate the words into three columns.
- for ($j=0; $j<sizeof($words_ary); $j++){
- if ($j==intval(sizeof($words_ary)/3) || $j==intval(sizeof($words_ary)/3*2))
- $msg .= "</td><td valign=\"top\">\n";
- $msg .= "<input type=\"checkbox\" name=\"words_ary[]\" value=\"$words_ary[$j]\"> $words_ary[$j]<br>";
+
+ /**
+ ** EDIT_DIC.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 handles the encryption/decryption of the user dictionary
+ ** if the user so chooses from the options page.
+ **
+ ** $Id$
+ **/
+
+ // fidian, you owe me a pack of Guinness! :)
+ global $color;
+ $words=sqspell_getWords();
+ if (!$words){
+ // Agt. Smith: "You're empty."
+ // Neo: "So are you."
+ sqspell_makePage(_("Personal Dictionary"), null, '<p>' . _("No words in your personal dictionary.") . '</p>');
+ } else {
+ // We're loaded with booty.
+ $pre_msg = '<p>' . _("Please check any words you wish to delete from your dictionary.") . "</p>\n";
+ $pre_msg .= "<table border=\"0\" width=\"95%\" align=\"center\">\n";
+ $langs=sqspell_getSettings($words);
+ for ($i=0; $i<sizeof($langs); $i++){
+ $lang_words = sqspell_getLang($words, $langs[$i]);
+ if ($lang_words){
+ // No words in this dictionary.
+ if (!$msg) {
+ $msg = $pre_msg;
+ }
+ $msg .= "<tr bgcolor=\"$color[0]\" align=\"center\"><th>" .
+ sprintf( _("%s dictionary"), $langs[$i] ) . '</th></tr>'.
+ '<tr><td align="center">'.
+ '<form method="post">'.
+ '<input type="hidden" name="MOD" value="forget_me">'.
+ '<input type="hidden" name="sqspell_use_app" value="' . $langs[$i] . '">'.
+ '<table border="0" width="95%" align="center">'.
+ '<tr>'.
+ "<td valign=\"top\">\n";
+ $words_ary=explode("\n", $lang_words);
+ array_pop($words_ary);
+ array_shift($words_ary);
+ // Do some fancy stuff to separate the words into three columns.
+ for ($j=0; $j<sizeof($words_ary); $j++){
+ if ($j==intval(sizeof($words_ary)/3) || $j==intval(sizeof($words_ary)/3*2))
+ $msg .= "</td><td valign=\"top\">\n";
+ $msg .= "<input type=\"checkbox\" name=\"words_ary[]\" value=\"$words_ary[$j]\"> $words_ary[$j]<br>";
+ }
+ $msg .= '</td></tr></table></td></tr>' .
+ "<tr bgcolor=\"$color[0]\" align=\"center\"><td>".
+ '<input type="submit" value="' . _("Delete checked words") . '"></form>'.
+ '</td></tr><tr><td><hr>'.
+ "</td></tr>\n";
+ }
}
- $msg .= "</td>
- </tr>
- </table>
- </td></tr>
- <tr bgcolor=\"$color[0]\" align=\"center\"><td>
- <input type=\"submit\" value=\"Delete checked words\"></form>
- </td></tr><tr><td><hr>
- </td></tr>\n";
- }
- }
- // Check if all dictionaries were empty.
- if (!$msg)
- $msg = "<p>No words in your dictionary.</p>";
- else $msg .= "</table>";
- sqspell_makePage("Edit your Personal Dictionary", null, $msg);
- }
-?>
+ // Check if all dictionaries were empty.
+ if (!$msg) {
+ $msg = '<p>' . _("No words in your personal dictionary.") . '</p>';
+ } else {
+ $msg .= '</table>';
+ }
+ sqspell_makePage(_("Edit your Personal Dictionary"), null, $msg);
+ }
+
+?>
\ No newline at end of file
<?php
-/**
- ENC_SETUP.MOD.PHP
- -----------------
- This module shows the user a nice invitation to encrypt or decypt
- his/her personal dictionary and explains the caveats of such a decision.
- **/
-// Something for our friends with E_ALL for error_reporting:
-global $SQSPELL_CRYPTO;
-$words=sqspell_getWords();
-if ($SQSPELL_CRYPTO){
- // Current format is encrypted.
- $msg = "<p>Your personal dictionary is <strong>currently encrypted</strong>. This
- helps protect your privacy in case the web-mail system gets compromized and your
- personal dictionary ends up stolen. It is currently encrypted with the password
- you use to access your mailbox, making it hard for anyone to see what is stored
- in your personal dictionary.</p>
- <p><strong>ATTENTION:</strong> If you forget your password, your personal dictionary
- will become unaccessible, since it can no longer be decrypted.
- If you change your mailbox password, SquirrelSpell will recognize it and prompt you for
- your old password in order to re-encrypt the dictionary with a new key.</p>
- <form method=\"post\" onsubmit=\"return checkMe()\">
- <input type=\"hidden\" name=\"MOD\" value=\"crypto\">
- <p align=\"center\"><input type=\"checkbox\" name=\"action\" value=\"decrypt\"> Please decrypt my personal
- dictionary and store it in a clear-text format.</p>
- <p align=\"center\"><input type=\"submit\" value=\" Change crypto settings \"></p>
- </form>
- ";
-} else {
- // current format is clear text.
- $msg = "<p>Your personal dictionary is <strong>currently not encrypted</strong>.
- You may wish to encrypt your personal dictionary to protect your privacy in case
- the webmail system gets compromized and your personal dictionary file gets stolen.
- When encrypted, the file's contents look garbled and are hard to decrypt without
- knowing the correct key (which is your mailbox password).</p>
- <strong>ATTENTION:</strong> If you decide to encrypt your personal dictionary,
- you must remember that it gets "hashed" with your mailbox password. If
- you forget your mailbox password and the administrator changes it to a new value,
- your personal dictionary will become useless and will have to be created anew.
- However, if you or your system administrator change your mailbox password but you
- still have the old password at hand, you will be able to enter the old key to
- re-encrypt the dictionary with the new value.</p>
- <form method=\"post\" onsubmit=\"return checkMe()\">
- <input type=\"hidden\" name=\"MOD\" value=\"crypto\">
- <p align=\"center\"><input type=\"checkbox\" name=\"action\" value=\"encrypt\"> Please encrypt my personal
- dictionary and store it in an encrypted format.</p>
- <p align=\"center\"><input type=\"submit\" value=\" Change crypto settings \"></p>
- </form>
- ";
-}
- sqspell_makePage("Personal Dictionary Crypto Settings", "crypto_settings.js", $msg);
-?>
+ /**
+ ** ENC_SETUP.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 shows the user a nice invitation to encrypt or decypt
+ ** his/her personal dictionary and explains the caveats of such a decision.
+ **
+ ** $Id$
+ **/
+
+ // Something for our friends with E_ALL for error_reporting:
+ global $SQSPELL_CRYPTO;
+
+ $words=sqspell_getWords();
+ if ($SQSPELL_CRYPTO){
+ // Current format is encrypted.
+ $msg =
+ _("<p>Your personal dictionary is <strong>currently encrypted</strong>. This "
+ "helps protect your privacy in case the web-mail system gets compromized and your "
+ "personal dictionary ends up stolen. It is currently encrypted with the password "
+ "you use to access your mailbox, making it hard for anyone to see what is stored "
+ "in your personal dictionary.</p> "
+ "<p><strong>ATTENTION:</strong> If you forget your password, your personal dictionary "
+ "will become unaccessible, since it can no longer be decrypted. "
+ "If you change your mailbox password, SquirrelSpell will recognize it and prompt you for "
+ "your old password in order to re-encrypt the dictionary with a new key.</p>") .
+ '<form method="post" onsubmit="return checkMe()">'.
+ '<input type="hidden" name="MOD" value="crypto">'.
+ '<p align="center"><input type="checkbox" name="action" value="decrypt"> '.
+ _("Please decrypt my personal dictionary and store it in a clear-text format." ) .
+ '</p>'.
+ '<p align="center"><input type="submit" value=" ' .
+ _("Change crypto settings") .
+ ' "></p>'.
+ '</form>';
+ } else {
+ // current format is clear text.
+ $msg =
+ _("<p>Your personal dictionary is <strong>currently not encrypted</strong>. "
+ "You may wish to encrypt your personal dictionary to protect your privacy in case "
+ "the webmail system gets compromized and your personal dictionary file gets stolen. "
+ "When encrypted, the file's contents look garbled and are hard to decrypt without "
+ "knowing the correct key (which is your mailbox password).</p> "
+ "<strong>ATTENTION:</strong> If you decide to encrypt your personal dictionary, "
+ "you must remember that it gets "hashed" with your mailbox password. If "
+ "you forget your mailbox password and the administrator changes it to a new value, "
+ "your personal dictionary will become useless and will have to be created anew. "
+ "However, if you or your system administrator change your mailbox password but you "
+ "still have the old password at hand, you will be able to enter the old key to "
+ "re-encrypt the dictionary with the new value.</p>").
+ '<form method="post" onsubmit="return checkMe()">'.
+ '<input type="hidden" name="MOD" value="crypto">'.
+ '<p align="center"><input type="checkbox" name="action" value="encrypt"> '.
+ _("Please encrypt my personal dictionary and store it in an encrypted format.") .
+ '</p>'.
+ '<p align="center"><input type="submit" value=" '.
+ _("Change crypto settings") . ' "></p>'.
+ '</form>';
+ }
+ sqspell_makePage(_("Personal Dictionary Crypto Settings"), "crypto_settings.js", $msg);
+
+?>
\ No newline at end of file
<?php
-/**
- FORGET_ME.MOD.PHP
- ------------------
- This module deletes the words from the user dictionary. Called
- after EDIT_DIC module.
- **/
- // Make it two packs of Guinness and a bag of pistachios, fidian. :)
- global $words_ary, $sqspell_use_app, $SQSPELL_VERSION;
- if (sizeof($words_ary)){
- // something needs to be deleted.
- $words=sqspell_getWords();
- $lang_words = sqspell_getLang($words, $sqspell_use_app);
- $msg = "<p>Deleting the following entries from <strong>$sqspell_use_app</strong> dictionary:</p>
- <ul>\n";
- for ($i=0; $i<sizeof($words_ary); $i++){
- // remove word by word...
- $lang_words=str_replace("$words_ary[$i]\n", "", $lang_words);
- $msg .= "<li>$words_ary[$i]</li>\n";
- }
- $new_words_ary=split("\n", $lang_words);
- // Wipe this lang, if only 2 members in array (no words left).
- if (sizeof($new_words_ary)<=2) $lang_words="";
- $new_lang_words = $lang_words;
- // process the stuff and write the dic back.
- $langs=sqspell_getSettings($words);
- $words_dic = "# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: " . join(", ", $langs) . "\n";
- for ($i=0; $i<sizeof($langs); $i++){
- if ($langs[$i]==$sqspell_use_app)
- $lang_words = $new_lang_words;
- else $lang_words = sqspell_getLang($words, $langs[$i]);
- if ($lang_words) $words_dic .= $lang_words;
- }
- $words_dic .= "# End\n";
- sqspell_writeWords($words_dic);
- $msg .= "</ul>
- <p>All done!</p>\n";
- sqspell_makePage("Personal Dictionary Updated", null, $msg);
- } else {
- // Click on some words first, Einstein!
- sqspell_makePage("Personal Dictionary", null, "<p>No changes requested.</p>");
- }
-?>
+ /**
+ ** FORGET_ME.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 deletes the words from the user dictionary. Called
+ ** after EDIT_DIC module.
+ **
+ ** $Id$
+ **/
+
+ // Make it two packs of Guinness and a bag of pistachios, fidian. :)
+ global $words_ary, $sqspell_use_app, $SQSPELL_VERSION;
+ if (sizeof($words_ary)){
+ // something needs to be deleted.
+ $words=sqspell_getWords();
+ $lang_words = sqspell_getLang($words, $sqspell_use_app);
+ $msg = '<p>'.
+ sprintf( _("Deleting the following entries from <strong>%s</strong> dictionary:", $sqspell_use_app ) .
+ '</p>'.
+ "<ul>\n";
+ for ($i=0; $i<sizeof($words_ary); $i++){
+ // remove word by word...
+ $lang_words=str_replace("$words_ary[$i]\n", "", $lang_words);
+ $msg .= "<li>$words_ary[$i]</li>\n";
+ }
+ $new_words_ary=split("\n", $lang_words);
+ // Wipe this lang, if only 2 members in array (no words left).
+ if (sizeof($new_words_ary)<=2) {
+ $lang_words='';
+ }
+ $new_lang_words = $lang_words;
+ // process the stuff and write the dic back.
+ $langs=sqspell_getSettings($words);
+ $words_dic = "# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: " . join(", ", $langs) . "\n";
+ for ($i=0; $i<sizeof($langs); $i++){
+ if ($langs[$i]==$sqspell_use_app) {
+ $lang_words = $new_lang_words;
+ } else {
+ $lang_words = sqspell_getLang($words, $langs[$i]);
+ }
+ if ($lang_words) {
+ $words_dic .= $lang_words;
+ }
+ }
+ $words_dic .= "# End\n";
+ sqspell_writeWords($words_dic);
+ $msg .= '</ul>' .
+ '<p>' _("All done!") . "</p>\n";
+ sqspell_makePage(_("Personal Dictionary Updated"), null, $msg);
+ } else {
+ // Click on some words first, Einstein!
+ sqspell_makePage(_("Personal Dictionary"), null, '<p>' . _("No changes requested.") . '</p>');
+ }
+
+?>
\ No newline at end of file
<?php
-/**
- FORGET_ME_NOT.MOD.PHP
- ----------------------
- This module saves the added words into the user dictionary. Called
- after CHECK_ME module.
- **/
- // For our friends with E_ALL.
- global $words, $SQSPELL_VERSION, $SQSPELL_APP_DEFFAULT, $sqspell_use_app;
-
- $new_words = ereg_replace("%", "\n", $words);
-
- // Load the user dictionary.
- $words=sqspell_getWords();
-
- if (!$words){
- // First time.
- $words_dic="# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: $SQSPELL_APP_DEFAULT\n# $SQSPELL_APP_DEFAULT\n";
- $words_dic .= $new_words . "# End\n";
- } else {
- // Do some fancy stuff in order to save the dictionary and not mangle the
- // rest.
- $langs=sqspell_getSettings($words);
- $words_dic = "# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: " . join(", ", $langs) . "\n";
- for ($i=0; $i<sizeof($langs); $i++){
- $lang_words=sqspell_getLang($words, $langs[$i]);
- if ($langs[$i]==$sqspell_use_app){
- if (!$lang_words) $lang_words="# $langs[$i]\n";
- $lang_words .= $new_words;
- }
- $words_dic .= $lang_words;
- }
- $words_dic .= "# End\n";
- }
-
- // Write out the file
- sqspell_writeWords($words_dic);
- // display the splash screen, then close it automatically after 2 sec.
- $onload="setTimeout('self.close()', 2000)";
- $msg="<form onsubmit=\"return false\"><div align=\"center\"><input type=\"submit\" value=\" Close \" onclick=\"self.close()\"></div></form>";
- sqspell_makeWindow($onload, _("Personal Dictionary Updated"), null, $msg);
-?>
+ /**
+ ** FORGET_ME_NOT.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 saves the added words into the user dictionary. Called
+ ** after CHECK_ME module.
+ **
+ ** $Id$
+ **/
+
+ // For our friends with E_ALL.
+ global $words, $SQSPELL_VERSION, $SQSPELL_APP_DEFFAULT, $sqspell_use_app;
+
+ $new_words = ereg_replace("%", "\n", $words);
+
+ // Load the user dictionary.
+ $words=sqspell_getWords();
+
+ if (!$words){
+ // First time.
+ $words_dic="# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: $SQSPELL_APP_DEFAULT\n# $SQSPELL_APP_DEFAULT\n";
+ $words_dic .= $new_words . "# End\n";
+ } else {
+ // Do some fancy stuff in order to save the dictionary and not mangle the
+ // rest.
+ $langs=sqspell_getSettings($words);
+ $words_dic = "# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: " . join(", ", $langs) . "\n";
+ for ($i=0; $i<sizeof($langs); $i++){
+ $lang_words=sqspell_getLang($words, $langs[$i]);
+ if ($langs[$i]==$sqspell_use_app){
+ if (!$lang_words) {
+ $lang_words="# $langs[$i]\n";
+ }
+ $lang_words .= $new_words;
+ }
+ $words_dic .= $lang_words;
+ }
+ $words_dic .= "# End\n";
+ }
+
+ // Write out the file
+ sqspell_writeWords($words_dic);
+ // display the splash screen, then close it automatically after 2 sec.
+ $onload = "setTimeout('self.close()', 2000)";
+ $msg = '<form onsubmit="return false"><div align="center"><input type="submit" value=" '.
+ _("Close") . ' " onclick="self.close()"></div></form>';
+ sqspell_makeWindow($onload, _("Personal Dictionary Updated"), null, $msg);
+
+?>
\ No newline at end of file
<?php
-/**
- INIT.MOD.PHP
- -------------
- Initial loading of the popup window interface.
- **/
- // See if we need to give user the option of choosing which dictionary
- // he wants to use to spellcheck his message.
- $langs=sqspell_getSettings(null);
- $msg="<form method=\"post\">
- <input type=\"hidden\" name=\"MOD\" value=\"check_me\">
- <input type=\"hidden\" name=\"sqspell_text\">
- <p align=\"center\">";
- if (sizeof($langs)==1){
- // only one dictionary defined by the users. Submit the form
- // automatically.
- $onload="sqspell_init(true)";
- $msg .= _("Please wait, communicating with the server...") .
- '</p>'.
- "<input type=\"hidden\" name=\"sqspell_use_app\" value=\"$langs[0]\">";
- } else {
- // more than one dictionary. Let the user choose the dictionary first
- // then manually submit the form.
- $onload="sqspell_init(false)";
- $msg .= _("Please choose which dictionary you would like to use to spellcheck this message:").
- '</p><p align="center">' .
- '<select name="sqspell_use_app">';
- for ($i=0; $i<sizeof($langs); $i++){
- $msg .= "<option";
- if (!$i) $msg .= " selected";
- $msg .= ">$langs[$i]</option>\n";
- }
+ /**
+ ** INIT.MOD.PHP -- Squirrelspell module
+ **
+ ** Copyright (c) 1999-2001 The SquirrelMail development team
+ ** Licensed under the GNU GPL. For full terms see the file COPYING.
+ **
+ ** Initial loading of the popup window interface.
+ **
+ ** $Id$
+ **/
- $msg .= " </select>
- <input type=\"submit\" value=\"Go\">
- </p>
- ";
- }
- $msg .="</form>\n";
- sqspell_makeWindow($onload, _("SquirrelSpell Initiating"), "init.js", $msg);
-?>
+ // See if we need to give user the option of choosing which dictionary
+ // he wants to use to spellcheck his message.
+ $langs=sqspell_getSettings(null);
+ $msg = '<form method="post">'.
+ '<input type="hidden" name="MOD" value="check_me">'.
+ '<input type="hidden" name="sqspell_text">'.
+ '<p align="center">';
+ if (sizeof($langs)==1){
+ // only one dictionary defined by the users. Submit the form
+ // automatically.
+ $onload="sqspell_init(true)";
+ $msg .= _("Please wait, communicating with the server...") .
+ '</p>'.
+ "<input type=\"hidden\" name=\"sqspell_use_app\" value=\"$langs[0]\">";
+ } else {
+ // more than one dictionary. Let the user choose the dictionary first
+ // then manually submit the form.
+ $onload="sqspell_init(false)";
+ $msg .= _("Please choose which dictionary you would like to use to spellcheck this message:").
+ '</p><p align="center">' .
+ '<select name="sqspell_use_app">';
+ for ($i=0; $i<sizeof($langs); $i++){
+ $msg .= "<option";
+ if (!$i) {
+ $msg .= ' selected';
+ }
+ $msg .= " value=\"$langs[$i]\"> " . _($langs[$i]) . "</option>\n";
+ }
+
+ $msg .= ' </select>'.
+ '<input type="submit" value="' . _("Go") . '">'.
+ '</p>';
+ }
+ $msg .="</form>\n";
+ sqspell_makeWindow($onload, _("SquirrelSpell Initiating"), "init.js", $msg);
+
+?>
\ No newline at end of file
<?php
-/**
- LANG_CHANGE.MOD.PHP
- --------------------
- This module changes the international dictionaries selection
- for the user. Called after LANG_SETUP module.
- **/
- // For poor wretched souls with E_ALL.
- global $use_langs, $lang_default, $SQSPELL_APP_DEFAULT;
-
- $words = sqspell_getWords();
- if (!$words) $words = sqspell_makeDummy();
- $langs = sqspell_getSettings($words);
- if (sizeof($use_langs)){
- // See if the user clicked any options on the previous page.
- if (sizeof($use_langs)>1){
- // See if s/he wants more than one dictionary.
- if ($use_langs[0]!=$lang_default){
- // See if we need to juggle the order of the dictionaries
- // to make the default dictionary first in line.
- if (in_array($lang_default, $use_langs)){
- // see if the user was dumb and chose a default dictionary
- // to be something other than the ones he selected.
- $hold = array_shift($use_langs);
- $lang_string = join(", ", $use_langs);
- $lang_string = str_replace("$lang_default", "$hold", $lang_string);
- $lang_string = $lang_default . ", " . $lang_string;
+
+ /**
+ ** LANG_CHANGE.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 changes the international dictionaries selection
+ ** for the user. Called after LANG_SETUP module.
+ **
+ ** $Id$
+ **/
+
+ // For poor wretched souls with E_ALL.
+ global $use_langs, $lang_default, $SQSPELL_APP_DEFAULT;
+
+ $words = sqspell_getWords();
+ if (!$words) {
+ $words = sqspell_makeDummy();
+ }
+ $langs = sqspell_getSettings($words);
+ if (sizeof($use_langs)){
+ // See if the user clicked any options on the previous page.
+ if (sizeof($use_langs)>1){
+ // See if s/he wants more than one dictionary.
+ if ($use_langs[0]!=$lang_default){
+ // See if we need to juggle the order of the dictionaries
+ // to make the default dictionary first in line.
+ if (in_array($lang_default, $use_langs)){
+ // see if the user was dumb and chose a default dictionary
+ // to be something other than the ones he selected.
+ $hold = array_shift($use_langs);
+ $lang_string = join(", ", $use_langs);
+ $lang_string = str_replace("$lang_default", "$hold", $lang_string);
+ $lang_string = $lang_default . ", " . $lang_string;
+ } else {
+ // Yes, he is dumb.
+ $lang_string = join(', ', $use_langs);
+ }
+ } else {
+ // No need to juggle the order -- preferred is already first.
+ $lang_string = join(', ', $use_langs);
+ }
+ } else {
+ // Just one dictionary, please.
+ $lang_string = $use_langs[0];
+ }
+ $lang_array = explode( ',', $lang_string );
+ $dsp_string = '';
+ foreach( $lang_array as $a) {
+ $dsp_string .= _(trim($a)) . ', ';
+ }
+ $dsp_string = substr( $dsp_string, 0, -2 );
+ $msg = '<p>'.
+ sprintf( _("Settings adjusted to: <strong>%s</strong> with <strong>%s</strong> as default dictionary."), $dsp_string, _($lang_default) ) .
+ '</p>';
} else {
- // Yes, he is dumb.
- $lang_string = join(", ", $use_langs);
+ // No dictionaries selected. Use system default.
+ $msg = '<p>'.
+ sprintf( _("Using <strong>%s</strong> dictionary (system default) for spellcheck." ), $SQSPELL_APP_DEFAULT ) .
+ '</p>';
+ $lang_string = $SQSPELL_APP_DEFAULT;
}
- } else {
- // No need to juggle the order -- preferred is already first.
- $lang_string = join(", ", $use_langs);
- }
- } else {
- // Just one dictionary, please.
- $lang_string = $use_langs[0];
- }
- $msg = "<p>Settings adjusted to: <strong>$lang_string</strong> with
- <strong>$lang_default</strong> as default dictionary.</p>";
- } else {
- // No dictionaries selected. Use system default.
- $msg = "<p>Using <strong>$SQSPELL_APP_DEFAULT</strong> dictionary (system default)
- for spellcheck.</p>";
- $lang_string = $SQSPELL_APP_DEFAULT;
- }
- $old_lang_string = join(", ", $langs);
- $words = str_replace("# LANG: $old_lang_string", "# LANG: $lang_string", $words);
- // write it down where the sun don't shine.
- sqspell_writeWords($words);
- sqspell_makePage("International Dictionaries Preferences Updated", null, $msg);
-?>
+ $old_lang_string = join(", ", $langs);
+ $words = str_replace("# LANG: $old_lang_string", "# LANG: $lang_string", $words);
+ // write it down where the sun don't shine.
+ sqspell_writeWords($words);
+ sqspell_makePage(_("International Dictionaries Preferences Updated"), null, $msg);
+
+?>
\ No newline at end of file
<?php
-/**
- LANG_SETUP.MOD.PHP
- ------------------
- This module displays available dictionaries to the user and lets
- him/her choose which ones s/he wants to check messages with.
- **/
- // Making sure Sqspell doesn't barf when working with E_ALL
- global $SQSPELL_APP;
+
+ /**
+ ** LANG_SETUP.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 displays available dictionaries to the user and lets
+ ** him/her choose which ones s/he wants to check messages with.
+ **
+ ** $Id$
+ **/
+
+ // Making sure Sqspell doesn't barf when working with E_ALL
+ global $SQSPELL_APP;
+
+ $msg = '<p>'.
+ _("Please check any available international dictionaries which you would like to use when spellchecking:").
+ '</p>'.
+ '<form method="post">'.
+ '<input type="hidden" name="MOD" value="lang_change">'.
+ '<blockquote><p>';
+ $langs = sqspell_getSettings(null);
+ $add = '<p>'.
+ _("Make this dictionary my default selection:") .
+ " <select name=\"lang_default\">\n";
+ while (list($avail_lang, $junk) = each($SQSPELL_APP)){
+ $msg .= "<input type=\"checkbox\" name=\"use_langs[]\" value=\"$avail_lang\"";
+ if (in_array($avail_lang, $langs)) {
+ $msg .= ' checked';
+ }
+ $msg .= '> ' . _($avail_lang) . "<br>\n";
+ $add .= "<option";
+ if ($avail_lang==$langs[0]) {
+ $add .= ' selected';
+ }
+ $add .= " value=\"$avail_lang\" >" . _($avail_lang) . "</option>\n";
+ }
+ $msg .= "</p>\n" . $add . "</select>\n";
+ $msg .= "</p></blockquote><p><input type=\"submit\" value=\" " . _("Make these changes") . " \"></p>";
+ sqspell_makePage(_("Add International Dictionaries"), null, $msg);
- $msg = "<p>Please check any available international dictionaries which you would like
- to use when spellchecking:</p>
- <form method=\"post\">
- <input type=\"hidden\" name=\"MOD\" value=\"lang_change\">
- <blockquote><p>
- ";
- $langs = sqspell_getSettings(null);
- $add = "<p>Make this dictionary my default selection: <select name=\"lang_default\">\n";
- while (list($avail_lang, $junk) = each($SQSPELL_APP)){
- $msg .= "<input type=\"checkbox\" name=\"use_langs[]\" value=\"$avail_lang\"";
- if (in_array($avail_lang, $langs)) $msg .= " checked";
- $msg .= ">$avail_lang<br>\n";
- $add .= "<option";
- if ($avail_lang==$langs[0]) $add .= " selected";
- $add .= ">$avail_lang</option>\n";
- }
- $msg .= "</p>\n" . $add . "</select>\n";
- $msg .= "</p></blockquote><p><input type=\"submit\" value=\" Make these changes \"></p>";
- sqspell_makePage("Add International Dictionaries", null, $msg);
-?>
+?>
\ No newline at end of file
<?php
-/**
- OPTIONS_MAIN.MOD.PHP
- ---------------------
- Default page called when accessing SquirrelSpell's options.
- **/
- // E_ALL: protection behind 3000 miles.
- global $SQSPELL_APP;
- $msg = "<p>Please choose which options you wish to set up:</p>
- <ul>
- <li><a href=\"sqspell_options.php?MOD=edit_dic\">Edit your personal dictionary</a></li>
- ";
- // See if more than one dictionary is defined system-wide.
- // If so, let the user choose his preferred ones.
- if (sizeof($SQSPELL_APP)>1)
- $msg .= "<li><a href=\"sqspell_options.php?MOD=lang_setup\">Set up international dictionaries</a></li>\n";
- // See if MCRYPT is available.
- // If so, let the user choose whether s/he wants to encrypt the
- // personal dictionary file.
- if (function_exists("mcrypt_generic"))
- $msg .= "<li><a href=\"sqspell_options.php?MOD=enc_setup\">Encrypt or decrypt your personal dictionary</a></li>\n";
- else $msg .= "<li>Encrypt or decrypt your personal dictionary <em>(not available)</em></li>\n";
- $msg .= "</ul>\n";
- sqspell_makePage("SquirrelSpell Options Menu", null, $msg);
-
-?>
+ /**
+ ** OPTIONS_MAIN.MOD.PHP -- Squirrelspell module
+ **
+ ** Copyright (c) 1999-2001 The SquirrelMail development team
+ ** Licensed under the GNU GPL. For full terms see the file COPYING.
+ **
+ ** Default page called when accessing SquirrelSpell's options.
+ **
+ ** $Id$
+ **/
+
+ // E_ALL: protection behind 3000 miles.
+ global $SQSPELL_APP;
+
+ $msg = '<p>' .
+ _("Please choose which options you wish to set up:") .
+ '</p>'.
+ '<ul>'.
+ '<li><a href="sqspell_options.php?MOD=edit_dic">' .
+ _("Edit your personal dictionary") . '</a></li>';
+ // See if more than one dictionary is defined system-wide.
+ // If so, let the user choose his preferred ones.
+ if (sizeof($SQSPELL_APP)>1) {
+ $msg .= '<li><a href="sqspell_options.php?MOD=lang_setup">'.
+ _("Set up international dictionaries") .
+ "</a></li>\n";
+ }
+ // See if MCRYPT is available.
+ // If so, let the user choose whether s/he wants to encrypt the
+ // personal dictionary file.
+ if (function_exists("mcrypt_generic")) {
+ $msg .= '<li><a href="sqspell_options.php?MOD=enc_setup">'.
+ _("Encrypt or decrypt your personal dictionary").
+ "</a></li>\n";
+ } else {
+ $msg .= '<li>'.
+ _("Encrypt or decrypt your personal dictionary") . ' <em>(' . _("not available") . ')</em>'.
+ "</li>\n";
+ }
+ $msg .= "</ul>\n";
+ sqspell_makePage( _("SquirrelSpell Options Menu"), null, $msg);
+
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-/** SquirrelSpell Configuration file. **/
-
-// Just for poor wretched souls with E_ALL. :)
-global $username, $data_dir;
-
-/**
- SPELL-CHECKING APPLICATIONS:
- ----------------------------
- This feature was added/changed in 0.3. Use this array to set up
- which dictionaries are available to users. If you only have
- English spellchecker on your system, then let this line be:
-
- $SQSPELL_APP = array("English" => "ispell -a");
-
- or
-
- $SQSPELL_APP = array("English" => "/usr/local/bin/aspell -a");
-
- Sometimes you have to specify full path for PHP to find it.
- Aspell is a better spell-checker than Ispell, so you're encouraged
- to use it.
-
- If you want to have more than one dictionary available to users,
- configure the array to look something like this:
-
- $SQSPELL_APP = array(
- "English" => "aspell -a",
- "Russian" => "ispell -d russian -a",
- ...
- "Swahili" => "ispell -d swahili -a"
- );
-
- Watch the commas, making sure there isn't one after your last
- dictionary declaration. Also, make sure all these dictionaries
- are available on your system before you specify them here.
-
- Whatever your setting is, don't omit the "-a" flag.
-
- **/
-$SQSPELL_APP = array("English" => "ispell -a");
-
-/**
- DEFAULT DICTIONARY
- -------------------
- Even if you're only running one dictionary, still specify which one
- is the default. Watch the case -- it has to be exactly as in array
- you declared in $SQSPELL_APP.
- **/
-$SQSPELL_APP_DEFAULT="English";
-
-/**
- USER DICTIONARY:
- -----------------
- $SQSPELL_WORDS_FILE is a location and mask of a user dictionary file.
- The default setting should be OK for most everyone. Read PRIVACY and
- CRYPTO in the "doc" directory.
- **/
-$SQSPELL_WORDS_FILE = "$data_dir/$username.words";
-
-/**
- CASE SENSITIVITY:
- ------------------
- Use $SQSPELL_EREG="ereg" for case-sensitive matching of user
- dictionary, or $SQSPELL_EREG="eregi" for case-insensitive
- matching. It is advised to use case-sensitive matching.
- **/
-$SQSPELL_EREG="ereg";
-
-/**
- SOUP NAZI (AVOIDING BAD BROWSERS)
- -------------------------------------
- Since some browsers choke on JavaScript, here is an option to disable the
- browsers with known problems. All you do is add some part of an USER_AGENT
- string of an offending browser which you want to disable and users will not
- know about this plugin. E.g. browsers with "Mozilla/4.61 (Macintosh, I, PPC)"
- USER_AGENT string will get weeded out if you provide "Macintosh" in the
- config string.
-
- Mozilla/2 -- You're kidding, right?
- Mozilla/3 -- known not to work
- Opera -- known not to work
- Macintosh -- Netscape 4.x on Macintosh chokes for some reason.
- Adding until resolved.
- **/
-$SQSPELL_SOUP_NAZI = "Mozilla/3, Mozilla/2, Opera 4, Opera/4, Macintosh";
-
-?>
global $username, $data_dir;
- $SQSPELL_APP = array( 'English' => 'ispell -a' );
+ $SQSPELL_APP = array( 'English' => 'ispell -a',
+ 'Spanish' => 'ispell -d spanish -a' );
$SQSPELL_APP_DEFAULT = 'English';
$SQSPELL_WORDS_FILE = "$data_dir/$username.words";
$SQSPELL_EREG = 'ereg';
$msg='<p>'.
'<strong>' . _("ATTENTION:") . '</strong><br>' .
_("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.<br>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.").
- "</p>
- <blockquote>
- <form method=\"post\" onsubmit=\"return AYS()\">
- <input type=\"hidden\" name=\"MOD\" value=\"crypto_badkey\">
- <p><input type=\"checkbox\" name=\"delete_words\" value=\"ON\">" . _("Delete my dictionary and start a new one") . '<br>'.
- _("Decrypt my dictionary with my old password:") . "<input name=\"old_key\" size=\"10\"></p>
- </blockquote>
- <p align=\"center\"><input type=\"submit\" value=\"" . _("Proceed") . " >>\"></p>
- </form>
- ";
+ '</p>' .
+ '<blockquote>'.
+ '<form method="post" onsubmit="return AYS()">'.
+ '<input type="hidden" name="MOD" value="crypto_badkey">'.
+ '<p><input type="checkbox" name="delete_words" value="ON">' .
+ _("Delete my dictionary and start a new one") . '<br>'.
+ _("Decrypt my dictionary with my old password:") .
+ '<input name="old_key" size=\"10\"></p>'.
+ '</blockquote>'.
+ '<p align="center"><input type="submit" value="' . _("Proceed") . ' >>"></p>'.
+ '</form>';
// See if this happened in the pop-up window or when accessing
// the SpellChecker options page.
global $SCRIPT_NAME;