diff --git a/extensions/wallet/public/nsIWalletService.h b/extensions/wallet/public/nsIWalletService.h index 59e685f86ae..f60b662eb10 100644 --- a/extensions/wallet/public/nsIWalletService.h +++ b/extensions/wallet/public/nsIWalletService.h @@ -56,7 +56,7 @@ struct nsIWalletService : public nsISupports (char* URLNAME, char* name, char** value)=0; NS_IMETHOD SI_PromptUsernameAndPassword - (char *prompt, char **username, char **password, char *URLName)=0; + (char *prompt, char **username, char **password, char *URLName, PRBool &status)=0; NS_IMETHOD SI_PromptPassword (char *prompt, char **password, char *URLName, PRBool pickFirstUser)=0; NS_IMETHOD SI_Prompt diff --git a/extensions/wallet/src/nsWalletService.cpp b/extensions/wallet/src/nsWalletService.cpp index dec8c6193fa..2d507920d12 100644 --- a/extensions/wallet/src/nsWalletService.cpp +++ b/extensions/wallet/src/nsWalletService.cpp @@ -95,8 +95,8 @@ NS_IMETHODIMP nsWalletlibService::SI_RestoreSignonData } NS_IMETHODIMP nsWalletlibService::SI_PromptUsernameAndPassword - (char *prompt, char **username, char **password, char *URLName) { - ::SINGSIGN_PromptUsernameAndPassword(prompt, username, password, URLName); + (char *prompt, char **username, char **password, char *URLName, PRBool &status) { + status = ::SINGSIGN_PromptUsernameAndPassword(prompt, username, password, URLName); return NS_OK; } diff --git a/extensions/wallet/src/nsWalletService.h b/extensions/wallet/src/nsWalletService.h index 16dc1fc89c1..ff9ef2b64ec 100644 --- a/extensions/wallet/src/nsWalletService.h +++ b/extensions/wallet/src/nsWalletService.h @@ -40,7 +40,7 @@ public: NS_IMETHOD SI_RestoreSignonData (char* URLNAME, char* name, char** value); NS_IMETHOD SI_PromptUsernameAndPassword - (char *prompt, char **username, char **password, char *URLName); + (char *prompt, char **username, char **password, char *URLName, PRBool &status); NS_IMETHOD SI_PromptPassword (char *prompt, char **password, char *URLName, PRBool pickFirstUser); NS_IMETHOD SI_Prompt diff --git a/extensions/wallet/src/singsign.cpp b/extensions/wallet/src/singsign.cpp index 19607718d52..e719e02d287 100644 --- a/extensions/wallet/src/singsign.cpp +++ b/extensions/wallet/src/singsign.cpp @@ -2474,11 +2474,11 @@ si_RestoreOldSignonDataFromBrowser } /* Browser-generated prompt for user-name and password */ -PUBLIC int +PUBLIC PRBool SINGSIGN_PromptUsernameAndPassword (char *prompt, char **username, char **password, char *URLName) { - int status; + PRBool status; char *copyOfPrompt=0; /* just for safety -- really is a problem in SINGSIGN_Prompt */ @@ -3324,7 +3324,7 @@ SINGSIGN_DisplaySignonInfoAsHTML() int SINGSIGN_PromptUsernameAndPassword - (char *prompt, char **username, char **password, char *URLName) + (char *prompt, char **username, char **password, char *URLName, PRInt32 &status) { } diff --git a/extensions/wallet/src/singsign.h b/extensions/wallet/src/singsign.h index 15a89f6b106..6e796b9796b 100644 --- a/extensions/wallet/src/singsign.h +++ b/extensions/wallet/src/singsign.h @@ -39,7 +39,7 @@ SINGSIGN_RememberSignonData(char* URLName, char** name_array, char** value_array extern void SINGSIGN_RestoreSignonData(char* URLName, char* name, char** value); -extern int +extern PRBool SINGSIGN_PromptUsernameAndPassword (char *prompt, char **username, char **password, char *URLName); diff --git a/network/main/Makefile.in b/network/main/Makefile.in index 1a24fcdfca0..0ed430917bb 100644 --- a/network/main/Makefile.in +++ b/network/main/Makefile.in @@ -33,7 +33,6 @@ CSRCS = \ mkconect.c \ mkfsort.c \ mkgeturl.c \ - singsign.c \ mkhelp.c \ mkmessag.c \ mkpadpac.c \ @@ -48,6 +47,10 @@ CSRCS = \ unix-dns.c \ $(NULL) +CPPSRCS = \ + singsignStub.cpp \ + $(NULL) + ifndef MODULAR_NETLIB CSRCS += \ mkinit.c \ diff --git a/network/main/makefile.win b/network/main/makefile.win index 643f51d9d37..25dde7c327c 100644 --- a/network/main/makefile.win +++ b/network/main/makefile.win @@ -65,7 +65,7 @@ OBJS= \ .\$(OBJDIR)\prefetch.obj \ .\$(OBJDIR)\mkgeturl.obj \ .\$(OBJDIR)\win-dns.obj \ - .\$(OBJDIR)\singsign.obj \ + .\$(OBJDIR)\singsignStub.obj \ $(NULL) @@ -79,7 +79,6 @@ CSRCS = \ mkformat.c \ mkfsort.c \ mkgeturl.c \ - singsign.c \ mkhelp.c \ mkinit.c \ mkmessag.c \ @@ -98,6 +97,7 @@ CSRCS = \ CPPSRCS = \ win-dns.cpp \ + singsignStub.cpp \ $(NULL) MODULE=network @@ -170,6 +170,9 @@ LINCS=-I$(PUBLIC)\jtools \ -I$(PUBLIC)\certurl \ -I$(PUBLIC)\pop3url \ -I$(PUBLIC)\mailbxurl \ + -I$(PUBLIC)\wallet \ + -I$(PUBLIC)\raptor \ + -I$(PUBLIC)\netlib \ -I$(PUBLIC)\xpcom #!endif diff --git a/network/main/singsignStub.cpp b/network/main/singsignStub.cpp new file mode 100644 index 00000000000..2e5d2f26ff4 --- /dev/null +++ b/network/main/singsignStub.cpp @@ -0,0 +1,135 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is Mozilla Communicator client code. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are Copyright (C) 1998 + * Netscape Communications Corporation. All Rights Reserved. + */ + +#include "libi18n.h" +#include "nsIServiceManager.h" +#include "nsIWalletService.h" +static NS_DEFINE_IID(kIWalletServiceIID, NS_IWALLETSERVICE_IID); +static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID); + +PUBLIC int +SI_SaveSignonData(char * filename) { + return 0; +} + +PUBLIC Bool +SI_RemoveUser(char *URLName, char *userName, Bool save) { + return FALSE; +} + +PUBLIC void +SI_RemoveAllSignonData() { +} + +PUBLIC PRBool +SI_PromptUsernameAndPassword + (MWContext *context, char *prompt, + char **username, char **password, char *URLName) +{ + nsIWalletService *walletservice; + nsresult res; + PRBool status; + res = nsServiceManager::GetService(kWalletServiceCID, + kIWalletServiceIID, + (nsISupports **)&walletservice); + if ((NS_OK == res) && (nsnull != walletservice)) { + res = walletservice-> + SI_PromptUsernameAndPassword(prompt, username, password, URLName, status); + NS_RELEASE(walletservice); + } + return status; +} + +PUBLIC char * +SI_PromptPassword + (MWContext *context, char *prompt, char *URLName, Bool pickFirstUser) +{ + nsIWalletService *walletservice; + nsresult res; + char * password; + res = nsServiceManager::GetService(kWalletServiceCID, + kIWalletServiceIID, + (nsISupports **)&walletservice); + if ((NS_OK == res) && (nsnull != walletservice)) { + res = walletservice->SI_PromptPassword(prompt, &password, URLName, pickFirstUser); + NS_RELEASE(walletservice); + } + return password; +} + +PUBLIC char * +SI_Prompt (MWContext *context, char *prompt, + char* defaultUsername, char *URLName) +{ + nsIWalletService *walletservice; + nsresult res; + res = nsServiceManager::GetService(kWalletServiceCID, + kIWalletServiceIID, + (nsISupports **)&walletservice); + if ((NS_OK == res) && (nsnull != walletservice)) { + res = walletservice->SI_Prompt(prompt, &defaultUsername, URLName); + NS_RELEASE(walletservice); + } + return defaultUsername; +} + +PUBLIC void +SI_AnonymizeSignons() +{ +} + +PUBLIC void +SI_UnanonymizeSignons() +{ +} + +PUBLIC void +SI_DisplaySignonInfoAsHTML(MWContext *context) +{ +} + +#ifdef xxx +PUBLIC void +SI_StartOfForm() { +} + +PUBLIC int +SI_LoadSignonData(char * filename) { + return 0; +} + +PUBLIC void +SI_RememberSignonData + (char* URLName, char** name_array, char** value_array, char** type_array, PRInt32 value_cnt) +{ +} + +PUBLIC void +SI_RestoreSignonData + (char* URLName, char* name, char** value) +{ +} + +PUBLIC void +SI_RememberSignonDataFromBrowser + (char* URLName, char* username, char* password) +{ +} + +#endif diff --git a/network/module/nsINetService.h b/network/module/nsINetService.h index ab266d8b2e5..fe70be003be 100644 --- a/network/module/nsINetService.h +++ b/network/module/nsINetService.h @@ -107,14 +107,6 @@ struct nsINetService : public nsISupports */ NS_IMETHOD SetCookieString(nsIURL *aURL, const nsString& aCookie)=0; -#ifdef SingleSignon - NS_IMETHOD SI_DisplaySignonInfoAsHTML()=0; - NS_IMETHOD SI_RememberSignonData - (char* URLName, char** name_array, char** value_array, char** type_array, PRInt32 value_cnt)=0; - NS_IMETHOD SI_RestoreSignonData - (char* URLNAME, char* name, char** value)=0; -#endif - #ifdef CookieManagement NS_IMETHOD NET_DisplayCookieInfoAsHTML()=0; #ifdef PrivacySiteInfo diff --git a/network/module/nsNetService.cpp b/network/module/nsNetService.cpp index 3ffd7677dc3..04c79628e4c 100644 --- a/network/module/nsNetService.cpp +++ b/network/module/nsNetService.cpp @@ -746,29 +746,6 @@ nsNetlibService::SetCookieString(nsIURL *aURL, const nsString& aCookie) return NS_OK; } -#ifdef SingleSignon -NS_IMETHODIMP -nsNetlibService::SI_DisplaySignonInfoAsHTML(){ - ::SI_DisplaySignonInfoAsHTML(NULL); - return NS_OK; -} - -NS_IMETHODIMP -nsNetlibService::SI_RememberSignonData - (char* URLName, char** name_array, char** value_array, char** type_array, PRInt32 value_cnt) { - ::SI_RememberSignonData(URLName, name_array, value_array, type_array, value_cnt); - return NS_OK; -} - -NS_IMETHODIMP -nsNetlibService::SI_RestoreSignonData - (char* URLName, char* name, char** value) { - ::SI_RestoreSignonData(URLName, name, value); - return NS_OK; -} - -#endif - #ifdef CookieManagement NS_IMETHODIMP nsNetlibService::NET_DisplayCookieInfoAsHTML(){ diff --git a/network/module/nsNetService.h b/network/module/nsNetService.h index fc306c91f77..2984adaa392 100644 --- a/network/module/nsNetService.h +++ b/network/module/nsNetService.h @@ -53,14 +53,6 @@ public: NS_IMETHOD GetCookieString(nsIURL *aURL, nsString& aCookie); NS_IMETHOD SetCookieString(nsIURL *aURL, const nsString& aCookie); -#ifdef SingleSignon - NS_IMETHOD SI_DisplaySignonInfoAsHTML(); - NS_IMETHOD SI_RememberSignonData - (char* URLName, char** name_array, char** value_array, char** type_array, PRInt32 value_cnt); - NS_IMETHOD SI_RestoreSignonData - (char* URLNAME, char* name, char** value); -#endif - #ifdef CookieManagement NS_IMETHOD NET_DisplayCookieInfoAsHTML(); #ifdef PrivacySiteInfo