\r
#RMAKE=$(MAKECMD) /nologo all KH_NO_WX=1\r
RMAKE=$(MAKECMD) /nologo all\r
+RMAKE_W2K=$(MAKECMD) /nologo all KHBUILD_W2K=1\r
\r
!else\r
RMAKE=$(MAKECMD) /nologo etag\r
+RMAKE_W2K=$(MAKECMD) /nologo etag KHBUILD_W2K=1\r
!endif\r
!else\r
RMAKE=$(MAKECMD) /nologo test\r
+RMAKE_W2K=$(MAKECMD) /nologo test KHBUILD_W2K=1\r
!endif\r
!else\r
RMAKE=$(MAKECMD) /nologo clean\r
+RMAKE_W2K=$(MAKECMD) /nologo clean KHBUILD_W2K=1\r
!endif\r
\r
start:\r
$(ECHO) -- Entering $@:\r
$(CD) $@\r
$(RMAKE)\r
+ $(RMAKE_W2K)\r
$(CD) ..\r
$(ECHO) -- Done with $@\r
\r
$(ECHO) -- Entering $@\r
$(CD) $@\r
$(RMAKE)\r
+ $(RMAKE_W2K)\r
$(CD) ..\r
$(ECHO) -- Done with $@\r
\r
$(ECHO) -- Entering $@:\r
$(CD) $@\r
$(RMAKE)\r
+ $(RMAKE_W2K)\r
$(CD) ..\r
$(ECHO) -- Done with $@\r
\r
$(ECHO) -- Done with $@\r
!endif\r
\r
-finale: krb5plugin doc\r
+finale: krb5plugin\r
$(ECHO) -- Done.\r
\r
pdoc:\r
! endif\r
! if !exist($(DOCDIR))\r
-$(MKDIR) $(DOCDIR)\r
+! endif\r
+! if !exist($(OBJDIR)\W2K)\r
+ -$(MKDIR) $(OBJDIR)\W2K\r
+! endif\r
+! if !exist($(BINDIR)\W2K)\r
+ -$(MKDIR) $(BINDIR)\W2K\r
+! endif\r
+! if !exist($(LIBDIR)\W2K)\r
+ -$(MKDIR) $(LIBDIR)\W2K\r
! endif\r
$(ECHO) Done creating directories.\r
\r
--- /dev/null
+#\r
+# Khimaira : Win32 configuration makefile\r
+# This file will be included by all the makefiles\r
+# in the build tree.\r
+#\r
+# Copyright (c) 2004,2005 Massachusetts Institute of Technology\r
+#\r
+# Permission is hereby granted, free of charge, to any person\r
+# obtaining a copy of this software and associated documentation files\r
+# (the "Software"), to deal in the Software without restriction,\r
+# including without limitation the rights to use, copy, modify, merge,\r
+# publish, distribute, sublicense, and/or sell copies of the Software,\r
+# and to permit persons to whom the Software is furnished to do so,\r
+# subject to the following conditions:\r
+#\r
+# The above copyright notice and this permission notice shall be\r
+# included in all copies or substantial portions of the Software.\r
+#\r
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+# SOFTWARE.\r
+\r
+!ifndef KHIMAIRA_WIN32_CONFIG\r
+KHIMAIRA_WIN32_CONFIG=1\r
+\r
+# Environment Variables\r
+# The following environment variables MUST be set:\r
+# KH_ROOT : Root of the source tree.\r
+# KH_BUILD: One of DEBUG or RETAIL\r
+#\r
+# The following environment variables are optional:\r
+# KH_RUNTIME: One of STATIC or DLL, specifies whether the CRT libs\r
+# are linked statically or through MSVCRT.DLL.\r
+# KH_AUXCFLAGS: Optional flags for CL\r
+# KH_RELEASE: Release type. One of OFFICIAL, PRERELEASE, PRIVATE or SPECIAL.\r
+# OFFICIAL : An official release of Khimaira\r
+# PREPRELEASE: A beta/release candidate release\r
+# PRIVATE : Private build\r
+# SPECIAL : Special build. Typically one with non-mainline patches.\r
+\r
+# Version info\r
+NETIDMGR_VERSION_MAJOR=1\r
+NETIDMGR_VERSION_MINOR=1\r
+NETIDMGR_VERSION_PATCH=0\r
+NETIDMGR_VERSION_AUX=1\r
+NETIDMGR_RELEASEDESC=\r
+\r
+# The API version. This number must be incremented each time the API\r
+# changes. Plugins specify the version of the API that they were\r
+# compiled against and the Module Manager uses the API numbers to\r
+# decide whether the plugin is safe to load or not.\r
+#\r
+# Changes to the API version numbers should be documented in\r
+# apiversion.txt at the root of the source tree.\r
+NETIDMGR_VERSION_API=5\r
+\r
+# Minimum backwards compatible version. API versions from\r
+# NETIDMGR_VERSION_API_MINCOMPAT through NETIDMGR_VERSION_API\r
+# inclusive, are compatible with this version.\r
+NETIDMGR_VERSION_API_MINCOMPAT=5\r
+\r
+NETIDMGR_VERSION=$(NETIDMGR_VERSION_MAJOR).$(NETIDMGR_VERSION_MINOR).$(NETIDMGR_VERSION_PATCH).$(NETIDMGR_VERSION_AUX)\r
+NETIDMGR_VERSIONC=$(NETIDMGR_VERSION_MAJOR),$(NETIDMGR_VERSION_MINOR),$(NETIDMGR_VERSION_PATCH),$(NETIDMGR_VERSION_AUX)\r
+\r
+# Source information\r
+NETIDMGR_SRC_COMPANY_1033=Massachusetts Institute of Technology\r
+NETIDMGR_SRC_COPYRIGHT_1033=(C) 2005 Massachusetts Institute of Technology\r
+\r
+# Choose the default build type if one is not set\r
+!if ("$(KH_BUILD)" != "DEBUG") && ("$(KH_BUILD)" != "RETAIL")\r
+! if defined(NODEBUG) && "$(NODEBUG)"=="1"\r
+KH_BUILD=RETAIL\r
+! else\r
+KH_BUILD=DEBUG\r
+! endif\r
+!endif\r
+\r
+!if "$(KH_BUILD)"=="DEBUG" && defined(NODEBUG) && "$(NODEBUG)"=="1"\r
+! error The Khimaira build configuration is set for DEBUG while the Platform SDK build environment is set to RETAIL.\r
+!endif\r
+\r
+# The default release type is PRIVATE is no other type is specified\r
+!if ("$(KH_RELEASE)" != "OFFICIAL") && ("$(KH_RELEASE)" != "PRERELEASE") && ("$(KH_RELEASE)" != "PRIVATE") && ("$(KH_RELEASE)" != "SPECIAL")\r
+KH_RELEASE=PRIVATE\r
+!endif\r
+\r
+# Actual build environment settings\r
+\r
+# See what compiler we are using\r
+# TODO: Update this to support other compilers\r
+!if defined(MSVCVer) && "$(MSVCVer)"=="8.0"\r
+KH_CLVER=vc8\r
+!else\r
+KH_CLVER=vc7\r
+!endif\r
+\r
+# Check for required env vars\r
+!ifndef MODULE\r
+! error MODULE must be specified\r
+!endif\r
+!ifndef KH_ROOT\r
+! ifndef PISMERE\r
+! error Either KH_ROOT or PISMERE must be defined\r
+! else\r
+KH_ROOT=$(PISMERE)\athena\auth\krb5\src\windows\identity\r
+! endif\r
+!endif\r
+\r
+!ifdef NODEBUG\r
+OUTPRE_DBG=rel\r
+!else\r
+OUTPRE_DBG=dbg\r
+!endif\r
+OUTPRE1=obj\r
+OUTPRE2=$(OUTPRE1)\$(CPU)\r
+OUTPRE3=$(OUTPRE2)\$(OUTPRE_DBG)\r
+OUTPRE=$(OUTPRE3)^\\r
+\r
+\r
+\r
+# Output directory structure\r
+DESTROOT=$(KH_ROOT)\obj\r
+OBJROOT=$(KH_ROOT)\obj\r
+SRC=$(KH_ROOT)\r
+\r
+DESTDIR=$(DESTROOT)\$(CPU)\$(OUTPRE_DBG)\r
+OBJDIR=$(OBJROOT)\$(CPU)\$(OUTPRE_DBG)\r
+\r
+OBJ=$(OBJDIR)\$(MODULE)\r
+INCDIR=$(DESTDIR)\inc\r
+#BINDIR=$(DESTDIR)\bin\r
+BINDIR=$(KH_ROOT)\$(OUTPRE)\W2K\r
+#LIBDIR=$(DESTDIR)\lib\r
+LIBDIR=$(KH_ROOT)\$(OUTPRE)\W2K\r
+DOCDIR=$(DESTDIR)\doc\r
+\r
+# Source directories\r
+CONFDIR=$(SRC)\config\r
+\r
+# Setup environment for win32.mak\r
+\r
+!if "$(KH_BUILD)" == "RETAIL"\r
+NODEBUG=1\r
+!endif\r
+\r
+# Win32.mak\r
+APPVER=5.0\r
+TARGETOS=WINNT\r
+_WIN32_IE=0x0500\r
+_WIN32_WINNT=0x0500\r
+!include <Win32.Mak>\r
+\r
+# Program macros\r
+\r
+CD=cd\r
+RM=del /q\r
+MKDIR=mkdir\r
+RMDIR=rmdir\r
+ECHO=echo\r
+MAKECMD=nmake /nologo\r
+CP=copy /y\r
+LINK=link\r
+CCSV=perl $(SRC)\config\ccsv.pl\r
+MC=mc\r
+\r
+!ifdef KH_DOXYFULLPATH\r
+DOXYGEN=$(KH_DOXYFULLPATH)\r
+!else\r
+DOXYGEN=doxygen\r
+!endif\r
+\r
+!ifdef KH_HHCFULLPATH\r
+HHC=$(KH_HHCFULLPATH)\r
+!else\r
+HHC=hhc\r
+!endif\r
+\r
+!ifdef KH_KFWPATH\r
+KFWINCDIR=$(KH_KFWPATH)\inc\r
+kfwincflags = -I$(KFWINCDIR)\krb5 -I$(KFWINCDIR)\krb5\KerberosIV -I$(KFWINCDIR)\krb4 -I$(KFWINCDIR)\loadfuncs -I$(KFWINCDIR)\r
+KFWLIBDIR=$(KH_KFWPATH)\lib\$(CPU)\r
+!else if defined(PISMERE)\r
+KFWINCDIR=$(PISMERE)\athena\auth\krb5\src\include\r
+kfwincflags = -I$(KFWINCDIR) -I$(PISMERE)\athena\util\loadfuncs -I$(PISMERE)\athena\auth\krb5\src\include\kerberosIV -I$(PISMERE)\athena\auth\krb4\include\r
+KFWLIBDIR=$(PISMERE)\target\lib\$(CPU)\$(OUTPRE_DBG)\r
+!endif\r
+\r
+!ifdef KH_AFSPATH\r
+AFSINCDIR=$(KH_AFSPATH)\include\r
+AFSLIBDIR=$(KH_AFSPATH)\lib\r
+afsincflags=-I$(AFSINCDIR)\r
+!endif\r
+\r
+#EXTLIBDIR=$(SRC)\ext-lib\$(CPU)\r
+#EXTINCDIR=-I$(SRC)\ext-inc\r
+\r
+incflags= -I$(INCDIR) -I$(SRC)\include -I. -I$(OBJ) $(kfwincflags) $(afsincflags)\r
+rincflags= /i $(INCDIR) /i $(SRC)\include /i .\r
+khdefines=-DUNICODE -D_UNICODE\r
+khcwarn=/Wp64\r
+!ifndef KH_NO_WX\r
+khcwarn=$(khcwarn) /WX\r
+!endif\r
+\r
+#DEBUG_SYMBOLS\r
+ldebug=$(ldebug) /DEBUG\r
+cdebug=$(cdebug) -Os -Zi\r
+\r
+khcflags=$(cdebug) $(cflags) $(incflags) $(khdefines) $(khcwarn)\r
+khlguiflags=$(ldebug) $(guilflags)\r
+khlconflags=$(ldebug) $(conlflags)\r
+khldllguiflags=$(ldebug) $(dlllflags)\r
+khldllconflags=$(ldebug) $(dlllflags)\r
+\r
+!if "$(KH_RUNTIME)" == "STATIC"\r
+khcflags=$(khcflags) $(cvarsmt)\r
+khlguiflags=$(khlguiflags) $(guilibsmt)\r
+khlconflags=$(khlconflags) $(conlibsmt)\r
+khldllguiflags=$(khldllguiflags) $(guilibsmt)\r
+khldllconflags=$(khldllconflags) $(conlibsmt)\r
+!else\r
+khcflags=$(khcflags) $(cvarsdll)\r
+khlguiflags=$(khlguiflags) $(guilibsdll)\r
+khlconflags=$(khlconflags) $(conlibsdll)\r
+khldllguiflags=$(khldllguiflags) $(guilibsdll)\r
+khldllconflags=$(khldllconflags) $(conlibsdll)\r
+!endif\r
+\r
+C2OBJ=$(CC) $(khcflags) $(KH_AUXCFLAGS) /Fo"$@" /c $**\r
+\r
+EXECONLINK=$(LINK) /NOLOGO $(khlconflags) /OUT:$@ $**\r
+\r
+EXEGUILINK=$(LINK) /NOLOGO $(khlguiflags) /OUT:$@ $**\r
+\r
+DLLCONLINK=$(LINK) /NOLOGO $(khldllconflags) /OUT:$@ /IMPLIB:$(LIBDIR)\$(@B).lib $**\r
+\r
+DLLGUILINK=$(LINK) /NOLOGO $(khldllguiflags) /OUT:$@ /IMPLIB:$(LIBDIR)\$(@B).lib $**\r
+\r
+DLLRESLINK=$(LINK) /NOLOGO /DLL /NOENTRY /MACHINE:$(PROCESSOR_ARCHITECTURE) /OUT:$@ $**\r
+\r
+RC2RES=$(RC) $(RFLAGS) $(rincflags) /fo $@ $**\r
+\r
+MC2RC=$(MC) $(MCFLAGS) -h $(OBJ)\ -m 1024 -r $(OBJ)\ -x $(OBJ)\ $**\r
+\r
+{}.c{$(OBJ)}.obj:\r
+ $(C2OBJ)\r
+\r
+{$(OBJ)}.c{$(OBJ)}.obj:\r
+ $(C2OBJ)\r
+\r
+{}.h{$(INCDIR)}.h:\r
+ $(CP) $** $@\r
+\r
+{}.rc{$(OBJ)}.res:\r
+ $(RC2RES)\r
+\r
+{$(OBJ)}.rc{$(OBJ)}.res:\r
+ $(RC2RES)\r
+\r
+clean::\r
+!if exist($(OBJ))\r
+ $(RM) $(OBJ)\\r
+!endif\r
+\r
+test::\r
+\r
+mkdirs::\r
+!if !exist($(LIBDIR))\r
+ $(MKDIR) $(LIBDIR)\r
+!endif\r
+!if !exist($(BINDIR))\r
+ $(MKDIR) $(BINDIR)\r
+!endif\r
+!if !exist($(OBJ))\r
+ $(MKDIR) $(OBJ)\r
+!endif\r
+\r
+TAGFILE = $(SRC)\TAGS\r
+\r
+etag::\r
+ etags -o $(TAGFILE) -a *.c *.h\r
+\r
+.SUFFIXES: .h\r
+\r
+!endif\r
NETIDMGR_VERSION_MAJOR=1\r
NETIDMGR_VERSION_MINOR=1\r
NETIDMGR_VERSION_PATCH=0\r
-NETIDMGR_VERSION_AUX=0\r
+NETIDMGR_VERSION_AUX=1\r
NETIDMGR_RELEASEDESC=\r
\r
# The API version. This number must be incremented each time the API\r
# Source directories\r
CONFDIR=$(SRC)\config\r
\r
+# If we are forcing a Win2K build, we need to adjust the build\r
+# directories and environment.\r
+\r
+!ifdef KHBUILD_W2K\r
+\r
+OBJ=$(OBJ)\W2K\r
+BINDIR=$(BINDIR)\W2K\r
+LIBDIR=$(LIBDIR)\W2K\r
+\r
+APPVER=5.0\r
+TARGETOS=WINNT\r
+_WIN32_IE=0x0500\r
+_WIN32_WINNT=0x0500\r
+\r
+!endif\r
+\r
# Setup environment for win32.mak\r
\r
!if "$(KH_BUILD)" == "RETAIL"\r
!endif\r
\r
# Win32.mak\r
+\r
!include <Win32.Mak>\r
\r
# Program macros\r
$(CHMFILE): netidmgr.hhp\r
-$(HHC) netidmgr.hhp\r
$(CP) netidmgr.chm $(CHMFILE)\r
+\r
+clean::\r
+ $(RM) $(CHMFILE)
\ No newline at end of file
from an instance of NetIDMgr with Kerberos 5, Kerberos 4 and OpenAFS\r
plugins with a Kerberos 5 identity manager. Actual display may be\r
different depending on the plugins that are active.</i></p>\r
-</p>\r
\r
<p>If the Kerberos 5 identity provider is used, the dialog will ask\r
for a username and a realm to determine the identity for which new\r
\r
<h3>Expanded view</h3>\r
\r
-<p>If you click any of the hyperlinks in the credentials summary\r
-window or select the <span class="pre">Options >></span> button,\r
-the dialog will switch to the exanded view. An example of this is\r
-shown below:\r
+<p>If you click any of the credentials type hyperlinks in the\r
+credentials summary window or select the <span class="pre">Options\r
+>></span> button, the dialog will switch to the exanded view.\r
+An example of this is shown below:\r
</p>\r
\r
<p>\r
alt="Expanded new credentials window" />\r
\r
<p class="caption">Expanded view of the new credetials dialog</p>\r
-</p>\r
\r
<p>\r
The expanded view provides access to additional options available for\r
\r
<h3>Credentials summary window</h3>\r
\r
-<p>\r
-The credentials summary window provides an overview of the credentials\r
-that will be obtained after the successful completion of the new\r
-credentials dialog. The window contains hyperlinks that will take you\r
-to the corresponding credentials option panels where you will be able\r
-to set additional options for each type.\r
+<p>The credentials summary window provides an overview of the\r
+credentials that will be obtained after the successful completion of\r
+the new credentials dialog. The window contains hyperlinks that will\r
+take you to the corresponding credentials option panels where you will\r
+be able to set additional options for each type.\r
</p>\r
\r
-<p>\r
-If there is a problem with the selected identity, the credentials\r
+<p>If there is a problem with the selected identity, the credentials\r
window will display a message describing the problem. For example:\r
</p>\r
\r
<html>\r
<head>\r
- <title>title</title>\r
- <meta name="description" content="">\r
- <meta name="keywords" content="">\r
+ <title>Renew Credentials</title>\r
+ <meta name="description" content="Renew Credentials">\r
+ <meta name="keywords" content="renew, credentials">\r
<link rel="stylesheet" type="text/css" href="nidmgr.css">\r
</head>\r
<body>\r
\r
+<h1>Renew Credentials</h1>\r
+\r
+<p>The renew credentials action can be invoked via the <a\r
+href="">Credential</a> menu or by pressing <span class="pre">Ctrl +\r
+R</span>. Additionally, if <span class="pre">Monitor credentials\r
+expiration</span> option is enabled for all identities or for a\r
+specific identity, then those credentials will be automatically\r
+renewed before they expire.</p>\r
+\r
+<p>An identity must be selected before invoking the renew credentials\r
+action.</p>\r
+\r
+<p>Not all credentials can be renewed. The actual logic of renewing\r
+the credentials is up to each credentials provider. In general\r
+NetIDMgr will invoke each credentials provider to renew their\r
+respective credentials. For Kerberos 5, if the initial ticket is\r
+renewable and not expired, then it will obtain a renewed initial\r
+ticket. For Kerberos 4, once a renewed Kerberos 5 initial ticket is\r
+obtained, it will try to use a Krb524 translator to obtain a new\r
+Kerberos 4 initial ticket.</p>\r
+\r
</body>\r
</html>
\ No newline at end of file
<html>\r
<head>\r
- <title>title</title>\r
- <meta name="description" content="">\r
- <meta name="keywords" content="">\r
+ <title>Set As Default Identity</title>\r
+ <meta name="description" content="Set the default identity">\r
+ <meta name="keywords" content="default, identity">\r
<link rel="stylesheet" type="text/css" href="nidmgr.css">\r
</head>\r
<body>\r
\r
+<h1>Set As Default Identity</h1>\r
+\r
+<p>\r
+</p>\r
+\r
</body>\r
</html>
\ No newline at end of file
<html>\r
<head>\r
- <title>title</title>\r
- <meta name="description" content="">\r
- <meta name="keywords" content="">\r
+ <title>NetIDMgr Concepts: Credentials Provider</title>\r
+ <meta name="description" content="NetIDMgr Concepts: Credentials Provider">\r
+ <meta name="keywords" content="credentials provider, concepts">\r
<link rel="stylesheet" type="text/css" href="nidmgr.css">\r
</head>\r
<body>\r
\r
+<h1>NetIDMgr Concepts: Credentials Provider</h1>\r
+\r
+<p>\r
+</p>\r
+\r
</body>\r
</html>
\ No newline at end of file
<html>\r
<head>\r
- <title>title</title>\r
- <meta name="description" content="">\r
- <meta name="keywords" content="">\r
+ <title>NetIDMgr Concepts: Identity Provider</title>\r
+ <meta name="description" content="NetIDMgr Concepts: Identity Provider">\r
+ <meta name="keywords" content="identity provider, concepts">\r
<link rel="stylesheet" type="text/css" href="nidmgr.css">\r
</head>\r
<body>\r
\r
+<h1>NetIDMgr Concepts: Identity Provider</h1>\r
+\r
+<p>\r
+</p>\r
+\r
</body>\r
</html>
\ No newline at end of file
<html>\r
<head>\r
- <title>Concepts: Identity</title>\r
- <meta name="description" content="Concepts: Identity">\r
+ <title>NetIDMgr Concepts: Identity</title>\r
+ <meta name="description" content="NetIDMgr Concepts: Identity">\r
<meta name="keywords" content="identity,concepts">\r
<link rel="stylesheet" type="text/css" href="nidmgr.css">\r
</head>\r
<body>\r
\r
-<h1>Concepts: Identity</h1>\r
+<h1>NetIDMgr Concepts: Identity</h1>\r
\r
<p>\r
</p>\r
<html>\r
<head>\r
- <title>title</title>\r
- <meta name="description" content="">\r
- <meta name="keywords" content="">\r
+ <title>NetIDMgr Concepts</title>\r
+ <meta name="description" content="NetIDMgr Concepts">\r
+ <meta name="keywords" content="concepts">\r
<link rel="stylesheet" type="text/css" href="nidmgr.css">\r
</head>\r
<body>\r
\r
+<h1>NetIDMgr Concepts</h1>\r
+\r
+<p>The Network Identity manager organizes and manages your credentials\r
+based on how they identify you to external services which use those\r
+credentials for authentication. To this end, it is assumed that each\r
+credential will uniquely identify the user to a service as a single\r
+principal or identity. \r
+</p>\r
+\r
+<p>\r
+</p>\r
+\r
+<p>The following topics provider further details: </p>\r
+\r
+<ul>\r
+ <li><a href="concept_identity.htm">Identity</a></li>\r
+\r
+ <li><a href="concept_ident_pro.htm">Identity Provider</a></li>\r
+\r
+ <li><a href="concept_cred_pro.htm">Credentials Provider</a></li>\r
+</ul>\r
+\r
</body>\r
</html>
\ No newline at end of file
including modifications that you make for internal use or for\r
distribution:</p>\r
\r
-<p>Copyright 1992-2005 by the Massachusetts Institute of Technology. All\r
+<p>Copyright 1992-2006 by the Massachusetts Institute of Technology. All\r
rights reserved.</p>\r
\r
<p>THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS\r
\r
</ul>\r
\r
+<h3>Credentials view</h3>\r
+<ul>\r
+\r
+ <li><a href="use_layout.htm">Managing the credentials view layout</a></li>\r
+\r
+</ul>\r
+\r
</body>\r
</html>
\ No newline at end of file
</p>\r
\r
<map id="menu_bar_map">\r
-<area shape = "rect" coords = "1,0,24,20" href = "menu_file.htm">\r
-<area shape = "rect" coords = "26,1,84,20" href = "menu_credential.htm">\r
-<area shape = "rect" coords = "85,1,118,20" href = "menu_view.htm">\r
-<area shape = "rect" coords = "122,1,165,20" href = "menu_options.htm">\r
-<area shape = "rect" coords = "166,2,199,20" href = "menu_help.htm">\r
+<area shape = "rect" coords = "0,1,34,20" href = "menu_file.htm">\r
+<area shape = "rect" coords = "37,2,110,20" href = "menu_credential.htm">\r
+<area shape = "rect" coords = "117,1,156,20" href = "menu_view.htm">\r
+<area shape = "rect" coords = "161,1,221,20" href = "menu_options.htm">\r
+<area shape = "rect" coords = "226,0,269,20" href = "menu_help.htm">\r
</map>\r
\r
<p>\r
</p>\r
\r
<map id="menumap">\r
-<area shape = "rect" coords = "10,24,214,45" href = "#new">\r
-<area shape = "rect" coords = "8,49,212,70" href = "#renew">\r
-<area shape = "rect" coords = "11,72,199,89" href = "#destroy">\r
-<area shape = "rect" coords = "13,96,213,113" href = "#def">\r
-<area shape = "rect" coords = "14,114,210,133" href = "#search">\r
-<area shape = "rect" coords = "8,137,211,159" href = "#chpw">\r
-<area shape = "rect" coords = "10,165,213,185" href = "#import">\r
+<area shape = "rect" coords = "18,21,248,46" href = "#new">\r
+<area shape = "rect" coords = "18,52,244,77" href = "#renew">\r
+<area shape = "rect" coords = "19,76,241,98" href = "#import">\r
+<area shape = "rect" coords = "19,98,231,121" href = "#destroy">\r
+<area shape = "rect" coords = "20,129,160,155" href = "#def">\r
+<area shape = "rect" coords = "21,164,225,185" href = "#chpw">\r
</map>\r
\r
<p>\r
See <span class="pre"><a href="act_set_default.htm">Set As Default\r
Action</a></span> for more information.</p></li>\r
\r
- <li><a name="search" /> <span class="title">Allow applications to\r
- search</span>: This action is currently not implemented.</li>\r
-\r
<li><a name="chpw" /> <span class="title">Change password...</span>:\r
Changes the password for the selected identity. However, once the\r
new password dialog opens, you can change the identity for which the\r
</p>\r
\r
<map id="menumap">\r
-<area shape = "rect" coords = "7,24,146,43" href = "#properties">\r
-<area shape = "rect" coords = "8,46,146,67" href = "#exit">\r
+<area shape = "rect" coords = "12,24,115,46" href = "#properties">\r
+<area shape = "rect" coords = "12,55,166,76" href = "#exit">\r
</map>\r
\r
<p>\r
dialog box control that you want help with.\r
</p>\r
\r
-<p>\r
-This is the help menu. While it is ironic that the help menu itself\r
-needs to be explained, we have decided to include it here just for\r
-completeness. It is bad enough that it is the last menu on the menu\r
-bar. We didn't want to pile on any more disrespect by not documenting\r
-it. We encourage you to not read this and just go ahead and click any\r
-item on this menu. If anything unexpected happens, please file a bug \r
-report at <a href="mailto:kfw-bugs@mit.edu">kfw-bugs@mit.edu</a>.\r
-</p>\r
+<map id="menumap">\r
+\r
+<area shape = "rect" coords = "12,27,166,48" href = "#ctx">\r
+<area shape = "rect" coords = "13,53,167,76" href = "#contents">\r
+<area shape = "rect" coords = "14,77,160,101" href = "#index">\r
+<area shape = "rect" coords = "15,107,173,132" href = "#about">\r
+\r
+</map>\r
\r
<p>\r
-<img src="images/screen_menu_help.bmp"/>\r
+<img src="images/screen_menu_help.bmp" usemap="#menumap"/>\r
</p>\r
\r
<ul>\r
</p>\r
\r
<map id="menumap">\r
-<area shape = "rect" coords = "10,23,93,41" href = "#general">\r
-<area shape = "rect" coords = "12,41,94,60" href = "#idents">\r
-<area shape = "rect" coords = "10,59,104,74" href = "#notifs">\r
+\r
+<area shape = "rect" coords = "12,24,139,48" href = "#general">\r
+<area shape = "rect" coords = "11,46,144,68" href = "#apperance">\r
+<area shape = "rect" coords = "11,68,142,89" href = "#identities">\r
+<area shape = "rect" coords = "12,91,139,111" href = "#notifications">\r
+<area shape = "rect" coords = "14,111,134,133" href = "#plugins">\r
+<area shape = "rect" coords = "12,141,139,208" href = "#pluginspec">\r
+\r
</map>\r
\r
<p>\r
<ul>\r
\r
<li><a name="general" /><span class="title">General ...</span>: Opens\r
-the NetIDMgr general configuration panel.</li>\r
+the NetIDMgr general configuration panel. This panel allows you to\r
+configure settings related to the startup/shutdown of NetIDMgr in\r
+addition to debugging and monitoring options.</li>\r
\r
-<li><a name="idents" /><span class="title">Identities ...</span>:\r
-Opens the identities configuration panel.</li>\r
+<li><a name="apperance" /><span class="title">Appearance ...</span>:\r
+Provides options for customizing the appearance of the credentials\r
+window. Currently, the only options provided are for selecting the\r
+font used for the credentials list.</li>\r
\r
-<li><a name="notifs" /><span class="title">Notifications ...</span>:\r
-Opens the Notifications control panel.</li>\r
+<li><a name="identities" /><span class="title">Identities ...</span>:\r
+Opens the identities configuration panel. These options control\r
+credentials defaults for all identities or for specific identities.</li>\r
+\r
+<li><a name="notifications" /><span class="title">Notifications\r
+...</span>: The notifications configuration panel controls the\r
+settings used by the NetIDMgr timer that triggers warnings and\r
+identity renewals.</li>\r
\r
<li><a name="plugins" /><span class="title">Plugins ...</span>:\r
-Opens the Plug-ins and Modules control panel.</li>\r
+Options for enabling or disabling specific plugins and also for\r
+viewing information about loaded plugins.</li>\r
+\r
+<li><a name="pluginspec" /><span class="title">Plugin specific\r
+configuration panels</span>: Each registered plugin can register one\r
+or more configuration panels which will appear on the <span\r
+class="pre">Options</span> menu.</li>\r
\r
</ul>\r
\r
</p>\r
\r
<map id="menumap">\r
-<area shape = "rect" coords = "4,23,146,40" href = "#choosecol">\r
-<area shape = "rect" coords = "11,40,152,56" href = "#layout">\r
-<area shape = "rect" coords = "10,56,150,74" href = "#toolbars">\r
-<area shape = "rect" coords = "15,80,142,103" href = "#debugwnd">\r
-<area shape = "rect" coords = "8,104,151,128" href = "#refresh">\r
+<area shape = "rect" coords = "11,24,159,45" href = "#choosecol">\r
+<area shape = "rect" coords = "11,47,160,70" href = "#layout">\r
+<area shape = "rect" coords = "11,74,159,100" href = "#refresh">\r
</map>\r
\r
<p>\r
\r
<ul>\r
\r
-<li><a name="choosecol" /> <span class="title">Choose Columns\r
-...</span>: <b>Not implemented in this release.</b>\r
-Invokes a dialog where you can choose which columns are\r
-displayed in the view window. If you change the columns, or their\r
-order, a new custom layout will be created for you which you can later\r
-use using the <span class="pre">Layout</span> submenu later.</li>\r
+<li><a name="choosecol" /> <span class="title">View columns</span>:\r
+\r
+Invokes a submenu from which you can choose the columns that are\r
+displayed in the credentials window. If you change the columns, or\r
+their order, a new custom layout will be created for you which you can\r
+later use using the <span class="pre">Layout</span> submenu later. For\r
+more information about managing layouts, see the <a\r
+href="use_layout.htm">Layout</a> topic.</li>\r
\r
<li><a name="layout" /> <span class="title">Layout</span>: Opens a\r
submenu where you can select the layout for the credentials\r
href="concept_cred_pro.htm">credential providers</a> choose the\r
interpretation of the <span class="pre">location</span> property\r
as the concept of location changes from type to type.</li>\r
- </ul>\r
-</li>\r
\r
-<li><a name="toolbars" />\r
-<span class="title">Toolbars</span>: Enable or disable toolbars.</li>\r
+ <li><span class="title">Custom</span>: If you customize any of\r
+ the above layouts by adding, removing, reordering or changing\r
+ the sort or outline columns, then NetIDMgr will store your new\r
+ layout settings under this layout. Invoking this menu item\r
+ restores your customizations.</ul>\r
\r
-<li><a name="debugwnd" /> <span class="title">Debug window...</span>:\r
-Displays a debug window which contains a history of actions and any\r
-debug information for each action that was supplied by each <a\r
-href="concept_cred_pro.htm">credentials provider</a><li>\r
+</li>\r
\r
<li><a name="refresh" /> <span class="title">Refresh</span>: Refresh\r
the credentials view. This queries each <a\r
\r
<p>When NetIDMgr is running, it places an icon in the system\r
notification area (sometimes referred to as the "system tray") as\r
-shown in figure 1.</p>\r
+shown in figure 1. Details about the state information represented by\r
+the icon can be found <a href="html/use_icon.htm">here</a>.</p>\r
\r
<p>Clicking on this icon brings up the NetIDMgr window. Right\r
clicking on the icon, on the other hand, brings up a menu.</p>\r
Only one instance of NetIDMgr can be running at any one time.\r
Attempting to start NetIDMgr while it is still running will not do\r
anything, unless you provide any command line options that trigger\r
-some action in the running application instance.\r
+some action in the running application instance. If more than one\r
+version of NetIDMgr is installed on the system, and the older version\r
+is running at the time the newer version is started, the older version\r
+will exit allowing the newer version to take over.\r
</p>\r
\r
</body>\r
in the system notification area or it might need to be started\r
manually. See the topic <a href="html/use_start.htm">starting\r
NetIDMgr</a> for details. Essentially, to open the NetIDMgr window,\r
-you either have to click the application icon in the system\r
-notification area, select the icon from the start menu, or type\r
-'netidmgr' at a command prompt.\r
+you either have to click the <a href="html/use_icon.htm">application\r
+icon</a> in the system notification area, select the icon from the\r
+start menu, or type 'netidmgr' at a command prompt.\r
</p>\r
\r
<p>\r
<li><a href="act_import_creds.htm">Import credentials from the MSLSA cache</a></li>\r
<li><a href="act_renew_creds.htm">Renew credentials</a></li>\r
<li><a href="act_chpw.htm">Change password</a></li>\r
+ <li><a href="use_layout.htm">Managing the credentials view layout</a></li>\r
</ul>\r
\r
<p>\r
<param name="Name" value="Starting">\r
<param name="Local" value="html\use_start.htm">\r
</OBJECT>\r
+ <LI> <OBJECT type="text/sitemap">\r
+ <param name="Name" value="Notification icon">\r
+ <param name="Local" value="html\use_icon.htm">\r
+ </OBJECT>\r
+\r
+ <LI> <OBJECT type="text/sitemap">\r
+ <param name="Name" value="Managing the credentials view layout">\r
+ <param name="Local" value="html\use_layout.htm">\r
+ </OBJECT>\r
</UL>\r
<LI> <OBJECT type="text/sitemap">\r
- <param name="Name" value="Menus">\r
+ <param name="Name" value="Menus and Toolbars">\r
<param name="Local" value="html\menu_all.htm">\r
</OBJECT>\r
<UL>\r
--- /dev/null
+#
+# Copyright (c) 2004 Massachusetts Institute of Technology
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+MODULE=nidmgrdll.w2k
+!include <../config/Makefile.w2k>
+
+!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )
+DLLFILE=$(BINDIR)\nidmgr64.dll
+LIBFILE=$(LIBDIR)\nidmgr64.lib
+!else
+DLLFILE=$(BINDIR)\nidmgr32.dll
+LIBFILE=$(LIBDIR)\nidmgr32.lib
+!endif
+
+UTILDIR=$(OBJDIR)\util
+
+KHERRDIR=$(OBJDIR)\kherr
+
+KCONFIGDIR=$(OBJDIR)\kconfig
+
+KMQDIR=$(OBJDIR)\kmq
+
+KCDBDIR=$(OBJDIR)\kcreddb
+
+KMMDIR=$(OBJDIR)\kmm
+
+UIDIR=$(OBJDIR)\uilib.w2k
+
+OBJFILES= \
+ $(OBJ)\dllmain.obj \
+ $(UTILDIR)\hashtable.obj \
+ $(UTILDIR)\sync.obj \
+ $(UTILDIR)\mstring.obj \
+ $(UTILDIR)\perfstat.obj \
+ $(KHERRDIR)\kherrmain.obj \
+ $(KHERRDIR)\kherr.obj \
+ $(KCONFIGDIR)\kconfigmain.obj \
+ $(KCONFIGDIR)\api.obj \
+ $(KMQDIR)\kmqmain.obj \
+ $(KMQDIR)\init.obj \
+ $(KMQDIR)\msgtype.obj \
+ $(KMQDIR)\consumer.obj \
+ $(KMQDIR)\publisher.obj \
+ $(KMQDIR)\kmqconfig.obj \
+ $(KCDBDIR)\buf.obj \
+ $(KCDBDIR)\attrib.obj \
+ $(KCDBDIR)\credential.obj \
+ $(KCDBDIR)\credset.obj \
+ $(KCDBDIR)\credtype.obj \
+ $(KCDBDIR)\identity.obj \
+ $(KCDBDIR)\init.obj \
+ $(KCDBDIR)\kcreddbmain.obj \
+ $(KCDBDIR)\type.obj \
+ $(KCDBDIR)\kcdbconfig.obj \
+ $(KMMDIR)\kmmmain.obj \
+ $(KMMDIR)\kmm.obj \
+ $(KMMDIR)\kmm_plugin.obj \
+ $(KMMDIR)\kmm_module.obj \
+ $(KMMDIR)\kmm_reg.obj \
+ $(KMMDIR)\kmm_registrar.obj \
+ $(KMMDIR)\kmmconfig.obj \
+ $(UIDIR)\rescache.obj \
+ $(UIDIR)\action.obj \
+ $(UIDIR)\creddlg.obj \
+ $(UIDIR)\alert.obj \
+ $(UIDIR)\propsheet.obj \
+ $(UIDIR)\propwnd.obj \
+ $(UIDIR)\uilibmain.obj \
+ $(UIDIR)\actiondef.obj \
+ $(UIDIR)\acceldef.obj \
+ $(UIDIR)\configui.obj \
+ $(UIDIR)\trackerwnd.obj \
+ $(UIDIR)\version.obj
+
+RESFILES= \
+ $(OBJ)\nidmgrdll.res \
+ $(KCDBDIR)\kcredres.res \
+ $(KMMDIR)\kmm_msgs.res \
+
+SDKLIBFILES= \
+ advapi32.lib \
+ strsafe.lib \
+ comctl32.lib \
+ shlwapi.lib \
+ version.lib
+
+!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )
+SCLIB=bufferoverflowu.lib
+!else
+SCLIB=
+!endif
+
+$(DLLFILE): $(OBJFILES) $(RESFILES)
+ $(DLLGUILINK) $(LIBFILES) $(SDKLIBFILES) $(SCLIB)
+
+all: mkdirs $(DLLFILE)
+
+clean::
+ $(RM) $(DLLFILE)
#include<krb5.h>\r
#include<assert.h>\r
\r
+/* method identifiers should be contiguous */\r
#define K4_METHOD_AUTO 0\r
#define K4_METHOD_PASSWORD 1\r
#define K4_METHOD_K524 2\r
} k4_dlg_data;\r
\r
void k4_update_display(k4_dlg_data * d) {\r
+ int i;\r
\r
CheckDlgButton(d->hwnd, IDC_NCK4_OBTAIN,\r
(d->k4_enabled)?BST_CHECKED: BST_UNCHECKED);\r
\r
CheckDlgButton(d->hwnd, method_to_id[d->method], BST_CHECKED);\r
\r
+ for (i=0; i < ARRAYLENGTH(method_to_id); i++) {\r
+ if (i != d->method && method_to_id[i] != 0)\r
+ CheckDlgButton(d->hwnd, method_to_id[d->method],\r
+ BST_UNCHECKED);\r
+ }\r
+\r
khui_cw_enable_type(d->nc, credtype_id_krb4, d->k4_enabled);\r
}\r
\r
_cstr(ident), _int32(method));\r
_resolve();\r
_describe();\r
- \r
\r
} else if (nc->subtype == KMSG_CRED_RENEW_CREDS) {\r
\r
ident = nc->ctx.identity;\r
\r
if (!k4_should_identity_get_k4(ident)) {\r
+\r
+ _reportf(L"Kerberos 4 is not enabled for this identity. Skipping");\r
+\r
khui_cw_set_response(nc, credtype_id_krb4,\r
KHUI_NC_RESPONSE_FAILED |\r
KHUI_NC_RESPONSE_EXIT);\r
}\r
\r
} else {\r
+\r
+ _reportf(L"Kerberos 4 is not within renewal scope. Skipping");\r
+\r
khui_cw_set_response(nc, credtype_id_krb4,\r
KHUI_NC_RESPONSE_FAILED |\r
KHUI_NC_RESPONSE_EXIT);\r
_describe();\r
} else {\r
assert(FALSE);\r
+ break;\r
}\r
\r
if ((method == K4_METHOD_AUTO ||\r
+++ /dev/null
-/*\r
- * Copyright (c) 2005 Massachusetts Institute of Technology\r
- *\r
- * Permission is hereby granted, free of charge, to any person\r
- * obtaining a copy of this software and associated documentation\r
- * files (the "Software"), to deal in the Software without\r
- * restriction, including without limitation the rights to use, copy,\r
- * modify, merge, publish, distribute, sublicense, and/or sell copies\r
- * of the Software, and to permit persons to whom the Software is\r
- * furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be\r
- * included in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
- * SOFTWARE.\r
- */\r
-\r
-/* $Id$ */\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <sys/types.h>\r
-#include <winsock.h>\r
-#include "leashdll.h"\r
-#include <KerberosIV/krb.h>\r
-#include <prot.h>\r
-#include <time.h>\r
-\r
-#include <leashwin.h>\r
-#include "leasherr.h"\r
-#include "leash-int.h"\r
-#include "leashids.h"\r
-\r
-#include <mitwhich.h>\r
-\r
-#include <winkrbid.h>\r
-#include "reminder.h"\r
-\r
-static char FAR *err_context;\r
-\r
-char KRB_HelpFile[_MAX_PATH] = HELPFILE;\r
-\r
-#define LEN 64 /* Maximum Hostname Length */\r
-\r
-#define LIFE DEFAULT_TKT_LIFE /* lifetime of ticket in 5-minute units */\r
-\r
-char *\r
-short_date(dp)\r
- long *dp;\r
-{\r
- register char *cp;\r
- cp = ctime(dp) + 4; // skip day of week\r
- // cp[15] = '\0';\r
- cp[12] = '\0'; // Don't display seconds\r
- return (cp);\r
-}\r
-\r
-\r
-static\r
-char*\r
-clean_string(\r
- char* s\r
- )\r
-{\r
- char* p = s;\r
- char* b = s;\r
-\r
- if (!s) return s;\r
-\r
- for (p = s; *p; p++) {\r
- switch (*p) {\r
- case '\007':\r
- /* Add more cases here */\r
- break;\r
- default:\r
- *b = *p;\r
- b++;\r
- }\r
- }\r
- *b = *p;\r
- return s;\r
-}\r
-\r
-static\r
-int\r
-leash_error_message(\r
- const char *error,\r
- int rcL,\r
- int rc4,\r
- int rc5,\r
- int rcA,\r
- char* result_string,\r
- int displayMB\r
- )\r
-{\r
- char message[2048];\r
- char *p = message;\r
- int size = sizeof(message);\r
- int n;\r
-\r
- // XXX: ignore AFS for now.\r
-\r
- if (!rc5 && !rc4 && !rcL)\r
- return 0;\r
-\r
- n = _snprintf(p, size, "%s\n\n", error);\r
- p += n;\r
- size -= n;\r
-\r
- if (rc5 && !result_string)\r
- {\r
- n = _snprintf(p, size,\r
- "Kerberos 5: %s (error %ld)\n",\r
- perror_message(rc5),\r
- rc5 & 255 // XXX: & 255??!!!\r
- );\r
- p += n;\r
- size -= n;\r
- }\r
- if (rc4 && !result_string)\r
- {\r
- char buffer[1024];\r
- n = _snprintf(p, size,\r
- "Kerberos 4: %s\n",\r
- err_describe(buffer, rc4)\r
- );\r
- p += n;\r
- size -= n;\r
- }\r
- if (rcL)\r
- {\r
- char buffer[1024];\r
- n = _snprintf(p, size,\r
- "\n%s\n",\r
- err_describe(buffer, rcL)\r
- );\r
- p += n;\r
- size -= n;\r
- }\r
- if (result_string)\r
- {\r
- n = _snprintf(p, size,\r
- "%s\n",\r
- result_string);\r
- p += n;\r
- size -= n;\r
- }\r
- if ( displayMB )\r
- MessageBox(NULL, message, "Leash", MB_OK | MB_ICONERROR | MB_TASKMODAL | \r
- MB_SETFOREGROUND);\r
-\r
- if (rc5) return rc5;\r
- if (rc4) return rc4;\r
- if (rcL) return rcL;\r
- return 0;\r
-}\r
-\r
-\r
-static\r
-char *\r
-make_postfix(\r
- const char * base,\r
- const char * postfix,\r
- char ** rcopy\r
- )\r
-{\r
- int base_size;\r
- int ret_size;\r
- char * copy = 0;\r
- char * ret = 0;\r
-\r
- base_size = strlen(base) + 1;\r
- ret_size = base_size + strlen(postfix) + 1;\r
- copy = PMALLOC(base_size);\r
- ret = PMALLOC(ret_size);\r
-\r
- if (!copy || !ret)\r
- goto cleanup;\r
-\r
- strncpy(copy, base, base_size);\r
- copy[base_size - 1] = 0;\r
-\r
- strncpy(ret, base, base_size);\r
- strncpy(ret + (base_size - 1), postfix, ret_size - (base_size - 1));\r
- ret[ret_size - 1] = 0;\r
-\r
- cleanup:\r
- if (!copy || !ret) {\r
- if (copy)\r
- PFREE(copy);\r
- if (ret)\r
- PFREE(ret);\r
- copy = ret = 0;\r
- }\r
- // INVARIANT: (ret ==> copy) && (copy ==> ret)\r
- *rcopy = copy;\r
- return ret;\r
-}\r
-\r
-static\r
-long\r
-make_temp_cache_v4(\r
- const char * postfix\r
- )\r
-{\r
- static char * old_cache = 0;\r
-\r
- if (!pkrb_set_tkt_string || !ptkt_string || !pdest_tkt)\r
- return 0; // XXX - is this appropriate?\r
-\r
- if (old_cache) {\r
- pdest_tkt();\r
- pkrb_set_tkt_string(old_cache);\r
- PFREE(old_cache);\r
- old_cache = 0;\r
- }\r
-\r
- if (postfix)\r
- {\r
- char * tmp_cache = make_postfix(ptkt_string(), postfix, &old_cache);\r
-\r
- if (!tmp_cache)\r
- return KFAILURE;\r
-\r
- pkrb_set_tkt_string(tmp_cache);\r
- PFREE(tmp_cache);\r
- }\r
- return 0;\r
-}\r
-\r
-static\r
-long\r
-make_temp_cache_v5(\r
- const char * postfix,\r
- krb5_context * pctx\r
- )\r
-{\r
- static krb5_context ctx = 0;\r
- static char * old_cache = 0;\r
-\r
- // INVARIANT: old_cache ==> ctx && ctx ==> old_cache\r
-\r
- if (pctx)\r
- *pctx = 0;\r
-\r
- if (!pkrb5_init_context || !pkrb5_free_context || !pkrb5_cc_resolve ||\r
- !pkrb5_cc_default_name || !pkrb5_cc_set_default_name)\r
- return 0;\r
-\r
- if (old_cache) {\r
- krb5_ccache cc = 0;\r
- if (!pkrb5_cc_resolve(ctx, pkrb5_cc_default_name(ctx), &cc))\r
- pkrb5_cc_destroy(ctx, cc);\r
- pkrb5_cc_set_default_name(ctx, old_cache);\r
- PFREE(old_cache);\r
- old_cache = 0;\r
- }\r
- if (ctx) {\r
- pkrb5_free_context(ctx);\r
- ctx = 0;\r
- }\r
-\r
- if (postfix)\r
- {\r
- char * tmp_cache = 0;\r
- krb5_error_code rc = 0;\r
-\r
- rc = pkrb5_init_context(&ctx);\r
- if (rc) goto cleanup;\r
-\r
- tmp_cache = make_postfix(pkrb5_cc_default_name(ctx), postfix, \r
- &old_cache);\r
-\r
- if (!tmp_cache) {\r
- rc = ENOMEM;\r
- goto cleanup;\r
- }\r
-\r
- rc = pkrb5_cc_set_default_name(ctx, tmp_cache);\r
-\r
- cleanup:\r
- if (rc && ctx) {\r
- pkrb5_free_context(ctx);\r
- ctx = 0;\r
- }\r
- if (tmp_cache)\r
- PFREE(tmp_cache);\r
- if (pctx)\r
- *pctx = ctx;\r
- return rc;\r
- }\r
- return 0;\r
-}\r
-\r
-long\r
-Leash_checkpwd(\r
- char *principal, \r
- char *password\r
- )\r
-{\r
- return Leash_int_checkpwd(principal, password, 0);\r
-}\r
-\r
-long \r
-Leash_int_checkpwd(\r
- char * principal,\r
- char * password,\r
- int displayErrors\r
- )\r
-{\r
- long rc = 0;\r
- krb5_context ctx = 0; // statically allocated in make_temp_cache_v5\r
- // XXX - we ignore errors in make_temp_cache_v? This is BAD!!!\r
- make_temp_cache_v4("_checkpwd");\r
- make_temp_cache_v5("_checkpwd", &ctx);\r
- rc = Leash_int_kinit_ex( ctx, 0,\r
- principal, password, 0, 0, 0, 0,\r
- Leash_get_default_noaddresses(),\r
- Leash_get_default_publicip(),\r
- displayErrors\r
- );\r
- make_temp_cache_v4(0);\r
- make_temp_cache_v5(0, &ctx);\r
- return rc;\r
-}\r
-\r
-static\r
-long\r
-Leash_changepwd_v5(char * principal,\r
- char * password,\r
- char * newpassword,\r
- char** error_str)\r
-{\r
- krb5_error_code rc = 0;\r
- int result_code;\r
- krb5_data result_code_string, result_string;\r
- krb5_context context = 0;\r
- krb5_principal princ = 0;\r
- krb5_get_init_creds_opt opts;\r
- krb5_creds creds;\r
- DWORD addressless = 0;\r
-\r
- result_string.data = 0;\r
- result_code_string.data = 0;\r
-\r
- if ( !pkrb5_init_context )\r
- goto cleanup;\r
-\r
- if (rc = pkrb5_init_context(&context)) {\r
-#if 0\r
- com_err(argv[0], ret, "initializing kerberos library");\r
-#endif\r
- goto cleanup;\r
- }\r
-\r
- if (rc = pkrb5_parse_name(context, principal, &princ)) {\r
-#if 0\r
- com_err(argv[0], ret, "parsing client name");\r
-#endif\r
- goto cleanup;\r
- }\r
-\r
- pkrb5_get_init_creds_opt_init(&opts);\r
- pkrb5_get_init_creds_opt_set_tkt_life(&opts, 5*60);\r
- pkrb5_get_init_creds_opt_set_renew_life(&opts, 0);\r
- pkrb5_get_init_creds_opt_set_forwardable(&opts, 0);\r
- pkrb5_get_init_creds_opt_set_proxiable(&opts, 0);\r
-\r
- addressless = Leash_get_default_noaddresses();\r
- if (addressless)\r
- pkrb5_get_init_creds_opt_set_address_list(&opts,NULL);\r
-\r
-\r
- if (rc = pkrb5_get_init_creds_password(context, &creds, princ, password,\r
- 0, 0, 0, "kadmin/changepw", &opts)) {\r
- if (rc == KRB5KRB_AP_ERR_BAD_INTEGRITY) {\r
-#if 0\r
- com_err(argv[0], 0,\r
- "Password incorrect while getting initial ticket");\r
-#endif\r
- }\r
- else {\r
-#if 0\r
- com_err(argv[0], ret, "getting initial ticket");\r
-#endif\r
- }\r
- goto cleanup;\r
- }\r
-\r
- if (rc = pkrb5_change_password(context, &creds, newpassword,\r
- &result_code, &result_code_string,\r
- &result_string)) {\r
-#if 0\r
- com_err(argv[0], ret, "changing password");\r
-#endif\r
- goto cleanup;\r
- }\r
-\r
- if (result_code) {\r
- int len = result_code_string.length + \r
- (result_string.length ? (sizeof(": ") - 1) : 0) +\r
- result_string.length;\r
- if (len && error_str) {\r
- *error_str = PMALLOC(len + 1);\r
- if (*error_str)\r
- _snprintf(*error_str, len + 1,\r
- "%.*s%s%.*s",\r
- result_code_string.length, result_code_string.data,\r
- result_string.length?": ":"",\r
- result_string.length, result_string.data);\r
- }\r
- rc = result_code;\r
- goto cleanup;\r
- }\r
-\r
- cleanup:\r
- if (result_string.data)\r
- pkrb5_free_data_contents(context, &result_string);\r
-\r
- if (result_code_string.data)\r
- pkrb5_free_data_contents(context, &result_code_string);\r
-\r
- if (princ)\r
- pkrb5_free_principal(context, princ);\r
-\r
- if (context)\r
- pkrb5_free_context(context);\r
-\r
- return rc;\r
-}\r
-\r
-static\r
-long\r
-Leash_changepwd_v4(\r
- char * principal,\r
- char * password,\r
- char * newpassword,\r
- char** error_str\r
- )\r
-{\r
- long k_errno;\r
-\r
- if (!pkrb_set_tkt_string || !ptkt_string || !pkadm_change_your_password ||\r
- !pdest_tkt)\r
- return KFAILURE;\r
-\r
- k_errno = make_temp_cache_v4("_chgpwd");\r
- if (k_errno) return k_errno;\r
- k_errno = pkadm_change_your_password(principal, password, newpassword, \r
- error_str);\r
- make_temp_cache_v4(0);\r
- return k_errno;\r
-}\r
-\r
-/*\r
- * Leash_changepwd\r
- *\r
- * Try to change the password using one of krb5 or krb4 -- whichever one\r
- * works. We return ok on the first one that works.\r
- */\r
-long\r
-Leash_changepwd(\r
- char * principal, \r
- char * password, \r
- char * newpassword,\r
- char** result_string\r
- )\r
-{\r
- return Leash_int_changepwd(principal, password, newpassword, result_string, 0);\r
-}\r
-\r
-long\r
-Leash_int_changepwd(\r
- char * principal, \r
- char * password, \r
- char * newpassword,\r
- char** result_string,\r
- int displayErrors\r
- )\r
-{\r
- char* v5_error_str = 0;\r
- char* v4_error_str = 0;\r
- char* error_str = 0;\r
- int rc4 = 0;\r
- int rc5 = 0;\r
- int rc = 0;\r
- if (hKrb5)\r
- rc = rc5 = Leash_changepwd_v5(principal, password, newpassword,\r
- &v5_error_str);\r
- if (hKrb4 && \r
- Leash_get_default_use_krb4() &&\r
- (!hKrb5 || rc5))\r
- rc = rc4 = Leash_changepwd_v4(principal, password, newpassword, \r
- &v4_error_str);\r
- if (!rc)\r
- return 0;\r
- if (v5_error_str || v4_error_str) {\r
- int len = 0;\r
- char v5_prefix[] = "Kerberos 5: ";\r
- char sep[] = "\n";\r
- char v4_prefix[] = "Kerberos 4: ";\r
-\r
- clean_string(v5_error_str);\r
- clean_string(v4_error_str);\r
-\r
- if (v5_error_str)\r
- len += sizeof(sep) + sizeof(v5_prefix) + strlen(v5_error_str) + \r
- sizeof(sep);\r
- if (v4_error_str)\r
- len += sizeof(sep) + sizeof(v4_prefix) + strlen(v4_error_str) + \r
- sizeof(sep);\r
- error_str = PMALLOC(len + 1);\r
- if (error_str) {\r
- char* p = error_str;\r
- int size = len + 1;\r
- int n;\r
- if (v5_error_str) {\r
- n = _snprintf(p, size, "%s%s%s%s",\r
- sep, v5_prefix, v5_error_str, sep);\r
- p += n;\r
- size -= n;\r
- }\r
- if (v4_error_str) {\r
- n = _snprintf(p, size, "%s%s%s%s",\r
- sep, v4_prefix, v4_error_str, sep);\r
- p += n;\r
- size -= n;\r
- }\r
- if (result_string)\r
- *result_string = error_str;\r
- }\r
- }\r
- return leash_error_message("Error while changing password.", \r
- rc4, rc4, rc5, 0, error_str, \r
- displayErrors\r
- );\r
-}\r
-\r
-int (*Lcom_err)(LPSTR,long,LPSTR,...);\r
-LPSTR (*Lerror_message)(long);\r
-LPSTR (*Lerror_table_name)(long);\r
-\r
-\r
-long\r
-Leash_kinit(\r
- char * principal,\r
- char * password,\r
- int lifetime\r
- )\r
-{\r
- return Leash_int_kinit_ex( 0, 0,\r
- principal, \r
- password, \r
- lifetime,\r
- Leash_get_default_forwardable(),\r
- Leash_get_default_proxiable(),\r
- Leash_get_default_renew_till(),\r
- Leash_get_default_noaddresses(),\r
- Leash_get_default_publicip(),\r
- 0\r
- );\r
-}\r
-\r
-long\r
-Leash_kinit_ex(\r
- char * principal, \r
- char * password, \r
- int lifetime,\r
- int forwardable,\r
- int proxiable,\r
- int renew_life,\r
- int addressless,\r
- unsigned long publicip\r
- )\r
-{\r
- return Leash_int_kinit_ex( 0, /* krb5 context */\r
- 0, /* parent window */\r
- principal, \r
- password, \r
- lifetime,\r
- forwardable,\r
- proxiable,\r
- renew_life,\r
- addressless,\r
- publicip,\r
- 0\r
- );\r
-}\r
-\r
-long\r
-Leash_int_kinit_ex(\r
- krb5_context ctx,\r
- HWND hParent,\r
- char * principal, \r
- char * password, \r
- int lifetime,\r
- int forwardable,\r
- int proxiable,\r
- int renew_life,\r
- int addressless,\r
- unsigned long publicip,\r
- int displayErrors\r
- )\r
-{\r
- LPCSTR functionName; \r
- char aname[ANAME_SZ];\r
- char inst[INST_SZ];\r
- char realm[REALM_SZ];\r
- char first_part[256];\r
- char second_part[256];\r
- char temp[1024];\r
- int count;\r
- int i;\r
- int rc4 = 0;\r
- int rc5 = 0;\r
- int rcA = 0;\r
- int rcL = 0;\r
-\r
- if (lifetime < 5)\r
- lifetime = 1;\r
- else\r
- lifetime /= 5;\r
-\r
- if (renew_life > 0 && renew_life < 5)\r
- renew_life = 1;\r
- else\r
- renew_life /= 5;\r
-\r
- /* This should be changed if the maximum ticket lifetime */\r
- /* changes */\r
-\r
- if (lifetime > 255)\r
- lifetime = 255;\r
-\r
- err_context = "parsing principal";\r
-\r
- memset(temp, '\0', sizeof(temp));\r
- memset(inst, '\0', sizeof(inst));\r
- memset(realm, '\0', sizeof(realm));\r
- memset(first_part, '\0', sizeof(first_part));\r
- memset(second_part, '\0', sizeof(second_part));\r
-\r
- sscanf(principal, "%[/0-9a-zA-Z._-]@%[/0-9a-zA-Z._-]", first_part, second_part);\r
- strcpy(temp, first_part);\r
- strcpy(realm, second_part);\r
- memset(first_part, '\0', sizeof(first_part));\r
- memset(second_part, '\0', sizeof(second_part));\r
- if (sscanf(temp, "%[@0-9a-zA-Z._-]/%[@0-9a-zA-Z._-]", first_part, second_part) == 2)\r
- {\r
- strcpy(aname, first_part);\r
- strcpy(inst, second_part);\r
- }\r
- else\r
- {\r
- count = 0;\r
- i = 0;\r
- for (i = 0; temp[i]; i++)\r
- {\r
- if (temp[i] == '.')\r
- ++count;\r
- }\r
- if (count > 1)\r
- {\r
- strcpy(aname, temp);\r
- }\r
- else\r
- {\r
- if (pkname_parse != NULL)\r
- {\r
- memset(first_part, '\0', sizeof(first_part));\r
- memset(second_part, '\0', sizeof(second_part));\r
- sscanf(temp, "%[@/0-9a-zA-Z_-].%[@/0-9a-zA-Z_-]", first_part, second_part);\r
- strcpy(aname, first_part);\r
- strcpy(inst, second_part);\r
- }\r
- else\r
- {\r
- strcpy(aname, temp);\r
- }\r
- }\r
- }\r
-\r
- memset(temp, '\0', sizeof(temp));\r
- strcpy(temp, aname);\r
- if (strlen(inst) != 0)\r
- {\r
- strcat(temp, "/");\r
- strcat(temp, inst);\r
- }\r
- if (strlen(realm) != 0)\r
- {\r
- strcat(temp, "@");\r
- strcat(temp, realm);\r
- }\r
-\r
- rc5 = Leash_krb5_kinit(ctx, hParent, \r
- temp, password, lifetime,\r
- forwardable,\r
- proxiable,\r
- renew_life,\r
- addressless,\r
- publicip\r
- );\r
- if ( Leash_get_default_use_krb4() ) {\r
- if ( !rc5 ) {\r
- if (!Leash_convert524(ctx))\r
- rc4 = KFAILURE;\r
- } else {\r
- if (pkname_parse == NULL)\r
- {\r
- goto cleanup;\r
- }\r
-\r
- err_context = "getting realm";\r
- if (!*realm && (rc4 = (int)(*pkrb_get_lrealm)(realm, 1))) \r
- {\r
- functionName = "krb_get_lrealm()";\r
- rcL = LSH_FAILEDREALM;\r
- goto cleanup;\r
- }\r
-\r
- err_context = "checking principal";\r
- if ((!*aname) || (!(rc4 = (int)(*pk_isname)(aname))))\r
- {\r
- functionName = "krb_get_lrealm()";\r
- rcL = LSH_INVPRINCIPAL;\r
- goto cleanup;\r
- }\r
-\r
- /* optional instance */\r
- if (!(rc4 = (int)(*pk_isinst)(inst)))\r
- {\r
- functionName = "k_isinst()";\r
- rcL = LSH_INVINSTANCE;\r
- goto cleanup;\r
- }\r
-\r
- if (!(rc4 = (int)(*pk_isrealm)(realm)))\r
- {\r
- functionName = "k_isrealm()";\r
- rcL = LSH_INVREALM;\r
- goto cleanup;\r
- }\r
-\r
- err_context = "fetching ticket"; \r
- rc4 = (*pkrb_get_pw_in_tkt)(aname, inst, realm, "krbtgt", realm, \r
- lifetime, password);\r
- if (rc4) /* XXX: do we want: && (rc != NO_TKT_FIL) as well? */\r
- { \r
- functionName = "krb_get_pw_in_tkt()";\r
- rcL = KRBERR(rc4);\r
- goto cleanup;\r
- }\r
- }\r
- }\r
-\r
-#ifndef NO_AFS\r
- if ( !rc5 || (Leash_get_default_use_krb4() && !rc4) ) {\r
- char c;\r
- char *r;\r
- char *t;\r
- for ( r=realm, t=temp; c=*r; r++,t++ )\r
- *t = isupper(c) ? tolower(c) : c;\r
- *t = '\0';\r
-\r
- rcA = Leash_afs_klog("afs", temp, realm, lifetime);\r
- if (rcA)\r
- rcA = Leash_afs_klog("afs", "", realm, lifetime);\r
- }\r
-#endif /* NO_AFS */\r
-\r
- cleanup:\r
- return leash_error_message("Ticket initialization failed.", \r
- rcL, (rc5 && rc4)?KRBERR(rc4):0, rc5, rcA, 0,\r
- displayErrors);\r
-}\r
-\r
-long FAR\r
-Leash_renew(void)\r
-{\r
- if ( hKrb5 && !LeashKRB5_renew() ) {\r
- int lifetime;\r
- lifetime = Leash_get_default_lifetime() / 5;\r
- if (hKrb4 && Leash_get_default_use_krb4())\r
- Leash_convert524(0);\r
-#ifndef NO_AFS\r
- {\r
- TicketList * list = NULL, * token;\r
- afs_get_tokens(NULL,&list,NULL);\r
- for ( token = list ; token ; token = token->next )\r
- Leash_afs_klog("afs", token->realm, "", lifetime);\r
- not_an_API_LeashFreeTicketList(&list);\r
- }\r
-#endif /* NO_AFS */\r
- return 1;\r
- }\r
- return 0;\r
-}\r
-\r
-static BOOL\r
-GetSecurityLogonSessionData(PSECURITY_LOGON_SESSION_DATA * ppSessionData)\r
-{\r
- NTSTATUS Status = 0;\r
- HANDLE TokenHandle;\r
- TOKEN_STATISTICS Stats;\r
- DWORD ReqLen;\r
- BOOL Success;\r
-\r
- if (!ppSessionData || !pLsaGetLogonSessionData)\r
- return FALSE;\r
- *ppSessionData = NULL;\r
-\r
- Success = OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &TokenHandle );\r
- if ( !Success )\r
- return FALSE;\r
-\r
- Success = GetTokenInformation( TokenHandle, TokenStatistics, &Stats, sizeof(TOKEN_STATISTICS), &ReqLen );\r
- CloseHandle( TokenHandle );\r
- if ( !Success )\r
- return FALSE;\r
-\r
- Status = pLsaGetLogonSessionData( &Stats.AuthenticationId, ppSessionData );\r
- if ( FAILED(Status) || !ppSessionData )\r
- return FALSE;\r
-\r
- return TRUE;\r
-}\r
-\r
-// IsKerberosLogon() does not validate whether or not there are valid tickets in the \r
-// cache. It validates whether or not it is reasonable to assume that if we \r
-// attempted to retrieve valid tickets we could do so. Microsoft does not \r
-// automatically renew expired tickets. Therefore, the cache could contain\r
-// expired or invalid tickets. Microsoft also caches the user's password \r
-// and will use it to retrieve new TGTs if the cache is empty and tickets\r
-// are requested.\r
-\r
-static BOOL\r
-IsKerberosLogon(VOID)\r
-{\r
- PSECURITY_LOGON_SESSION_DATA pSessionData = NULL;\r
- BOOL Success = FALSE;\r
-\r
- if ( GetSecurityLogonSessionData(&pSessionData) ) {\r
- if ( pSessionData->AuthenticationPackage.Buffer ) {\r
- WCHAR buffer[256];\r
- WCHAR *usBuffer;\r
- int usLength;\r
-\r
- Success = FALSE;\r
- usBuffer = (pSessionData->AuthenticationPackage).Buffer;\r
- usLength = (pSessionData->AuthenticationPackage).Length;\r
- if (usLength < 256)\r
- {\r
- lstrcpyn (buffer, usBuffer, usLength);\r
- lstrcat (buffer,L"");\r
- if ( !lstrcmp(L"Kerberos",buffer) )\r
- Success = TRUE;\r
- }\r
- }\r
- pLsaFreeReturnBuffer(pSessionData);\r
- }\r
- return Success;\r
-}\r
-\r
-\r
-// This looks really ugly because it is. The result of IsKerberosLogon()\r
-// does not prove whether or not there are Kerberos tickets available to \r
-// be imported. Only the call to khm_krb5_ms2mit() which actually attempts\r
-// to import tickets can do that. However, calling khm_krb5_ms2mit() can\r
-// result in a TGS_REQ being sent to the KDC and since Leash_importable()\r
-// is called quite often we want to avoid this if at all possible.\r
-// Unfortunately, we have be shown at least one case in which the primary\r
-// authentication package was not Kerberos and yet there were Kerberos \r
-// tickets available. Therefore, if IsKerberosLogon() is not TRUE we \r
-// must call khm_krb5_ms2mit() but we still do not want to call it in a \r
-// tight loop so we cache the response and assume it won't change.\r
-long FAR\r
-Leash_importable(void)\r
-{\r
- if ( IsKerberosLogon() )\r
- return TRUE;\r
- else {\r
- static int response = -1;\r
- if (response == -1) {\r
- response = khm_krb5_ms2mit(0);\r
- }\r
- return response;\r
- }\r
-}\r
-\r
-long FAR\r
-Leash_import(void)\r
-{\r
- if ( khm_krb5_ms2mit(1) ) {\r
- int lifetime;\r
- lifetime = Leash_get_default_lifetime() / 5;\r
- if (hKrb4 && Leash_get_default_use_krb4())\r
- Leash_convert524(0);\r
-#ifndef NO_AFS\r
- {\r
- char c;\r
- char *r;\r
- char *t;\r
- char cell[256];\r
- char realm[256];\r
- int i = 0;\r
- int rcA = 0;\r
-\r
- krb5_context ctx = 0;\r
- krb5_error_code code = 0;\r
- krb5_ccache cc = 0;\r
- krb5_principal me = 0;\r
-\r
- if ( !pkrb5_init_context )\r
- goto cleanup;\r
-\r
- code = pkrb5_init_context(&ctx);\r
- if (code) goto cleanup;\r
-\r
- code = pkrb5_cc_default(ctx, &cc);\r
- if (code) goto cleanup;\r
-\r
- if (code = pkrb5_cc_get_principal(ctx, cc, &me))\r
- goto cleanup;\r
-\r
- for ( r=realm, t=cell, i=0; i<krb5_princ_realm(ctx, me)->length; r++,t++,i++ ) {\r
- c = krb5_princ_realm(ctx, me)->data[i];\r
- *r = c;\r
- *t = isupper(c) ? tolower(c) : c;\r
- }\r
- *r = *t = '\0';\r
-\r
- rcA = Leash_afs_klog("afs", cell, realm, lifetime);\r
- if (rcA)\r
- rcA = Leash_afs_klog("afs", "", realm, lifetime);\r
-\r
- cleanup:\r
- if (me) \r
- pkrb5_free_principal(ctx, me);\r
- if (cc)\r
- pkrb5_cc_close(ctx, cc);\r
- if (ctx) \r
- pkrb5_free_context(ctx);\r
- }\r
-#endif /* NO_AFS */\r
- return 1;\r
- }\r
- return 0;\r
-}\r
-\r
-long\r
-Leash_kdestroy(void)\r
-{\r
- int k_errno;\r
-\r
- Leash_afs_unlog();\r
- khm_krb5_destroy_identity(NULL);\r
-\r
- if (pdest_tkt != NULL)\r
- {\r
- k_errno = (*pdest_tkt)();\r
- if (k_errno && (k_errno != RET_TKFIL))\r
- return KRBERR(k_errno);\r
- }\r
-\r
- return 0;\r
-}\r
-\r
-int com_addr(void)\r
-{\r
- long ipAddr;\r
- char loc_addr[ADDR_SZ];\r
- CREDENTIALS cred; \r
- char service[40];\r
- char instance[40];\r
-// char addr[40];\r
- char realm[40];\r
- struct in_addr LocAddr;\r
- int k_errno;\r
-\r
- if (pkrb_get_cred == NULL)\r
- return(KSUCCESS);\r
-\r
- k_errno = (*pkrb_get_cred)(service,instance,realm,&cred);\r
- if (k_errno)\r
- return KRBERR(k_errno);\r
-\r
-\r
- while(1) {\r
- ipAddr = (*pLocalHostAddr)();\r
- LocAddr.s_addr = ipAddr;\r
- strcpy(loc_addr,inet_ntoa(LocAddr));\r
- if ( strcmp(cred.address,loc_addr) != 0) {\r
- Leash_kdestroy ();\r
- break;\r
- }\r
- break;\r
- } // while()\r
- return 0;\r
-} \r
-\r
-long FAR\r
-not_an_API_LeashFreeTicketList(TicketList** ticketList) \r
-{\r
- TicketList* tempList = *ticketList, *killList; \r
-\r
- //if (tempList == NULL)\r
- //return -1;\r
-\r
- while (tempList)\r
- {\r
- killList = tempList;\r
- \r
- tempList = (TicketList*)tempList->next;\r
- PFREE(killList->theTicket);\r
- if (killList->tktEncType)\r
- PFREE(killList->tktEncType);\r
- if (killList->keyEncType)\r
- PFREE(killList->keyEncType);\r
- if (killList->addrCount) {\r
- int n;\r
- for ( n=0; n<killList->addrCount; n++) {\r
- if (killList->addrList[n])\r
- PFREE(killList->addrList[n]);\r
- }\r
- }\r
- if (killList->addrList)\r
- PFREE(killList->addrList);\r
- if (killList->name)\r
- PFREE(killList->name);\r
- if (killList->inst)\r
- PFREE(killList->inst);\r
- if (killList->realm)\r
- PFREE(killList->realm);\r
- PFREE(killList);\r
- }\r
-\r
- *ticketList = NULL;\r
- return 0;\r
-}\r
-\r
-\r
-long FAR Leash_klist(HWND hlist, TICKETINFO FAR *ticketinfo)\r
-{\r
- // Don't think this function will be used anymore - ADL 5-15-99 \r
- // Old fucntion to put tickets in a listbox control \r
- // Use function "not_an_API_LeashKRB4GetTickets()" instead! \r
- char pname[ANAME_SZ];\r
- char pinst[INST_SZ];\r
- char prealm[REALM_SZ];\r
- char buf[MAX_K_NAME_SZ+40];\r
- LPSTR cp;\r
- long expdate;\r
- int k_errno;\r
- CREDENTIALS c;\r
- int newtickets = 0;\r
- int open = 0;\r
-\r
- /*\r
- * Since krb_get_tf_realm will return a ticket_file error,\r
- * we will call tf_init and tf_close first to filter out\r
- * things like no ticket file. Otherwise, the error that\r
- * the user would see would be \r
- * klist: can't find realm of ticket file: No ticket file (tf_util)\r
- * instead of\r
- * klist: No ticket file (tf_util)\r
- */\r
- if (ptf_init == NULL)\r
- return(KSUCCESS);\r
-\r
- if (hlist) \r
- { \r
- SendMessage(hlist, WM_SETREDRAW, FALSE, 0L);\r
- SendMessage(hlist, LB_RESETCONTENT, 0, 0L);\r
- } \r
- com_addr(); \r
- newtickets = NO_TICKETS;\r
-\r
- err_context = (LPSTR)"tktf1";\r
-\r
- /* Open ticket file */\r
- if (k_errno = (*ptf_init)((*ptkt_string)(), R_TKT_FIL))\r
- {\r
- goto cleanup;\r
- }\r
- /* Close ticket file */\r
- (void) (*ptf_close)();\r
- /*\r
- * We must find the realm of the ticket file here before calling\r
- * tf_init because since the realm of the ticket file is not\r
- * really stored in the principal section of the file, the\r
- * routine we use must itself call tf_init and tf_close.\r
- */\r
- err_context = "tf realm";\r
- if ((k_errno = (*pkrb_get_tf_realm)((*ptkt_string)(), prealm)) != KSUCCESS)\r
- {\r
- goto cleanup;\r
- }\r
- /* Open ticket file */\r
- err_context = "tf init";\r
- if (k_errno = (*ptf_init)((*ptkt_string)(), R_TKT_FIL)) \r
- {\r
- goto cleanup; \r
- }\r
-\r
- open = 1;\r
- err_context = "tf pname";\r
- /* Get principal name and instance */\r
- if ((k_errno = (*ptf_get_pname)(pname)) || (k_errno = (*ptf_get_pinst)(pinst))) \r
- {\r
- goto cleanup; \r
- }\r
-\r
- /*\r
- * You may think that this is the obvious place to get the\r
- * realm of the ticket file, but it can't be done here as the\r
- * routine to do this must open the ticket file. This is why\r
- * it was done before tf_init.\r
- */\r
-\r
- wsprintf((LPSTR)ticketinfo->principal,"%s%s%s%s%s", (LPSTR)pname,\r
- (LPSTR)(pinst[0] ? "." : ""), (LPSTR)pinst,\r
- (LPSTR)(prealm[0] ? "@" : ""), (LPSTR)prealm);\r
- newtickets = GOOD_TICKETS;\r
-\r
- err_context = "tf cred";\r
- while ((k_errno = (*ptf_get_cred)(&c)) == KSUCCESS) \r
- {\r
- expdate = c.issue_date + c.lifetime * 5L * 60L;\r
-\r
- if (!lstrcmp((LPSTR)c.service, (LPSTR)TICKET_GRANTING_TICKET) && !lstrcmp((LPSTR)c.instance, (LPSTR)prealm)) \r
- {\r
- ticketinfo->issue_date = c.issue_date;\r
- ticketinfo->lifetime = c.lifetime * 5L * 60L;\r
- ticketinfo->renew_till = 0;\r
- }\r
-\r
- cp = (LPSTR)buf;\r
- lstrcpy(cp, (LPSTR)short_date(&c.issue_date));\r
- cp += lstrlen(cp);\r
- wsprintf(cp,"\t%s\t%s%s%s%s%s",\r
- (LPSTR)short_date(&expdate), (LPSTR)c.service,\r
- (LPSTR)(c.instance[0] ? "." : ""),\r
- (LPSTR)c.instance, (LPSTR)(c.realm[0] ? "@" : ""),\r
- (LPSTR) c.realm);\r
- if (hlist)\r
- SendMessage(hlist, LB_ADDSTRING, 0, (LONG)(LPSTR)buf);\r
- } /* WHILE */\r
-\r
-cleanup:\r
-\r
- if (open)\r
- (*ptf_close)(); /* close ticket file */\r
-\r
- if (hlist) \r
- {\r
- SendMessage(hlist, WM_SETREDRAW, TRUE, 0L);\r
- InvalidateRect(hlist, NULL, TRUE);\r
- UpdateWindow(hlist);\r
- }\r
- if (k_errno == EOF)\r
- k_errno = 0;\r
-\r
- /* XXX the if statement directly below was inserted to eliminate\r
- an error 20 on Leash startup. The error occurs from an error\r
- number thrown from krb_get_tf_realm. We believe this change\r
- does not eliminate other errors, but it may. */\r
-\r
- if (k_errno == RET_NOTKT)\r
- k_errno = 0;\r
-\r
- ticketinfo->btickets = newtickets;\r
- if (k_errno != 0)\r
- return KRBERR(k_errno);\r
- return 0;\r
-}\r
-\r
-\r
-\r
-static BOOL CALLBACK \r
-EnumChildProc(HWND hwnd, LPARAM lParam)\r
-{\r
- HWND * h = (HWND *)lParam;\r
- *h = hwnd;\r
- return FALSE;\r
-}\r
-\r
-\r
-static HWND\r
-FindFirstChildWindow(HWND parent)\r
-{\r
- HWND hFirstChild = 0;\r
- EnumChildWindows(parent, EnumChildProc, (LPARAM) &hFirstChild);\r
- return hFirstChild;\r
-}\r
-\r
-void FAR\r
-not_an_API_Leash_AcquireInitialTicketsIfNeeded(krb5_context context, krb5_principal desiredKrb5Principal) \r
-{\r
- krb5_error_code err;\r
- LSH_DLGINFO_EX dlginfo;\r
- HGLOBAL hData;\r
- HWND hLeash;\r
- HWND hForeground;\r
- char *desiredName = 0;\r
- char *desiredRealm = 0;\r
- char *p;\r
- TicketList * list = NULL;\r
- TICKETINFO ticketinfo;\r
- krb5_context ctx;\r
- char newenv[256];\r
- char * env = 0;\r
- DWORD dwMsLsaImport = Leash_get_default_mslsa_import();\r
-\r
- char loginenv[16];\r
- BOOL prompt;\r
-\r
- GetEnvironmentVariable("KERBEROSLOGIN_NEVER_PROMPT", loginenv, sizeof(loginenv));\r
- prompt = (GetLastError() == ERROR_ENVVAR_NOT_FOUND);\r
-\r
- if ( !prompt || !pkrb5_init_context )\r
- return;\r
-\r
- ctx = context;\r
- env = getenv("KRB5CCNAME");\r
- if ( !env && context ) {\r
- sprintf(newenv,"KRB5CCNAME=%s",pkrb5_cc_default_name(ctx));\r
- env = (char *)putenv(newenv);\r
- }\r
-\r
- not_an_API_LeashKRB5GetTickets(&ticketinfo,&list,&ctx);\r
- not_an_API_LeashFreeTicketList(&list);\r
-\r
- if ( ticketinfo.btickets != GOOD_TICKETS && \r
- Leash_get_default_mslsa_import() && Leash_importable() ) {\r
- // We have the option of importing tickets from the MSLSA\r
- // but should we? Do the tickets in the MSLSA cache belong \r
- // to the default realm used by Leash? If so, import. \r
- int import = 0;\r
-\r
- if ( dwMsLsaImport == 1 ) { /* always import */\r
- import = 1;\r
- } else if ( dwMsLsaImport == 2 ) { /* import when realms match */\r
- krb5_error_code code;\r
- krb5_ccache mslsa_ccache=0;\r
- krb5_principal princ = 0;\r
- char ms_realm[128] = "", *def_realm = 0, *r;\r
- int i;\r
-\r
- if (code = pkrb5_cc_resolve(ctx, "MSLSA:", &mslsa_ccache))\r
- goto cleanup;\r
-\r
- if (code = pkrb5_cc_get_principal(ctx, mslsa_ccache, &princ))\r
- goto cleanup;\r
-\r
- for ( r=ms_realm, i=0; i<krb5_princ_realm(ctx, princ)->length; r++, i++ ) {\r
- *r = krb5_princ_realm(ctx, princ)->data[i];\r
- }\r
- *r = '\0';\r
-\r
- if (code = pkrb5_get_default_realm(ctx, &def_realm))\r
- goto cleanup;\r
-\r
- import = !strcmp(def_realm, ms_realm);\r
-\r
- cleanup:\r
- if (def_realm)\r
- pkrb5_free_default_realm(ctx, def_realm);\r
-\r
- if (princ)\r
- pkrb5_free_principal(ctx, princ);\r
-\r
- if (mslsa_ccache)\r
- pkrb5_cc_close(ctx, mslsa_ccache);\r
- }\r
-\r
- if ( import ) {\r
- Leash_import();\r
-\r
- not_an_API_LeashKRB5GetTickets(&ticketinfo,&list,&ctx);\r
- not_an_API_LeashFreeTicketList(&list);\r
- }\r
- }\r
-\r
- if ( ticketinfo.btickets != GOOD_TICKETS ) \r
- {\r
- /* do we want a specific client principal? */\r
- if (desiredKrb5Principal != NULL) {\r
- err = pkrb5_unparse_name (ctx, desiredKrb5Principal, &desiredName);\r
- if (!err) {\r
- dlginfo.username = desiredName;\r
- for (p = desiredName; *p && *p != '@'; p++);\r
- if ( *p == '@' ) {\r
- *p = '\0';\r
- desiredRealm = dlginfo.realm = ++p;\r
- }\r
- }\r
- }\r
- \r
-#ifdef COMMENT\r
- memset(&dlginfo, 0, sizeof(LSH_DLGINFO_EX));\r
- dlginfo.size = sizeof(LSH_DLGINFO_EX);\r
- dlginfo.dlgtype = DLGTYPE_PASSWD;\r
- dlginfo.title = "Obtain Kerberos Ticket Getting Tickets";\r
- dlginfo.use_defaults = 1;\r
-\r
- err = Leash_kinit_dlg_ex(NULL, &dlginfo);\r
-#else\r
- /* construct a marshalling of data\r
- * <title><principal><realm>\r
- * then send to Leash\r
- */\r
-\r
- hData = GlobalAlloc( GHND, 4096 );\r
- hForeground = GetForegroundWindow();\r
- hLeash = FindWindow("LEASH.0WNDCLASS", NULL);\r
- SetForegroundWindow(hLeash);\r
- hLeash = FindFirstChildWindow(hLeash);\r
- if ( hData && hLeash ) {\r
- char * strs = GlobalLock( hData );\r
- if ( strs ) {\r
- strcpy(strs, "Obtain Kerberos Ticket Getting Tickets");\r
- strs += strlen(strs) + 1;\r
- if ( desiredName ) {\r
- strcpy(strs, desiredName);\r
- strs += strlen(strs) + 1;\r
- if (desiredRealm) {\r
- strcpy(strs, desiredRealm);\r
- strs += strlen(strs) + 1;\r
- }\r
- } else {\r
- *strs = 0;\r
- strs++;\r
- *strs = 0;\r
- strs++;\r
- }\r
-\r
- GlobalUnlock( hData );\r
- SendMessage(hLeash, 32809, 0, (LPARAM) hData);\r
- }\r
-\r
- GlobalFree( hData );\r
- }\r
- SetForegroundWindow(hForeground);\r
-#endif\r
- if (desiredName != NULL)\r
- pkrb5_free_unparsed_name(ctx, desiredName);\r
- }\r
-\r
- if ( !env && context )\r
- putenv("KRB5CCNAME=");\r
-\r
- if ( !context )\r
- pkrb5_free_context(ctx);\r
-}\r
$(OBJ)\cfg_general_wnd.obj \
$(OBJ)\cfg_identities_wnd.obj \
$(OBJ)\cfg_notif_wnd.obj \
- $(OBJ)\cfg_plugins_wnd.obj
+ $(OBJ)\cfg_plugins_wnd.obj \
+ $(OBJ)\cfg_appear_wnd.obj
RESFILES= \
$(OBJ)\khapp.res \
--- /dev/null
+#
+# Copyright (c) 2004 Massachusetts Institute of Technology
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+MODULE=ui
+!include <../config/Makefile.w2k>
+
+EXEFILE=$(BINDIR)\netidmgr.exe
+
+OBJFILES= \
+ $(OBJ)\main.obj \
+ $(OBJ)\mainmenu.obj \
+ $(OBJ)\toolbar.obj \
+ $(OBJ)\statusbar.obj \
+ $(OBJ)\notifier.obj \
+ $(OBJ)\timer.obj \
+ $(OBJ)\uiconfig.obj \
+ $(OBJ)\mainwnd.obj \
+ $(OBJ)\credwnd.obj \
+ $(OBJ)\htwnd.obj \
+ $(OBJ)\passwnd.obj \
+ $(OBJ)\newcredwnd.obj \
+ $(OBJ)\propertywnd.obj \
+ $(OBJ)\credfuncs.obj \
+ $(OBJ)\configwnd.obj \
+ $(OBJ)\aboutwnd.obj \
+ $(OBJ)\reqdaemon.obj \
+ $(OBJ)\addrchange.obj \
+ $(OBJ)\debugfuncs.obj \
+ $(OBJ)\cfg_general_wnd.obj \
+ $(OBJ)\cfg_identities_wnd.obj \
+ $(OBJ)\cfg_notif_wnd.obj \
+ $(OBJ)\cfg_plugins_wnd.obj \
+ $(OBJ)\cfg_appear_wnd.obj
+
+RESFILES= \
+ $(OBJ)\khapp.res \
+ $(OBJ)\appver.res
+
+!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )
+LIBFILES=$(LIBDIR)\nidmgr64.lib
+!else
+LIBFILES=$(LIBDIR)\nidmgr32.lib
+!endif
+
+SDKLIBFILES= \
+ comctl32.lib \
+ shell32.lib \
+ htmlhelp.lib \
+ iphlpapi.lib \
+ shlwapi.lib
+
+$(OBJ)\uiconfig.c: uiconfig.csv $(CONFDIR)\csvschema.cfg
+ $(CCSV) $** $@
+
+$(OBJ)\khapp.res: lang\en_us\khapp.rc
+ $(RC2RES)
+
+$(OBJ)\appver.res: appver.rc
+ $(RC2RES)
+
+!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )
+SCLIB=bufferoverflowu.lib
+!else
+SCLIB=
+!endif
+
+$(EXEFILE): $(OBJFILES) $(RESFILES) $(LIBFILES)
+ $(EXEGUILINK) $(SDKLIBFILES) $(SCLIB)
+
+all: mkdirs $(EXEFILE)
--- /dev/null
+/*\r
+ * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person\r
+ * obtaining a copy of this software and associated documentation\r
+ * files (the "Software"), to deal in the Software without\r
+ * restriction, including without limitation the rights to use, copy,\r
+ * modify, merge, publish, distribute, sublicense, and/or sell copies\r
+ * of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be\r
+ * included in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ */\r
+\r
+/* $Id$ */\r
+\r
+#include<khmapp.h>\r
+#include<assert.h>\r
+\r
+static int text_sizes[] = {\r
+ 4,6,8,9,10,12,14,16,18\r
+};\r
+\r
+typedef struct tag_dlg_data {\r
+ khui_config_node node;\r
+ HWND hwnd;\r
+ LOGFONT lf_base;\r
+ LOGFONT lf_work;\r
+ HFONT c_font_normal;\r
+ HFONT c_font_bold;\r
+ int size_idx[ARRAYLENGTH(text_sizes)];\r
+} dlg_data;\r
+\r
+static void\r
+read_params(HWND hwnd, dlg_data * d) {\r
+\r
+ HDC hdc;\r
+\r
+ hdc = GetWindowDC(hwnd);\r
+\r
+ khm_get_cw_element_font(hdc,\r
+ NULL,\r
+ FALSE,\r
+ &d->lf_base);\r
+\r
+ d->lf_work = d->lf_base;\r
+\r
+ ReleaseDC(hwnd, hdc);\r
+}\r
+\r
+\r
+static void\r
+write_params(dlg_data * d) {\r
+ khm_boolean applied = FALSE;\r
+\r
+ if (memcmp(&d->lf_work, &d->lf_base, sizeof(LOGFONT))) {\r
+ khm_set_cw_element_font(NULL, &d->lf_work);\r
+ d->lf_base = d->lf_work;\r
+ applied = TRUE;\r
+ }\r
+\r
+ khui_cfg_set_flags(d->node,\r
+ (applied)? KHUI_CNFLAG_APPLIED: 0,\r
+ KHUI_CNFLAG_APPLIED | KHUI_CNFLAG_MODIFIED);\r
+}\r
+\r
+static void\r
+check_for_modification(dlg_data * d) {\r
+\r
+ khui_cfg_set_flags(d->node,\r
+ ((memcmp(&d->lf_work, &d->lf_base, sizeof(LOGFONT)))?\r
+ KHUI_CNFLAG_MODIFIED: 0),\r
+ KHUI_CNFLAG_MODIFIED);\r
+}\r
+\r
+static void\r
+refresh_view(HWND hwnd, dlg_data * d) {\r
+ wchar_t sample[256];\r
+ HFONT hf;\r
+ LOGFONT lf;\r
+\r
+ LoadString(khm_hInstance, IDS_APR_SAMPLE_TEXT_NORMAL,\r
+ sample, ARRAYLENGTH(sample));\r
+\r
+ SetDlgItemText(hwnd, IDC_CFG_SAMPLE_NORMAL, sample);\r
+\r
+ LoadString(khm_hInstance, IDS_APR_SAMPLE_TEXT_SEL,\r
+ sample, ARRAYLENGTH(sample));\r
+\r
+ SetDlgItemText(hwnd, IDC_CFG_SAMPLE_BOLD, sample);\r
+\r
+ lf = d->lf_work;\r
+ hf = CreateFontIndirect(&lf);\r
+ if (hf == NULL)\r
+ return;\r
+\r
+ SendDlgItemMessage(hwnd, IDC_CFG_SAMPLE_NORMAL, WM_SETFONT, (WPARAM) hf, TRUE);\r
+\r
+ if (d->c_font_normal)\r
+ DeleteObject(d->c_font_normal);\r
+\r
+ d->c_font_normal = hf;\r
+\r
+ lf.lfWeight = FW_BOLD;\r
+\r
+ hf = CreateFontIndirect(&lf);\r
+ if (hf == NULL)\r
+ return;\r
+\r
+ SendDlgItemMessage(hwnd, IDC_CFG_SAMPLE_BOLD, WM_SETFONT, (WPARAM) hf, TRUE);\r
+\r
+ if (d->c_font_bold)\r
+ DeleteObject(d->c_font_bold);\r
+\r
+ d->c_font_bold = hf;\r
+}\r
+\r
+struct sel_update_blob {\r
+ dlg_data * d;\r
+ HDC hdc;\r
+};\r
+\r
+static int CALLBACK\r
+enum_font_proc(ENUMLOGFONTEXDV * plfe,\r
+ ENUMTEXTMETRIC * pntm,\r
+ DWORD font_type,\r
+ LPARAM lParam) {\r
+ struct sel_update_blob * blob = (struct sel_update_blob *) lParam;\r
+ LOGFONT * plf = &plfe->elfEnumLogfontEx.elfLogFont;\r
+ LRESULT lr;\r
+\r
+ lr = SendDlgItemMessage(blob->d->hwnd,\r
+ IDC_CFG_FONTS,\r
+ CB_SELECTSTRING,\r
+ (WPARAM) -1,\r
+ (LPARAM) plf->lfFaceName);\r
+\r
+ if (lr == CB_ERR) {\r
+ SendDlgItemMessage(blob->d->hwnd,\r
+ IDC_CFG_FONTS,\r
+ CB_SELECTSTRING,\r
+ (WPARAM) -1,\r
+ (LPARAM) plfe->elfEnumLogfontEx.elfFullName);\r
+ }\r
+\r
+ return FALSE;\r
+}\r
+\r
+static void\r
+update_selection(dlg_data * d, BOOL update_fonts, BOOL update_effects) {\r
+ LOGFONT lf;\r
+ struct sel_update_blob blob;\r
+ HDC hdc;\r
+\r
+ if (update_fonts) {\r
+\r
+ ZeroMemory(&lf, sizeof(lf));\r
+\r
+ lf.lfCharSet = ANSI_CHARSET;\r
+ StringCbCopy(lf.lfFaceName, sizeof(lf.lfFaceName),\r
+ d->lf_work.lfFaceName);\r
+\r
+ hdc = GetWindowDC(d->hwnd);\r
+\r
+ blob.d = d;\r
+ blob.hdc = hdc;\r
+\r
+ EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC) enum_font_proc,\r
+ (LPARAM) &blob, 0);\r
+\r
+ ReleaseDC(d->hwnd, hdc);\r
+ }\r
+\r
+ if (update_effects) {\r
+ int i;\r
+ HDC hdc;\r
+ int pt_height;\r
+\r
+ if (d->lf_work.lfWeight >= FW_BOLD)\r
+ CheckDlgButton(d->hwnd, IDC_CFG_BOLD, BST_CHECKED);\r
+ else\r
+ CheckDlgButton(d->hwnd, IDC_CFG_BOLD, BST_UNCHECKED);\r
+\r
+ if (d->lf_work.lfItalic)\r
+ CheckDlgButton(d->hwnd, IDC_CFG_ITALICS, BST_CHECKED);\r
+ else\r
+ CheckDlgButton(d->hwnd, IDC_CFG_ITALICS, BST_UNCHECKED);\r
+\r
+ hdc = GetWindowDC(d->hwnd);\r
+\r
+ pt_height = MulDiv(d->lf_work.lfHeight, 72,\r
+ GetDeviceCaps(hdc, LOGPIXELSY));\r
+\r
+\r
+ ReleaseDC(d->hwnd, hdc);\r
+\r
+ if (pt_height < 0)\r
+ pt_height = - pt_height;\r
+\r
+ for (i=0; i < ARRAYLENGTH(text_sizes); i++) {\r
+ if (text_sizes[i] >= pt_height)\r
+ break;\r
+ }\r
+\r
+ if (i >= ARRAYLENGTH(text_sizes))\r
+ i = ARRAYLENGTH(text_sizes) - 1;\r
+\r
+ SendDlgItemMessage(d->hwnd, IDC_CFG_SIZE, CB_SETCURSEL,\r
+ d->size_idx[i], 0);\r
+ }\r
+}\r
+\r
+static int CALLBACK\r
+enum_font_families_proc(ENUMLOGFONTEXDV * plfe,\r
+ ENUMTEXTMETRIC * pntm,\r
+ DWORD font_type,\r
+ LPARAM lParam) {\r
+\r
+ dlg_data * d = (dlg_data *) lParam;\r
+\r
+ SendDlgItemMessage(d->hwnd, IDC_CFG_FONTS,\r
+ CB_ADDSTRING, 0,\r
+ (LPARAM) plfe->elfEnumLogfontEx.elfLogFont.lfFaceName);\r
+\r
+ return TRUE;\r
+}\r
+\r
+INT_PTR CALLBACK\r
+khm_cfg_appearance_proc(HWND hwnd,\r
+ UINT uMsg,\r
+ WPARAM wParam,\r
+ LPARAM lParam) {\r
+\r
+ dlg_data * d;\r
+\r
+ switch(uMsg) {\r
+ case WM_INITDIALOG:\r
+ {\r
+ HWND hw_cb;\r
+ LOGFONT lf;\r
+ HDC hdc;\r
+ int i;\r
+ wchar_t buf[4];\r
+\r
+ d = PMALLOC(sizeof(*d));\r
+#ifdef DEBUG\r
+ assert(d != NULL);\r
+#endif\r
+\r
+#pragma warning(push)\r
+#pragma warning(disable: 4244)\r
+ SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR) d);\r
+#pragma warning(pop)\r
+\r
+ ZeroMemory(d, sizeof(*d));\r
+\r
+ d->node = (khui_config_node) lParam;\r
+ d->hwnd = hwnd;\r
+\r
+ read_params(hwnd, d);\r
+\r
+ hw_cb = GetDlgItem(hwnd, IDC_CFG_FONTS);\r
+#ifdef DEBUG\r
+ assert(hw_cb);\r
+#endif\r
+ SendMessage(hw_cb, CB_RESETCONTENT, 0, 0);\r
+\r
+ ZeroMemory(&lf, sizeof(lf));\r
+ lf.lfCharSet = ANSI_CHARSET;\r
+\r
+ hdc = GetWindowDC(hwnd);\r
+\r
+ EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC) enum_font_families_proc,\r
+ (LPARAM) d, 0);\r
+\r
+ ReleaseDC(hwnd, hdc);\r
+\r
+\r
+ for (i=0; i < ARRAYLENGTH(text_sizes); i++) {\r
+ LRESULT idx;\r
+\r
+ StringCbPrintf(buf, sizeof(buf), L"%d", text_sizes[i]);\r
+\r
+ idx = SendDlgItemMessage(hwnd, IDC_CFG_SIZE,\r
+ CB_ADDSTRING, 0, (LPARAM) buf);\r
+\r
+ SendDlgItemMessage(hwnd, IDC_CFG_SIZE,\r
+ CB_SETITEMDATA, idx, text_sizes[i]);\r
+\r
+ d->size_idx[i] = (int) idx;\r
+ }\r
+\r
+ update_selection(d, TRUE, TRUE);\r
+\r
+ refresh_view(hwnd, d);\r
+ }\r
+ return FALSE;\r
+\r
+ case WM_COMMAND:\r
+ d = (dlg_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER);\r
+\r
+ if (wParam == MAKEWPARAM(IDC_CFG_FONTS, CBN_SELCHANGE)) {\r
+ LRESULT idx;\r
+ wchar_t facename[LF_FACESIZE];\r
+\r
+ idx = SendDlgItemMessage(hwnd, IDC_CFG_FONTS,\r
+ CB_GETCURSEL,\r
+ 0, 0);\r
+\r
+ if (idx == CB_ERR)\r
+ return TRUE;\r
+\r
+ if (SendDlgItemMessage(hwnd, IDC_CFG_FONTS,\r
+ CB_GETLBTEXTLEN, idx, 0)\r
+ >= ARRAYLENGTH(facename))\r
+ return TRUE;\r
+\r
+ SendDlgItemMessage(hwnd, IDC_CFG_FONTS,\r
+ CB_GETLBTEXT, idx,\r
+ (LPARAM) facename);\r
+\r
+ ZeroMemory(d->lf_work.lfFaceName,\r
+ sizeof(d->lf_work.lfFaceName));\r
+\r
+ StringCbCopy(d->lf_work.lfFaceName,\r
+ sizeof(d->lf_work.lfFaceName),\r
+ facename);\r
+\r
+ update_selection(d, FALSE, FALSE);\r
+\r
+ refresh_view(hwnd, d);\r
+\r
+ check_for_modification(d);\r
+\r
+ } else if (wParam == MAKEWPARAM(IDC_CFG_BOLD, BN_CLICKED)) {\r
+\r
+ if (IsDlgButtonChecked(hwnd, IDC_CFG_BOLD) == BST_CHECKED) {\r
+ d->lf_work.lfWeight = FW_BOLD;\r
+ } else {\r
+ d->lf_work.lfWeight = 0;\r
+ }\r
+\r
+ refresh_view(hwnd, d);\r
+\r
+ check_for_modification(d);\r
+\r
+ } else if (wParam == MAKEWPARAM(IDC_CFG_ITALICS, BN_CLICKED)) {\r
+\r
+ d->lf_work.lfItalic =\r
+ (IsDlgButtonChecked(hwnd, IDC_CFG_ITALICS) == BST_CHECKED);\r
+\r
+ refresh_view(hwnd, d);\r
+\r
+ check_for_modification(d);\r
+\r
+ } else if (wParam == MAKEWPARAM(IDC_CFG_REVERT, BN_CLICKED)) {\r
+ HDC hdc;\r
+\r
+ hdc = GetWindowDC(hwnd);\r
+\r
+ khm_get_cw_element_font(hdc, NULL, TRUE, &d->lf_work);\r
+\r
+ ReleaseDC(hwnd, hdc);\r
+\r
+ update_selection(d, TRUE, TRUE);\r
+\r
+ refresh_view(hwnd, d);\r
+\r
+ check_for_modification(d);\r
+\r
+ } else if (wParam == MAKEWPARAM(IDC_CFG_SIZE, CBN_SELCHANGE)) {\r
+ HDC hdc;\r
+ LPARAM idx;\r
+ int points;\r
+\r
+ idx = SendDlgItemMessage(hwnd, IDC_CFG_SIZE,\r
+ CB_GETCURSEL, 0, 0);\r
+ if (idx == CB_ERR)\r
+ return TRUE;\r
+\r
+ points = (int) SendDlgItemMessage(hwnd, IDC_CFG_SIZE,\r
+ CB_GETITEMDATA, idx, 0);\r
+\r
+ hdc = GetWindowDC(hwnd);\r
+\r
+ d->lf_work.lfHeight = -MulDiv(points,\r
+ GetDeviceCaps(hdc, LOGPIXELSY),\r
+ 72);\r
+\r
+ ReleaseDC(hwnd, hdc);\r
+\r
+ refresh_view(hwnd, d);\r
+\r
+ check_for_modification(d);\r
+ }\r
+\r
+ return TRUE;\r
+\r
+ case WM_DESTROY:\r
+ d = (dlg_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER);\r
+\r
+ if (d) {\r
+ if (d->c_font_bold)\r
+ DeleteObject(d->c_font_bold);\r
+\r
+ if (d->c_font_normal)\r
+ DeleteObject(d->c_font_normal);\r
+\r
+ PFREE(d);\r
+ }\r
+ return TRUE;\r
+\r
+ case KHUI_WM_CFG_NOTIFY:\r
+ d = (dlg_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER);\r
+\r
+ if (HIWORD(wParam) == WMCFG_APPLY) {\r
+ write_params(d);\r
+ khui_action_trigger(KHUI_ACTION_LAYOUT_RELOAD, NULL);\r
+ }\r
+\r
+ return TRUE;\r
+ }\r
+\r
+ return FALSE;\r
+}\r
\r
return FALSE;\r
\r
+ case WM_DESTROY:\r
+ d = (dlg_data *) (DWORD_PTR) GetWindowLongPtr(hwnd, DWLP_USER);\r
+ if (d) {\r
+ PFREE(d);\r
+ }\r
+ return TRUE;\r
+\r
case WM_COMMAND:\r
d = (dlg_data *) (DWORD_PTR) GetWindowLongPtr(hwnd, DWLP_USER);\r
\r
\r
khui_cfg_register(NULL, ®);\r
\r
+ reg.name = L"KhmAppear";\r
+ reg.dlg_template = MAKEINTRESOURCE(IDD_CFG_APPEAR);\r
+ reg.dlg_proc = khm_cfg_appearance_proc;\r
+ LoadString(khm_hInstance, IDS_CFG_APPEAR_SHORT,\r
+ wshort, ARRAYLENGTH(wshort));\r
+ LoadString(khm_hInstance, IDS_CFG_APPEAR_LONG,\r
+ wlong, ARRAYLENGTH(wlong));\r
+\r
+ khui_cfg_register(NULL, ®);\r
+\r
reg.name = L"KhmIdentities";\r
reg.dlg_template = MAKEINTRESOURCE(IDD_CFG_IDENTITIES);\r
reg.dlg_proc = khm_cfg_identities_proc;\r
UINT uMsg,\r
WPARAM wParam,\r
LPARAM lParam);\r
+\r
+INT_PTR CALLBACK\r
+khm_cfg_appearance_proc(HWND hwnd,\r
+ UINT uMsg,\r
+ WPARAM wParam,\r
+ LPARAM lParam);\r
#endif\r
\r
khm_int32 attr_to_action[KCDB_ATTR_MAX_ID + 1];\r
\r
+void\r
+khm_set_cw_element_font(wchar_t * name, LOGFONT * pfont) {\r
+ khm_handle csp_cw = NULL;\r
+ wchar_t * element_name;\r
+\r
+ if (name == NULL)\r
+ element_name = L"FontBase";\r
+ else\r
+ element_name = name;\r
+\r
+ if (KHM_FAILED(khc_open_space(NULL, L"CredWindow", KHM_PERM_WRITE,\r
+ &csp_cw)))\r
+ return;\r
+\r
+ khc_write_binary(csp_cw, element_name, pfont, sizeof(LOGFONT));\r
+\r
+ khc_close_space(csp_cw);\r
+}\r
+\r
+void\r
+khm_get_cw_element_font(HDC hdc, wchar_t * name, BOOL use_default, LOGFONT * pfont) {\r
+ khm_handle csp_cw = NULL;\r
+ khm_size cb;\r
+ wchar_t * element_name;\r
+ khm_boolean try_derive = FALSE;\r
+\r
+ if (name == NULL)\r
+ element_name = L"FontBase";\r
+ else\r
+ element_name = name;\r
+\r
+ if (use_default)\r
+ goto _use_defaults;\r
+\r
+ if (KHM_FAILED(khc_open_space(NULL, L"CredWindow", 0,\r
+ &csp_cw)))\r
+ goto _use_defaults;\r
+\r
+ cb = sizeof(LOGFONT);\r
+ if (KHM_FAILED(khc_read_binary(csp_cw, element_name, pfont,\r
+ &cb)) ||\r
+ cb != sizeof(LOGFONT)) {\r
+ try_derive = TRUE;\r
+ }\r
+\r
+ if (try_derive) {\r
+ cb = sizeof(LOGFONT);\r
+ if (!name ||\r
+ KHM_FAILED(khc_read_binary(csp_cw, L"FontBase", pfont,\r
+ &cb)) ||\r
+ cb != sizeof(LOGFONT)) {\r
+ khc_close_space(csp_cw);\r
+ goto _use_defaults;\r
+ }\r
+\r
+ if (!wcscmp(name, L"FontHeaderBold") ||\r
+ !wcscmp(name, L"FontBold")) {\r
+\r
+ pfont->lfWeight = FW_BOLD;\r
+\r
+ }\r
+ }\r
+\r
+ khc_close_space(csp_cw);\r
+\r
+ return;\r
+\r
+ _use_defaults:\r
+\r
+ ZeroMemory(pfont, sizeof(*pfont));\r
+\r
+ if (name == NULL) {\r
+ LOGFONT lf = {\r
+ -MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72), 0, /* width/height */\r
+ 0,0, /* escapement */\r
+ FW_THIN,\r
+ FALSE,\r
+ FALSE,\r
+ FALSE,\r
+ DEFAULT_CHARSET,\r
+ OUT_DEFAULT_PRECIS,\r
+ CLIP_DEFAULT_PRECIS,\r
+ DEFAULT_QUALITY,\r
+ FF_SWISS,\r
+ L"MS Shell Dlg"};\r
+\r
+ *pfont = lf;\r
+\r
+ } else if (!wcscmp(name, L"FontHeader")) {\r
+ LOGFONT lf = {\r
+ -MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72), 0, /* width/height */\r
+ 0,0, /* escapement */\r
+ FW_THIN,\r
+ FALSE,\r
+ FALSE,\r
+ FALSE,\r
+ DEFAULT_CHARSET,\r
+ OUT_DEFAULT_PRECIS,\r
+ CLIP_DEFAULT_PRECIS,\r
+ DEFAULT_QUALITY,\r
+ FF_SWISS,\r
+ L"MS Shell Dlg"};\r
+\r
+ *pfont = lf;\r
+\r
+ } else if (!wcscmp(name, L"FontHeaderBold")) {\r
+ LOGFONT lf = {\r
+ -MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72), 0, /* width/height */\r
+ 0,0, /* escapement */\r
+ FW_BOLD,\r
+ FALSE,\r
+ FALSE,\r
+ FALSE,\r
+ DEFAULT_CHARSET,\r
+ OUT_DEFAULT_PRECIS,\r
+ CLIP_DEFAULT_PRECIS,\r
+ DEFAULT_QUALITY,\r
+ FF_SWISS,\r
+ L"MS Shell Dlg"};\r
+\r
+ *pfont = lf;\r
+\r
+ } else if (!wcscmp(name, L"FontNormal")) {\r
+ LOGFONT lf = {\r
+ -MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72), 0, /* width/height */\r
+ 0,0, /* escapement */\r
+ FW_THIN,\r
+ FALSE,\r
+ FALSE,\r
+ FALSE,\r
+ DEFAULT_CHARSET,\r
+ OUT_DEFAULT_PRECIS,\r
+ CLIP_DEFAULT_PRECIS,\r
+ DEFAULT_QUALITY,\r
+ FF_SWISS,\r
+ L"MS Shell Dlg"};\r
+\r
+ *pfont = lf;\r
+\r
+ } else if (!wcscmp(name, L"FontBold")) {\r
+ LOGFONT lf = {\r
+ -MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72), 0, /* width/height */\r
+ 0,0, /* escapement */\r
+ FW_BOLD,\r
+ FALSE,\r
+ FALSE,\r
+ FALSE,\r
+ DEFAULT_CHARSET,\r
+ OUT_DEFAULT_PRECIS,\r
+ CLIP_DEFAULT_PRECIS,\r
+ DEFAULT_QUALITY,\r
+ FF_SWISS,\r
+ L"MS Shell Dlg"};\r
+\r
+ *pfont = lf;\r
+\r
+ } else {\r
+#ifdef DEBUG\r
+ assert(FALSE);\r
+#endif\r
+ }\r
+}\r
+\r
void\r
cw_refresh_attribs(HWND hwnd) {\r
khm_int32 act;\r
wchar_t * iter = NULL;\r
int i;\r
HDC hdc;\r
+ LOGFONT log_font;\r
\r
tbl->hwnd = hwnd;\r
\r
\r
hdc = GetWindowDC(hwnd);\r
\r
- tbl->hf_header =\r
- CreateFont(-MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72),0, /* width/height */\r
- 0,0, /* escapement */\r
- FW_THIN,\r
- FALSE,\r
- FALSE,\r
- FALSE,\r
- DEFAULT_CHARSET,\r
- OUT_DEFAULT_PRECIS,\r
- CLIP_DEFAULT_PRECIS,\r
- DEFAULT_QUALITY,\r
- FF_SWISS,\r
- L"MS Shell Dlg");\r
+ khm_get_cw_element_font(hdc, L"FontHeader", FALSE, &log_font);\r
+ tbl->hf_header = CreateFontIndirect(&log_font);\r
\r
if(tbl->hf_header && tbl->hwnd_header)\r
SendMessage(tbl->hwnd_header, WM_SETFONT, (WPARAM) tbl->hf_header, 0);\r
\r
- tbl->hf_bold_header =\r
- CreateFont(-MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72),0, /* width/height */\r
- 0,0, /* escapement */\r
- FW_BOLD,\r
- FALSE,\r
- FALSE,\r
- FALSE,\r
- DEFAULT_CHARSET,\r
- OUT_DEFAULT_PRECIS,\r
- CLIP_DEFAULT_PRECIS,\r
- DEFAULT_QUALITY,\r
- FF_SWISS,\r
- L"MS Shell Dlg");\r
-\r
- tbl->hf_normal =\r
- CreateFont(-MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72),0, /* width/height */\r
- 0,0, /* escapement */\r
- FW_THIN,\r
- FALSE,\r
- FALSE,\r
- FALSE,\r
- DEFAULT_CHARSET,\r
- OUT_DEFAULT_PRECIS,\r
- CLIP_DEFAULT_PRECIS,\r
- DEFAULT_QUALITY,\r
- FF_SWISS,\r
- L"MS Shell Dlg");\r
-\r
- tbl->hf_bold =\r
- CreateFont(-MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72),0, /* width/height */\r
- 0,0, /* escapement */\r
- FW_BOLD,\r
- FALSE,\r
- FALSE,\r
- FALSE,\r
- DEFAULT_CHARSET,\r
- OUT_DEFAULT_PRECIS,\r
- CLIP_DEFAULT_PRECIS,\r
- DEFAULT_QUALITY,\r
- FF_SWISS,\r
- L"MS Shell Dlg");\r
+ khm_get_cw_element_font(hdc, L"FontHeaderBold", FALSE, &log_font);\r
+ tbl->hf_bold_header = CreateFontIndirect(&log_font);\r
+\r
+\r
+ khm_get_cw_element_font(hdc, L"FontNormal", FALSE, &log_font);\r
+ tbl->hf_normal = CreateFontIndirect(&log_font);\r
+\r
+ khm_get_cw_element_font(hdc, L"FontBold", FALSE, &log_font);\r
+ tbl->hf_bold = CreateFontIndirect(&log_font);\r
\r
ReleaseDC(hwnd, hdc);\r
\r
khc_close_space(tbl->csp_view);\r
tbl->csp_view = NULL;\r
}\r
+\r
+ tbl->cell_height = 0; /* recalculate cell height next time */\r
}\r
\r
void \r
phi->cxy = col->width;\r
}\r
\r
+int\r
+cw_get_cell_height(HDC hdc, HFONT hf) {\r
+ SIZE size;\r
+ size_t cbbuf;\r
+ wchar_t buf[64];\r
+ HFONT hfold;\r
+\r
+ if (hf)\r
+ hfold = SelectFont(hdc, hf);\r
+\r
+ LoadString(khm_hInstance, IDS_SAMPLE_STRING, buf, sizeof(buf)/sizeof(buf[0]));\r
+ StringCchLength(buf, sizeof(buf)/sizeof(buf[0]), &cbbuf);\r
+ GetTextExtentPoint32(hdc, buf, (int) cbbuf, &size);\r
+\r
+ if (hf)\r
+ SelectFont(hdc, hfold);\r
+\r
+ return size.cy;\r
+}\r
+\r
/* returns a bitmask indicating which measures were changed */\r
int \r
cw_update_extents(khui_credwnd_tbl * tbl, \r
\r
if(!tbl->cell_height) {\r
HDC dc;\r
- HFONT hfold;\r
- SIZE size;\r
- size_t cbbuf;\r
- wchar_t buf[64];\r
+ int maxheight = 0;\r
+ int height;\r
\r
dc = GetWindowDC(tbl->hwnd);\r
- if(tbl->hf_normal)\r
- hfold = SelectFont(dc, tbl->hf_normal);\r
\r
- LoadString(khm_hInstance, IDS_SAMPLE_STRING, buf, sizeof(buf)/sizeof(buf[0]));\r
- StringCchLength(buf, sizeof(buf)/sizeof(buf[0]), &cbbuf);\r
- GetTextExtentPoint32(dc, buf, (int) cbbuf, &size);\r
+ maxheight = cw_get_cell_height(dc, tbl->hf_normal);\r
+ height = cw_get_cell_height(dc, tbl->hf_bold);\r
+ if (height > maxheight)\r
+ maxheight = height;\r
+ height = cw_get_cell_height(dc, tbl->hf_header);\r
+ if (height > maxheight)\r
+ maxheight = height;\r
+ height = cw_get_cell_height(dc, tbl->hf_bold_header);\r
+ if (height > maxheight)\r
+ maxheight = height;\r
\r
- if(tbl->hf_normal)\r
- SelectFont(dc,hfold);\r
ReleaseDC(tbl->hwnd, dc);\r
\r
- tbl->cell_height = size.cy + tbl->vpad * 2;\r
+ tbl->cell_height = height + tbl->vpad * 2;\r
}\r
\r
ext_y = (int) tbl->n_rows * tbl->cell_height;\r
int i;\r
\r
for (i=idx; i < tbl->n_cols; i++) {\r
- if (!(tbl->cols[i].flags &\r
- (KHUI_CW_COL_GROUP |\r
- KHUI_CW_COL_SORT_INC |\r
- KHUI_CW_COL_SORT_DEC)))\r
+ if (!(tbl->cols[i].flags & KHUI_CW_COL_GROUP))\r
+ break;\r
+\r
+ tbl->cols[i].flags &= ~KHUI_CW_COL_GROUP;\r
+\r
+ cw_hditem_from_tbl_col(&tbl->cols[idx], &hi);\r
+ hi.mask = HDI_FORMAT;\r
+ hidx = Header_OrderToIndex(tbl->hwnd_header, i);\r
+ Header_SetItem(tbl->hwnd_header, hidx, &hi);\r
+ }\r
+\r
+ } else if (tbl->cols[idx].flags &\r
+ (KHUI_CW_COL_SORT_INC |\r
+ KHUI_CW_COL_SORT_DEC)) {\r
+ int i;\r
+\r
+ /* remove the sort condition from a column */\r
+\r
+ for (i=idx; i < tbl->n_cols; i++) {\r
+ if (!tbl->cols[i].flags &\r
+ (KHUI_CW_COL_SORT_INC |\r
+ KHUI_CW_COL_SORT_DEC))\r
break;\r
\r
tbl->cols[i].flags &=\r
- ~(KHUI_CW_COL_GROUP |\r
- KHUI_CW_COL_SORT_DEC |\r
- KHUI_CW_COL_SORT_INC);\r
+ ~(KHUI_CW_COL_SORT_INC |\r
+ KHUI_CW_COL_SORT_DEC);\r
\r
cw_hditem_from_tbl_col(&tbl->cols[idx], &hi);\r
hi.mask = HDI_FORMAT;\r
for(i=row_s; i < row_e; i++) {\r
selected = tbl->rows[i].flags & KHUI_CW_ROW_SELECTED;\r
\r
- if(tbl->cursor_row == i)\r
- SelectFont(hdc, tbl->hf_bold);\r
+ if(tbl->cursor_row == i) {\r
+ if (tbl->rows[i].flags & KHUI_CW_ROW_HEADER)\r
+ SelectFont(hdc, tbl->hf_bold_header);\r
+ else\r
+ SelectFont(hdc, tbl->hf_bold);\r
+ } else if (tbl->rows[i].flags & KHUI_CW_ROW_HEADER) {\r
+ SelectFont(hdc, tbl->hf_header);\r
+ }\r
\r
x = xs;\r
if(tbl->rows[i].flags & KHUI_CW_ROW_HEADER) {\r
if(tbl->cursor_row == i) {\r
rh.left = tbl->scr_left;\r
rh.right = tbl->scr_left + tbl->ext_width;\r
-\r
DrawFocusRect(hdc, &rh);\r
+ }\r
\r
+ if (tbl->cursor_row == i ||\r
+ (tbl->rows[i].flags & KHUI_CW_ROW_HEADER)) {\r
SelectFont(hdc, tbl->hf_normal);\r
}\r
\r
}\r
break;\r
\r
+ case KHUI_ACTION_LAYOUT_RELOAD:\r
+ {\r
+ wchar_t cname[KCONF_MAXCCH_NAME];\r
+ khm_size cb;\r
+\r
+ cname[0] = L'\0';\r
+\r
+ if (tbl->csp_view) {\r
+ cb = sizeof(cname);\r
+ khc_get_config_space_name(tbl->csp_view,\r
+ cname,\r
+ &cb);\r
+ }\r
+\r
+ cw_unload_view(tbl);\r
+\r
+ cw_load_view(tbl, ((cname[0])?cname: NULL), hwnd);\r
+ cw_insert_header_cols(tbl);\r
+\r
+ cw_update_creds(tbl);\r
+ cw_update_outline(tbl);\r
+ cw_update_extents(tbl, TRUE);\r
+\r
+ InvalidateRect(tbl->hwnd, NULL, TRUE);\r
+ }\r
+ break;\r
+\r
case KHUI_ACTION_LAYOUT_ID:\r
{\r
cw_save_view(tbl, NULL);\r
\r
void cw_insert_header_cols(khui_credwnd_tbl * tbl);\r
\r
+void khm_get_cw_element_font(HDC hdc, wchar_t * name, BOOL use_default,\r
+ LOGFONT * pfont);\r
+\r
+void khm_set_cw_element_font(wchar_t * name, LOGFONT * pfont);\r
+\r
#endif\r
LTEXT "Loaded modules",IDC_STATIC,41,60,52,8\r
END\r
\r
+IDD_CFG_APPEAR DIALOGEX 0, 0, 255, 182\r
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU\r
+EXSTYLE WS_EX_CONTROLPARENT\r
+FONT 8, "MS Shell Dlg", 400, 0, 0x1\r
+BEGIN\r
+ GROUPBOX "Font for credentials display",IDC_STATIC,7,7,241,137\r
+ LTEXT "&Font name",IDC_STATIC,17,22,35,8\r
+ COMBOBOX IDC_CFG_FONTS,62,20,178,30,CBS_DROPDOWNLIST | CBS_SORT | \r
+ WS_VSCROLL | WS_TABSTOP\r
+ LTEXT "&Size",IDC_STATIC,62,43,14,8\r
+ COMBOBOX IDC_CFG_SIZE,87,41,48,14,CBS_DROPDOWNLIST | WS_VSCROLL | \r
+ WS_TABSTOP\r
+ CONTROL "&Bold",IDC_CFG_BOLD,"Button",BS_AUTOCHECKBOX | \r
+ WS_TABSTOP,162,42,29,10\r
+ CONTROL "&Italics",IDC_CFG_ITALICS,"Button",BS_AUTOCHECKBOX | \r
+ WS_TABSTOP,205,42,35,10\r
+ EDITTEXT IDC_CFG_SAMPLE_NORMAL,62,66,178,21,ES_AUTOHSCROLL | \r
+ ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,\r
+ WS_EX_STATICEDGE\r
+ EDITTEXT IDC_CFG_SAMPLE_BOLD,62,91,178,21,ES_AUTOHSCROLL | \r
+ ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,\r
+ WS_EX_STATICEDGE\r
+ PUSHBUTTON "&Revert to default",IDC_CFG_REVERT,168,122,72,14\r
+END\r
+\r
\r
/////////////////////////////////////////////////////////////////////////////\r
//\r
TOPMARGIN, 7\r
BOTTOMMARGIN, 163\r
END\r
+\r
+ IDD_CFG_APPEAR, DIALOG\r
+ BEGIN\r
+ LEFTMARGIN, 7\r
+ RIGHTMARGIN, 248\r
+ VERTGUIDE, 7\r
+ VERTGUIDE, 62\r
+ VERTGUIDE, 240\r
+ VERTGUIDE, 248\r
+ TOPMARGIN, 7\r
+ BOTTOMMARGIN, 175\r
+ END\r
END\r
#endif // APSTUDIO_INVOKED\r
\r
IDS_CFG_P_UNRCNFM "Are you sure you want to unregister plugin %s? In addition to this plugin, any other plugins that are provided by the same module will also be unregistered.\n\nThe plugin will no longer be loaded for subsequent sessions of NetIDMgr."\r
IDS_CFG_P_UNRCNFS "Note that if the plugin was registered by a seprate installer, it should be unregistered by the same installer and not through NetIDMgr.\n\nThe following plugins will be unregistered: %s"\r
IDS_ACTION_LAYOUT_CUST "Custom"\r
+ IDS_APR_HEADER_TEXT "Header text"\r
+END\r
+\r
+STRINGTABLE \r
+BEGIN\r
+ IDS_APR_HEADER_TEXT_BOLD "Header text (selected)"\r
+ IDS_APR_TEXT "Normal text"\r
+ IDS_APR_TEXT_BOLD "Normal text (selected)"\r
+ IDS_APR_SAMPLE_TEXT_NORMAL "Sample text (normal). 01234567890"\r
+ IDS_CFG_APPEAR_SHORT "Appearance"\r
+ IDS_CFG_APPEAR_LONG "Appearance"\r
+ IDS_ACTION_OPT_APPEAR "Appearance ..."\r
+ IDS_APR_SAMPLE_TEXT_SEL "Sample text (selected). 01234567890"\r
END\r
\r
#endif // English (U.S.) resources\r
}\r
break;\r
\r
+ case KHUI_ACTION_OPT_APPEAR: {\r
+ khui_config_node node = NULL;\r
+\r
+ khui_cfg_open(NULL, L"KhmAppear", &node);\r
+ khm_show_config_pane(node);\r
+ }\r
+ break;\r
+\r
case KHUI_ACTION_OPT_NOTIF: {\r
khui_config_node node = NULL;\r
\r
case KHUI_ACTION_LAYOUT_TYPE:\r
case KHUI_ACTION_LAYOUT_LOC:\r
case KHUI_ACTION_LAYOUT_CUST:\r
+ case KHUI_ACTION_LAYOUT_RELOAD:\r
/* otherwise fallthrough and bounce to the creds window */\r
return SendMessage(khm_hwnd_main_cred, uMsg, \r
wParam, lParam);\r
static khm_int32\r
alert_enqueue(khui_alert * a);\r
\r
+/* These are defined for APPVER >= 0x501. We are defining them here\r
+ so that we can build with APPVER = 0x500 and use the same binaries\r
+ with Win XP. */\r
+\r
+#ifndef NIN_BALLOONSHOW\r
+#define NIN_BALLOONSHOW (WM_USER + 2)\r
+#endif\r
+\r
+#ifndef NIN_BALLOONHIDE\r
+#define NIN_BALLOONHIDE (WM_USER + 3)\r
+#endif\r
+\r
+#ifndef NIN_BALLOONTIMEOUT\r
+#define NIN_BALLOONTIMEOUT (WM_USER + 4)\r
+#endif\r
+\r
+#ifndef NIN_BALLOONUSERCLICK\r
+#define NIN_BALLOONUSERCLICK (WM_USER + 5)\r
+#endif\r
+\r
+\r
/**********************************************************************\r
Notifier\r
***********************************************************************\r
khm_show_main_window();\r
break;\r
\r
-#if (_WIN32_IE >= 0x0501)\r
case NIN_BALLOONUSERCLICK:\r
if (current_alert) {\r
if ((current_alert->flags & KHUI_ALERT_FLAG_DEFACTION) &&\r
current_alert = NULL;\r
}\r
break;\r
-#endif\r
-\r
}\r
} else if (uMsg == WM_TIMER) {\r
if (wParam == KHUI_TRIGGER_TIMER_ID) {\r
#define IDS_PISTATE_FAILLOD 209\r
#define IDI_CFG_PLUGIN_DIS 209\r
#define IDS_PISTATE_PLACEHOLD 210\r
+#define IDD_CFG_APPEAR 210\r
#define IDS_PISTATE_REG 211\r
#define IDS_PISTATE_HOLD 212\r
#define IDS_PISTATE_INIT 213\r
#define IDS_CFG_P_UNRCNFM 252\r
#define IDS_CFG_P_UNRCNFS 253\r
#define IDS_ACTION_LAYOUT_CUST 254\r
+#define IDS_APR_HEADER_TEXT 255\r
+#define IDS_APR_HEADER_TEXT_BOLD 256\r
+#define IDS_APR_TEXT 257\r
+#define IDS_APR_TEXT_BOLD 258\r
+#define IDS_APR_SAMPLE_TEXT_NORMAL 259\r
+#define IDS_CFG_APPEAR_SHORT 260\r
+#define IDS_CFG_APPEAR_LONG 261\r
+#define IDS_ACTION_OPT_APPEAR 262\r
+#define IDS_APR_SAMPLE_TEXT_SEL 263\r
#define IDC_NC_USERNAME 1007\r
#define IDC_NC_PASSWORD 1008\r
#define IDC_NC_CREDTEXT_LABEL 1009\r
#define IDC_CFG_LOGPATH 1111\r
#define IDC_NOTIF_HALFLIFE 1112\r
#define IDC_CFG_DESTROYALL 1113\r
+#define IDC_CFG_SAMPLE_NORMAL 1123\r
+#define IDC_CFG_REVERT 1127\r
+#define IDC_CFG_FONTS 1128\r
+#define IDC_CFG_SAMPLE_BOLD 1129\r
+#define IDC_CFG_SIZE 1130\r
+#define IDC_CFG_BOLD 1131\r
+#define IDC_CFG_ITALICS 1132\r
#define IDA_ACTIVATE_MENU 40003\r
#define IDA_UP 40004\r
#define IDA_DOWN 40005\r
// \r
#ifdef APSTUDIO_INVOKED\r
#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE 210\r
+#define _APS_NEXT_RESOURCE_VALUE 211\r
#define _APS_NEXT_COMMAND_VALUE 40010\r
-#define _APS_NEXT_CONTROL_VALUE 1114\r
+#define _APS_NEXT_CONTROL_VALUE 1133\r
#define _APS_NEXT_SYMED_VALUE 101\r
#endif\r
#endif\r
--- /dev/null
+#\r
+# Copyright (c) 2004 Massachusetts Institute of Technology\r
+#\r
+# Permission is hereby granted, free of charge, to any person\r
+# obtaining a copy of this software and associated documentation files\r
+# (the "Software"), to deal in the Software without restriction,\r
+# including without limitation the rights to use, copy, modify, merge,\r
+# publish, distribute, sublicense, and/or sell copies of the Software,\r
+# and to permit persons to whom the Software is furnished to do so,\r
+# subject to the following conditions:\r
+#\r
+# The above copyright notice and this permission notice shall be\r
+# included in all copies or substantial portions of the Software.\r
+#\r
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+# SOFTWARE.\r
+\r
+\r
+MODULE=uilib.w2k\r
+!include <../config/Makefile.w2k>\r
+\r
+UIDLLOBJFILES= \\r
+ $(OBJ)\rescache.obj \\r
+ $(OBJ)\action.obj \\r
+ $(OBJ)\creddlg.obj \\r
+ $(OBJ)\alert.obj \\r
+ $(OBJ)\propsheet.obj \\r
+ $(OBJ)\propwnd.obj \\r
+ $(OBJ)\uilibmain.obj \\r
+ $(OBJ)\actiondef.obj \\r
+ $(OBJ)\acceldef.obj \\r
+ $(OBJ)\configui.obj \\r
+ $(OBJ)\trackerwnd.obj \\r
+ $(OBJ)\version.obj\r
+\r
+INCFILES= \\r
+ $(INCDIR)\khuidefs.h \\r
+ $(INCDIR)\khrescache.h \\r
+ $(INCDIR)\khaction.h \\r
+ $(INCDIR)\khactiondef.h \\r
+ $(INCDIR)\khalerts.h \\r
+ $(INCDIR)\khhtlink.h \\r
+ $(INCDIR)\khnewcred.h \\r
+ $(INCDIR)\khprops.h \\r
+ $(INCDIR)\khconfigui.h \\r
+ $(INCDIR)\khtracker.h \\r
+ $(INCDIR)\khremote.h\r
+\r
+$(OBJ)\actiondef.c: actions.csv actiondef.cfg\r
+ $(CCSV) $** $@\r
+\r
+$(OBJ)\acceldef.c: accel.csv acceldef.cfg\r
+ $(CCSV) $** $@\r
+\r
+all: mkdirs $(INCFILES) $(UIDLLOBJFILES)\r
+\r
\r
khui_action_ref khui_menu_options[] = {\r
MENU_ACTION(KHUI_ACTION_OPT_KHIM),\r
+ MENU_ACTION(KHUI_ACTION_OPT_APPEAR),\r
MENU_ACTION(KHUI_ACTION_OPT_IDENTS),\r
MENU_ACTION(KHUI_ACTION_OPT_NOTIF),\r
MENU_ACTION(KHUI_ACTION_OPT_PLUGINS),\r
def = &khui_accel_global[i];\r
\r
if(def->mod & FALT) {\r
- if(FAILED(StringCbCat(buf, bufsiz, L"ALT+")))\r
+ if(FAILED(StringCbCat(buf, bufsiz, L"Alt+")))\r
return FALSE;\r
}\r
\r
\r
if(def->mod & FCONTROL) {\r
- if(FAILED(StringCbCat(buf, bufsiz, L"CTRL+")))\r
+ if(FAILED(StringCbCat(buf, bufsiz, L"Ctrl+")))\r
return FALSE;\r
}\r
\r
if(def->mod & FSHIFT) {\r
- if(FAILED(StringCbCat(buf, bufsiz, L"SHIFT+")))\r
+ if(FAILED(StringCbCat(buf, bufsiz, L"Shift+")))\r
return FALSE;\r
}\r
\r
KHUI_ACTION_OPT_KHIM,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_OPT_KHIM,0,IDH_ACTION_OPT_KHIM,0\r
KHUI_ACTION_OPT_NOTIF,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_OPT_NOTIF,0,IDH_ACTION_OPT_NOTIF,0\r
KHUI_ACTION_OPT_PLUGINS,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_OPT_PLUGINS,0,IDH_ACTION_OPT_KHIM,0\r
+KHUI_ACTION_OPT_APPEAR,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_OPT_APPEAR,0,0,0\r
KHUI_ACTION_HELP_CTX,KHUI_ACTIONTYPE_TRIGGER,,IDB_HELP,0,0,IDB_HELP_SM,0,IDS_ACTION_HELP_CTX,0,0,0\r
KHUI_ACTION_HELP_CONTENTS,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_HELP_CONTENTS,0,0,0\r
KHUI_ACTION_HELP_INDEX,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_HELP_INDEX,0,0,0\r
#define KHUI_ACTION_IMPORT (KHUI_ACTION_BASE + 28)\r
#define KHUI_ACTION_OPT_PLUGINS (KHUI_ACTION_BASE + 29)\r
#define KHUI_ACTION_LAYOUT_CUST (KHUI_ACTION_BASE + 30)\r
+#define KHUI_ACTION_OPT_APPEAR (KHUI_ACTION_BASE + 31)\r
+#define KHUI_ACTION_LAYOUT_RELOAD (KHUI_ACTION_BASE + 32)\r
/*@}*/\r
\r
/*! \name Pseudo actions \r