diff -Nrub ./extensions/cookie/nsCookieManager.cpp ../mozilla-new/extensions/cookie/nsCookieManager.cpp --- ./extensions/cookie/nsCookieManager.cpp Tue Apr 3 22:39:39 2001 +++ ../mozilla-new/extensions/cookie/nsCookieManager.cpp Fri Jul 27 11:38:55 2001 @@ -123,3 +123,9 @@ ::COOKIE_Remove(host, name, path, permanent); return NS_OK; } + +NS_IMETHODIMP nsCookieManager::Setvalue + (const char* host, const char* name, const char* value, const char* path) { + ::COOKIE_Setvalue(host, name, value, path); + return NS_OK; +} diff -Nrub ./extensions/cookie/nsCookies.cpp ../mozilla-new/extensions/cookie/nsCookies.cpp --- ./extensions/cookie/nsCookies.cpp Wed Apr 18 01:58:47 2001 +++ ../mozilla-new/extensions/cookie/nsCookies.cpp Fri Jul 27 17:50:44 2001 @@ -1444,6 +1444,35 @@ } PUBLIC void +COOKIE_Setvalue + (const char* host, const char* name, const char* value, const char* path) { + cookie_CookieStruct * cookie; + PRInt32 count = 0; + + /* step through all cookies searching for indicated one */ + if (cookie_list) { + count = cookie_list->Count(); + while (count>0) { + count--; + cookie = NS_STATIC_CAST(cookie_CookieStruct*, cookie_list->ElementAt(count)); + NS_ASSERTION(cookie, "corrupt cookie list"); + if ((PL_strcmp(cookie->host, host) == 0) && + (PL_strcmp(cookie->name, name) == 0) && + (PL_strcmp(cookie->path, path) == 0)) { + printf("Changing cookie value to: %s\n", value); + printf("Old cookie value: %s\n", cookie->cookie); + CKutil_StrAllocCopy(cookie->cookie, value); + printf("New cookie value: %s\n", cookie->cookie); + //cookie_list->ReplaceElementAt(cookie, count); + cookie_changed = PR_TRUE; + COOKIE_Write(); + break; + } + } + } +} + +PUBLIC void COOKIE_Remove (const char* host, const char* name, const char* path, const PRBool permanent) { cookie_CookieStruct * cookie; diff -Nrub ./extensions/cookie/nsCookies.h ../mozilla-new/extensions/cookie/nsCookies.h --- ./extensions/cookie/nsCookies.h Tue Apr 3 22:39:02 2001 +++ ../mozilla-new/extensions/cookie/nsCookies.h Fri Jul 27 11:41:14 2001 @@ -56,5 +56,7 @@ PRUint64 * expires); extern void COOKIE_Remove (const char* host, const char* name, const char* path, const PRBool permanent); +extern void COOKIE_Setvalue + (const char* host, const char* name, const char* value, const char* path); #endif /* COOKIES_H */ diff -Nrub ./extensions/cookie/nsICookieManager.idl ../mozilla-new/extensions/cookie/nsICookieManager.idl --- ./extensions/cookie/nsICookieManager.idl Thu Mar 29 10:58:07 2001 +++ ../mozilla-new/extensions/cookie/nsICookieManager.idl Fri Jul 27 11:04:05 2001 @@ -35,6 +35,7 @@ void removeAll(); readonly attribute nsISimpleEnumerator enumerator; void remove(in string domain, in string name, in string path, [const] in boolean permanent); + void setvalue(in string host, in string name, in string value, in string path); }; %{ C++ diff -Nrub ./extensions/wallet/cookieviewer/CookieViewer.dtd ../mozilla-new/extensions/wallet/cookieviewer/CookieViewer.dtd --- ./extensions/wallet/cookieviewer/CookieViewer.dtd Sat Sep 2 10:35:03 2000 +++ ../mozilla-new/extensions/wallet/cookieviewer/CookieViewer.dtd Fri Jul 27 09:34:19 2001 @@ -9,6 +9,7 @@ + diff -Nrub ./extensions/wallet/cookieviewer/CookieViewer.js ../mozilla-new/extensions/wallet/cookieviewer/CookieViewer.js --- ./extensions/wallet/cookieviewer/CookieViewer.js Wed Apr 18 02:58:41 2001 +++ ../mozilla-new/extensions/wallet/cookieviewer/CookieViewer.js Fri Jul 27 11:52:29 2001 @@ -315,6 +315,18 @@ // todo } +// function : ::ChangeCookieSelected(); +// purpose : edits the cookies value for web-site manipulation +function ChangeCookieSelected() +{ + var host = document.getElementById("ifl_host").value; + var name = document.getElementById("ifl_name").value; + var value = document.getElementById("ifl_value").value; + var path = document.getElementById("ifl_path").value; + cookiemanager.setvalue(host, name, value, path); + return true; +} + /*** =================== PERMISSIONS CODE =================== ***/ // function : ::AddPermissionToList(); diff -Nrub ./extensions/wallet/cookieviewer/CookieViewer.xul ../mozilla-new/extensions/wallet/cookieviewer/CookieViewer.xul --- ./extensions/wallet/cookieviewer/CookieViewer.xul Wed Apr 18 02:58:41 2001 +++ ../mozilla-new/extensions/wallet/cookieviewer/CookieViewer.xul Thu Jul 26 19:39:56 2001 @@ -91,7 +91,7 @@ - + @@ -119,6 +119,9 @@