summaryrefslogtreecommitdiffstats
path: root/src/windows/identity/ui
diff options
context:
space:
mode:
authorJeffrey Altman <jaltman@secure-endpoints.com>2006-11-17 17:23:24 +0000
committerJeffrey Altman <jaltman@secure-endpoints.com>2006-11-17 17:23:24 +0000
commitf893735bf76cee0a7fea6bb092e4ee4bc84eac9c (patch)
treeb5e74aef9b42ba8e82de615e605c12468c341e4c /src/windows/identity/ui
parent8dfa77032485a51aed1aafba747b27234875c423 (diff)
downloadkrb5-f893735bf76cee0a7fea6bb092e4ee4bc84eac9c.tar.gz
krb5-f893735bf76cee0a7fea6bb092e4ee4bc84eac9c.tar.xz
krb5-f893735bf76cee0a7fea6bb092e4ee4bc84eac9c.zip
commits for KFW 3.1 Beta 4
KfW 3.1 beta 4 (NetIDMgr 1.1.6.0) nidmgr32.dll (1.1.6.0) - Fix a race condition where the initialization process might be flagged as complete even if the identity provider hasn't finished initialization yet. krb5cred.dll (1.1.6.0) - When assigning the default credentials cache for each identity, favor API and FILE caches over MSLSA if they exist. - When renewing an identity which was the result of importing credentials from the MSLSA cache, attempt to re-import the credentials from MSLSA instead of renewing the imported credentials. - Prevent possible crash if a Kerberos 5 context could not be obtained during the renewal operation. - Prevent memory leak in the credentials destroy handler due to the failure to free a Kerberos 5 context. - Properly match principals and realms when importing credentials from the MSLSA cache. - Determine the correct credentials cache to place imported credentials in by checking the configuration for preferred cache name. - Keep track of identities where credentials imports have occurred. - When setting the default identity, ignore the KRB5CCNAME environment variable. - Do not re-compute the credentials cache and timestamps when updating an identity. The cache and timestamp information is computed when listing credentials and do not change between listing and identity update. - When refreshing the default identity, also handle the case where the default credentials cache does not contain a principal, but the name of the cache can be used to infer the principal name. - Invoke a listing of credentials after a successful import. - Do not free a Kerberos 5 context prematurely during plug-in initialization. netidmgr.exe (1.1.6.0) - Fix the UI context logic to handle layouts which aren't based around identities. - Don't try to show a property sheet when there are no property pages supplied for the corresponding UI context. - Use consistent context menus. - Bring a modal dialog box to the foreground when it should be active. - Do not accept action triggers when the application is not ready to process actions yet. - Do not force the new credentials dialog to the top if there's already a modal dialog box showing. - Change the default per-identity layout to also group by location. ticket: new tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18828 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/windows/identity/ui')
-rw-r--r--src/windows/identity/ui/credwnd.c65
-rw-r--r--src/windows/identity/ui/main.c9
-rw-r--r--src/windows/identity/ui/mainwnd.c15
-rw-r--r--src/windows/identity/ui/newcredwnd.c11
-rw-r--r--src/windows/identity/ui/uiconfig.csv9
5 files changed, 83 insertions, 26 deletions
diff --git a/src/windows/identity/ui/credwnd.c b/src/windows/identity/ui/credwnd.c
index 36e0572fe..c9b314b3d 100644
--- a/src/windows/identity/ui/credwnd.c
+++ b/src/windows/identity/ui/credwnd.c
@@ -2981,15 +2981,7 @@ cw_set_row_context(khui_credwnd_tbl * tbl, int row)
o = (khui_credwnd_outline *) tbl->rows[row].data;
if (tbl->cols[o->col].attr_id == KCDB_ATTR_ID_NAME) {
- if (TPARENT(o) == NULL) { /* selected an identity */
- khui_context_set(KHUI_SCOPE_IDENT,
- (khm_handle) o->data,
- KCDB_CREDTYPE_INVALID,
- NULL,
- NULL,
- 0,
- tbl->credset);
- } else {
+ if (TPARENT(o) != NULL) {
khui_credwnd_outline * op;
op = TPARENT(o);
@@ -3005,8 +2997,30 @@ cw_set_row_context(khui_credwnd_tbl * tbl, int row)
0,
tbl->credset);
} else {
- set_context = FALSE;
+ /* we can't narrow it down using the standard set
+ of scopes. We consider this to be an identity
+ selection because the user right-clicked on an
+ identity header. */
+ khui_context_set(KHUI_SCOPE_IDENT,
+ (khm_handle) o->data,
+ KCDB_CREDTYPE_INVALID,
+ NULL,
+ NULL,
+ 0,
+ tbl->credset);
}
+ } else {
+ /* The user clicked on an identity header. Even
+ though not all credentials belonging to the
+ identity maybe within the scope right now, we still
+ consider this to be an identity scope. */
+ khui_context_set(KHUI_SCOPE_IDENT,
+ (khm_handle) o->data,
+ KCDB_CREDTYPE_INVALID,
+ NULL,
+ NULL,
+ 0,
+ tbl->credset);
}
} else if (tbl->cols[o->col].attr_id == KCDB_ATTR_TYPE_NAME) {
if (TPARENT(o) == NULL) {
@@ -3022,9 +3036,12 @@ cw_set_row_context(khui_credwnd_tbl * tbl, int row)
khui_credwnd_outline * op;
op = TPARENT(o);
- if (tbl->cols[op->col].attr_id == KCDB_ATTR_ID_NAME &&
- TPARENT(op) == NULL) {
- /* credtype under an identity */
+ if (tbl->cols[op->col].attr_id == KCDB_ATTR_ID_NAME) {
+ /* credtype under an identity. Even though not
+ all the credentials of this credtype belonging
+ to this identity might be within the scope, we
+ still consider this to be a type selection
+ under a specific identity. */
khui_context_set(KHUI_SCOPE_CREDTYPE,
(khm_handle) op->data,
(khm_int32) (DWORD_PTR) o->data,
@@ -4051,6 +4068,16 @@ cw_properties(HWND hwnd)
khm_size t = 0;
khm_int32 cred_type;
+ if (ctx.identity == NULL) {
+ /* currently, we can't show a property sheet at this point
+ since most credentials providers don't provide a
+ property sheet that works without an identity. */
+
+ khui_context_release(&ctx);
+ khui_ps_destroy_sheet(ps);
+ return TRUE;
+ }
+
cred_type = ctx.cred_type;
ps->header.hInstance = khm_hInstance;
@@ -4073,6 +4100,8 @@ cw_properties(HWND hwnd)
ps->header.pszCaption = NULL;
}
} else {
+ /* we don't actually reach here since we handle this case
+ above */
kcdb_credtype_describe(cred_type, NULL, &t, KCDB_TS_LONG);
if(t > 0) {
ps->header.pszCaption = PMALLOC(t);
@@ -4488,15 +4517,21 @@ cw_wm_contextmenu(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
cw_set_row_context(tbl, row);
+ khm_menu_show_panel(KHUI_MENU_IDENT_CTX, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
+
+#if 0
+ /* calling cw_set_row_context() should take care of enabling or
+ disabling actions as appropriate. We don't need to
+ differentiate between IDENT_CTX and TOK_CTX here. */
if((tbl->rows[row].flags & KHUI_CW_ROW_HEADER) &&
- (tbl->cols[tbl->rows[row].col].attr_id == KCDB_ATTR_ID_NAME))
- {
+ (tbl->cols[tbl->rows[row].col].attr_id == KCDB_ATTR_ID_NAME)) {
khm_menu_show_panel(KHUI_MENU_IDENT_CTX, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
//khui_context_reset();
} else {
khm_menu_show_panel(KHUI_MENU_TOK_CTX, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
//khui_context_reset();
}
+#endif
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
diff --git a/src/windows/identity/ui/main.c b/src/windows/identity/ui/main.c
index 80b7be3e5..e2210782f 100644
--- a/src/windows/identity/ui/main.c
+++ b/src/windows/identity/ui/main.c
@@ -192,12 +192,11 @@ void khm_add_dialog(HWND dlg) {
meaningful value until we enter a modal loop */
khui_dialogs[n_khui_dialogs].active = FALSE;
n_khui_dialogs++;
- }
+ } else {
#if DEBUG
- else {
- assert(FALSE);
- }
+ assert(FALSE);
#endif
+ }
}
/* should only be called from the UI thread */
@@ -254,6 +253,8 @@ void khm_enter_modal(HWND hwnd) {
EnableWindow(khm_hwnd_main, FALSE);
khui_modal_dialog = hwnd;
+
+ SetForegroundWindow(hwnd);
}
}
diff --git a/src/windows/identity/ui/mainwnd.c b/src/windows/identity/ui/mainwnd.c
index c03d47f1d..eba23e40e 100644
--- a/src/windows/identity/ui/mainwnd.c
+++ b/src/windows/identity/ui/mainwnd.c
@@ -226,22 +226,37 @@ khm_main_wnd_proc(HWND hwnd,
return 0;
case KHUI_ACTION_PASSWD_ID:
+ if (khm_startup.processing)
+ return 0;
+
khm_cred_change_password(NULL);
return 0;
case KHUI_ACTION_NEW_CRED:
+ if (khm_startup.processing)
+ return 0;
+
khm_cred_obtain_new_creds(NULL);
return 0;
case KHUI_ACTION_RENEW_CRED:
+ if (khm_startup.processing)
+ return 0;
+
khm_cred_renew_creds();
return 0;
case KHUI_ACTION_DESTROY_CRED:
+ if (khm_startup.processing)
+ return 0;
+
khm_cred_destroy_creds(FALSE, FALSE);
return 0;
case KHUI_ACTION_SET_DEF_ID:
+ if (khm_startup.processing)
+ return 0;
+
khm_cred_set_default();
return 0;
diff --git a/src/windows/identity/ui/newcredwnd.c b/src/windows/identity/ui/newcredwnd.c
index a0472e236..7bad1e24c 100644
--- a/src/windows/identity/ui/newcredwnd.c
+++ b/src/windows/identity/ui/newcredwnd.c
@@ -819,14 +819,12 @@ nc_handle_wm_create(HWND hwnd,
#endif
/* we defer the creation of the tab buttons for later */
- /* add this to the dialog chain */
- khm_add_dialog(hwnd);
-
/* bring the window to the top, if necessary */
if (KHM_SUCCEEDED(khc_read_int32(NULL,
L"CredWindow\\Windows\\NewCred\\ForceToTop",
&t)) &&
- t != 0) {
+ t != 0 &&
+ !khm_is_dialog_active()) {
/* if the main window is not visible, then the SetWindowPos()
call is sufficient to bring the new creds window to the
@@ -840,6 +838,9 @@ nc_handle_wm_create(HWND hwnd,
}
+ /* add this to the dialog chain */
+ khm_add_dialog(hwnd);
+
return TRUE;
}
@@ -1431,7 +1432,7 @@ static LRESULT nc_handle_wm_nc_notify(HWND hwnd,
nc_update_credtext(d);
- ShowWindow(hwnd, SW_SHOW);
+ ShowWindow(hwnd, SW_SHOWNOACTIVATE);
SetFocus(hwnd);
if (d->nc->n_identities == 0)
diff --git a/src/windows/identity/ui/uiconfig.csv b/src/windows/identity/ui/uiconfig.csv
index f1bb4b195..9f5e5e4b3 100644
--- a/src/windows/identity/ui/uiconfig.csv
+++ b/src/windows/identity/ui/uiconfig.csv
@@ -71,7 +71,7 @@ CredWindow,KC_SPACE,0,Options for the credentials window
Custom_0,KC_ENDSPACE,0,
ByIdentity,KC_SPACE,0,The default view
Description,KC_STRING,View grouped by identity and credential type,
- ColumnList,KC_STRING,"_CWFlags,IdentityName,TypeName,Name,TimeLeft",
+ ColumnList,KC_STRING,"_CWFlags,IdentityName,TypeName,Location,Name,TimeLeft",
Columns,KC_SPACE,0,Columns
_CWFlags,KC_SPACE,0,
Width,KC_INT32,20,
@@ -87,9 +87,14 @@ CredWindow,KC_SPACE,0,Options for the credentials window
SortIndex,KC_INT32,1
Flags,KC_INT32,11
TypeName,KC_ENDSPACE,0
+ Location,KC_SPACE,0,
+ Width,KC_INT32,50
+ SortIndex,KC_INT32,2
+ Flags,KC_INT32,11
+ Location,KC_ENDSPACE,0,
Name,KC_SPACE,0
Width,KC_INT32,200
- SortIndex,KC_INT32,2
+ SortIndex,KC_INT32,3
Flags,KC_INT32,3
Name,KC_ENDSPACE,0
TimeLeft,KC_SPACE,0