add log-out ability to password manager

This commit is contained in:
morse%netscape.com 2000-03-31 15:41:04 +00:00
Родитель 558cf5d1f1
Коммит e9e2380bbb
8 изменённых файлов: 23 добавлений и 8 удалений

Просмотреть файл

@ -54,6 +54,7 @@ interface nsIWalletService : nsISupports {
void WALLET_Prefill(in nsIPresShell shell, in boolean quick); void WALLET_Prefill(in nsIPresShell shell, in boolean quick);
[noscript]void WALLET_PrefillReturn(in nsAutoString results); [noscript]void WALLET_PrefillReturn(in nsAutoString results);
void WALLET_FetchFromNetCenter(); void WALLET_FetchFromNetCenter();
void WALLET_ExpirePassword();
boolean PromptUsernameAndPasswordURL(in wstring text, out wstring user, out wstring pwd, in string urlname, in boolean stripUrl, in nsIPrompt dialog); boolean PromptUsernameAndPasswordURL(in wstring text, out wstring user, out wstring pwd, in string urlname, in boolean stripUrl, in nsIPrompt dialog);
boolean PromptPasswordURL(in wstring text, out wstring pwd, in string urlname, in boolean stripUrl, in nsIPrompt dialog); boolean PromptPasswordURL(in wstring text, out wstring pwd, in string urlname, in boolean stripUrl, in nsIPrompt dialog);

Просмотреть файл

@ -104,6 +104,11 @@ NS_IMETHODIMP nsWalletlibService::WALLET_FetchFromNetCenter(){
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP nsWalletlibService::WALLET_ExpirePassword(){
::WLLT_ExpirePassword();
return NS_OK;
}
NS_IMETHODIMP nsWalletlibService::PromptUsernameAndPasswordURL NS_IMETHODIMP nsWalletlibService::PromptUsernameAndPasswordURL
(const PRUnichar *text, PRUnichar **user, PRUnichar **pwd, (const PRUnichar *text, PRUnichar **user, PRUnichar **pwd,
const char *urlname, PRBool stripUrl, nsIPrompt* dialog, PRBool *returnValue) { const char *urlname, PRBool stripUrl, nsIPrompt* dialog, PRBool *returnValue) {

Просмотреть файл

@ -50,6 +50,7 @@ public:
NS_IMETHOD WALLET_Prefill(nsIPresShell* shell, PRBool quick); NS_IMETHOD WALLET_Prefill(nsIPresShell* shell, PRBool quick);
NS_IMETHOD WALLET_PrefillReturn(nsAutoString results); NS_IMETHOD WALLET_PrefillReturn(nsAutoString results);
NS_IMETHOD WALLET_FetchFromNetCenter(); NS_IMETHOD WALLET_FetchFromNetCenter();
NS_IMETHOD WALLET_ExpirePassword();
NS_IMETHOD PromptUsernameAndPasswordURL NS_IMETHOD PromptUsernameAndPasswordURL
(const PRUnichar *text, PRUnichar **user, PRUnichar **pwd, (const PRUnichar *text, PRUnichar **user, PRUnichar **pwd,

Просмотреть файл

@ -1523,11 +1523,12 @@ Wallet_KeyResetTime() {
} }
} }
PRIVATE void PUBLIC void
wallet_KeyTimeoutImmediately() { WLLT_ExpirePassword() {
if (Wallet_IsKeySet()) { if (Wallet_IsKeySet()) {
keyExpiresTime = time(NULL); keyExpiresTime = time(NULL);
} }
SI_RemoveAllSignonData();
} }
PUBLIC PRBool PUBLIC PRBool
@ -2927,8 +2928,7 @@ void WLLT_ChangePassword() {
} }
/* force the user to supply old database key, for security */ /* force the user to supply old database key, for security */
wallet_KeyTimeoutImmediately(); WLLT_ExpirePassword();
SI_RemoveAllSignonData();
/* read in user data using old key */ /* read in user data using old key */
wallet_Initialize(PR_FALSE); wallet_Initialize(PR_FALSE);

Просмотреть файл

@ -70,6 +70,9 @@ WLLT_OnSubmit (nsIContent* formNode);
extern void extern void
WLLT_FetchFromNetCenter(); WLLT_FetchFromNetCenter();
extern void
WLLT_ExpirePassword();
extern NS_METHOD extern NS_METHOD
Wallet_GetMasterPassword(PRUnichar **password); Wallet_GetMasterPassword(PRUnichar **password);

Просмотреть файл

@ -253,13 +253,16 @@ function CheckForWallet()
// perform a wallet action // perform a wallet action
function WalletAction( action ) function WalletAction( action )
{ {
if (action == "password" || action == "expire") {
if (action == "password") {
/* process "password" independent of appcore so it can be called from mail */
wallet = Components.classes['component://netscape/wallet']; wallet = Components.classes['component://netscape/wallet'];
wallet = wallet.getService(); wallet = wallet.getService();
wallet = wallet.QueryInterface(Components.interfaces.nsIWalletService); wallet = wallet.QueryInterface(Components.interfaces.nsIWalletService);
wallet.WALLET_ChangePassword();
if (action == "password") {
wallet.WALLET_ChangePassword();
} else if (action == "expire") {
wallet.WALLET_ExpirePassword();
}
return; return;
} }

Просмотреть файл

@ -40,6 +40,7 @@
<menupopup> <menupopup>
<menuitem value="&walletDisplaySignonsCmd.label;" oncommand="WalletDialog('signon');"/> <menuitem value="&walletDisplaySignonsCmd.label;" oncommand="WalletDialog('signon');"/>
<menuitem value="&walletChangePasswordCmd.label;" oncommand="WalletAction('password');"/> <menuitem value="&walletChangePasswordCmd.label;" oncommand="WalletAction('password');"/>
<menuitem value="&walletExpirePasswordCmd.label;" oncommand="WalletAction('expire');"/>
</menupopup> </menupopup>
</menu> </menu>
<menu value="&walletCookieManager.label;"> <menu value="&walletCookieManager.label;">

Просмотреть файл

@ -37,5 +37,6 @@
<!ENTITY walletInterviewCmd.label "Interview"> <!ENTITY walletInterviewCmd.label "Interview">
<!ENTITY walletSamplesCmd.label "Demonstration"> <!ENTITY walletSamplesCmd.label "Demonstration">
<!ENTITY walletChangePasswordCmd.label "Change Master Password..."> <!ENTITY walletChangePasswordCmd.label "Change Master Password...">
<!ENTITY walletExpirePasswordCmd.label "Log Out">
<!ENTITY walletCookieManager.label "Cookie Manager"> <!ENTITY walletCookieManager.label "Cookie Manager">
<!ENTITY walletImageManager.label "Image Manager"> <!ENTITY walletImageManager.label "Image Manager">