X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fsqspell_functions.php;h=e931496cd4abd452904350d06e655d4a5d609fd0;hb=fff3023727920f3d5431e9f45b5681cb84b66645;hp=d73e0197394e5c1e91bd73da9bc5e7efbcb4a59a;hpb=484ed7c95f5b0f359f38f091516deafefc3d4c3a;p=squirrelmail.git diff --git a/plugins/squirrelspell/sqspell_functions.php b/plugins/squirrelspell/sqspell_functions.php index d73e0197..e931496c 100644 --- a/plugins/squirrelspell/sqspell_functions.php +++ b/plugins/squirrelspell/sqspell_functions.php @@ -4,13 +4,15 @@ * ---------------------- * All SquirrelSpell-wide functions are in this file. * - * Copyright (c) 1999-2002 The SquirrelMail development team + * Copyright (c) 1999-2004 The SquirrelMail development team * Licensed under the GNU GPL. For full terms see the file COPYING. * * $Id$ * * @author Konstantin Riabitsev ($Author$) * @version $Date$ + * @package plugins + * @subpackage squirrelspell */ /** @@ -26,9 +28,14 @@ * @return void */ function sqspell_makePage($title, $scriptsrc, $body){ - global $color, $SQSPELL_VERSION, $MOD; + global $color, $SQSPELL_VERSION; + + if (! sqgetGlobalVar('MOD', $MOD, SQ_GET) ) { + $MOD = 'options_main'; + } + displayPageHeader($color, 'None'); - echo " 
\n"; + echo " 
\n"; /** * Check if we need to link in a script. */ @@ -40,7 +47,7 @@ function sqspell_makePage($title, $scriptsrc, $body){ html_tag( 'td', '' . $title .'', 'center', $color[9] ) ) . "\n" . html_tag( 'tr', "\n" . - html_tag( 'td', '
', 'left' ) + html_tag( 'td', '
', 'left' ) ) . "\n" . html_tag( 'tr', "\n" . html_tag( 'td', $body, 'left' ) @@ -51,7 +58,7 @@ function sqspell_makePage($title, $scriptsrc, $body){ */ if ($MOD != "options_main"){ echo html_tag( 'tr', "\n" . - html_tag( 'td', '
', 'left' ) + html_tag( 'td', '
', 'left' ) ) . "\n" . html_tag( 'tr', "\n" . html_tag( 'td', '' @@ -64,11 +71,12 @@ function sqspell_makePage($title, $scriptsrc, $body){ * Close the table and display the version. */ echo html_tag( 'tr', "\n" . - html_tag( 'td', '
', 'left' ) + html_tag( 'td', '
', 'left' ) ) . "\n" . html_tag( 'tr', html_tag( 'td', 'SquirrelSpell ' . $SQSPELL_VERSION, 'center', $color[9] ) - ) . "\n"; + ) . "\n\n"; + echo ''; } /** @@ -87,47 +95,35 @@ function sqspell_makePage($title, $scriptsrc, $body){ * @return void */ function sqspell_makeWindow($onload, $title, $scriptsrc, $body){ - global $color, $SQSPELL_VERSION, $theme_css; - echo "\n" - . "\n" - . "$title\n"; - /** - * Check if we have a defined css theme to use. - */ - if ($theme_css != "") { - echo "\n"; - } - /** - * Link in the .js file if needed - */ - if ($scriptsrc){ - echo "\n"; - } - echo "\n" - . "\n" : '')); + + echo "' + echo ">\n" . html_tag( 'table', "\n" . html_tag( 'tr', "\n" . html_tag( 'td', '' . $title . '', 'center', $color[9] ) ) . "\n" . html_tag( 'tr', "\n" . - html_tag( 'td', '
', 'left' ) + html_tag( 'td', '
', 'left' ) ) . "\n" . html_tag( 'tr', "\n" . html_tag( 'td', $body, 'left' ) ) . "\n" . html_tag( 'tr', "\n" . - html_tag( 'td', '
', 'left' ) + html_tag( 'td', '
', 'left' ) ) . "\n" . html_tag( 'tr', "\n" . html_tag( 'td', 'SquirrelSpell ' . $SQSPELL_VERSION, 'center', $color[9] ) @@ -331,9 +327,13 @@ function sqspell_getWords(){ * the user's old mailbox password. I admin, this is rather dirty, * but efficient. ;) */ - global $key, $onetimepad, $old_key; - if ($old_key) { - $clear_key=$old_key; + sqgetGlobalVar('key', $key, SQ_COOKIE); + sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); + + sqgetGlobalVar('old_key', $old_key, SQ_POST); + + if ($old_key != '') { + $clear_key=$old_key; } else { /** * Get user's password (the key). @@ -358,22 +358,22 @@ function sqspell_getWords(){ * gettext will bork. ;( */ $msg = html_tag( 'p', "\n" . - '' . _("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.") , + '' . _("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.") , 'left' ) . "\n" . '
' . "\n" . '
' . "\n" - . '' . "\n" + . '' . "\n" . html_tag( 'p', "\n" . - '' - . _("Delete my dictionary and start a new one") . '
' + '' + . _("Delete my dictionary and start a new one") . '
' . _("Decrypt my dictionary with my old password:") - . '' , + . '' , 'left' ) . "\n" . '
' . "\n" . html_tag( 'p', "\n" . '' , + . _("Proceed") . ' >>" />' , 'center' ) . "\n" . '' . "\n"; /** @@ -443,7 +443,9 @@ function sqspell_writeWords($words){ * User wants to encrypt the file. So be it. * Get the user's password to use as a key. */ - global $key, $onetimepad; + sqgetGlobalVar('key', $key, SQ_COOKIE); + sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); + $clear_key=OneTimePadDecrypt($key, $onetimepad); /** * Try encrypting it. If fails, scream bloody hell. @@ -523,4 +525,4 @@ function sqspell_ckMOD($rMOD){ * stuff. :) */ $SQSPELL_VERSION="v0.3.8"; -?> +?> \ No newline at end of file