use sqsetcookie instead of setcookie.
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 4 Dec 2005 08:57:30 +0000 (08:57 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 4 Dec 2005 08:57:30 +0000 (08:57 +0000)
return OTP encrypted password key.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10429 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/auth.php

index 493ddcd9b8b95c7fad2de4631886f3ff1c1d45a4..5b75a4f2af00d78ea76b03d8f83ab5d7f6439f69 100644 (file)
@@ -130,9 +130,13 @@ function sqauth_read_password() {
  * in authentication system used by IMAP server.
  *
  * Function must be called before any html output started. Direct access 
- * to password information is deprecated.
+ * to password information is deprecated. Saved password information is 
+ * available only to next executed SquirrelMail script. If your script needs
+ * access to saved password after sqauth_save_password() call, use returned 
+ * OTP encrypted key.
  * @param string $pass password
- * @return void
+ * @return string password encrypted with OTP. In case script wants to access 
+ *  password information before reloading page.
  * @since 1.5.1
  */
 function sqauth_save_password($pass) {
@@ -141,7 +145,8 @@ function sqauth_save_password($pass) {
     $onetimepad = OneTimePadCreate(strlen($pass));
     sqsession_register($onetimepad,'onetimepad');
     $key = OneTimePadEncrypt($pass, $onetimepad);
-    setcookie('key', $key, 0, $base_uri);
+    sqsetcookie('key', $key, false, $base_uri);
+    return $key;
 }
 
 /**