Intranet/Hosting Toolkit [table of contents]
[CFX_GetUserGroups]
v1.14 December 2nd 2001
CFX_GetUserGroups
OPEN-SOURCE
NT DLL for Cold Fusion 4.0.1 and up
Lewis A. Sellers
http://www.intrafoundation.com/ihtk.html
ihtk@intrafoundation.com

FOREWORD

This is an Allaire Cold Fusion Extension Tag (CFX). It is for use with Allaire Cold Fusion Servers 4.0.1 (and up) running on Microsoft NT. It was written by Lewis A. Sellers of Intrafoundation Software.

CFX_GetUserGroups is a function-limited read-only subset of CFX_UserManager. Use of this tag is prefered in some situations. It allows you to do only three things: 1) list all users in the NT security database & all local/global groups that exist in a domain/workstation & current users 2) list the groups/localgroups a single user belongs to as well as basic user info, 3) or (as of 1.6) verify a user by username/password.

THIS TAG IS FREEWARE.

C O N T E N T S

Lists
User Groups
Verify
Parameters
Returned Variables
Bugs
Version History
top

LISTS

<CFX_GetUserGroups>

If do not pass any arguments to this tag, aka:

<CFX_GETUSERGROUPS>

then you get back several queries including: Users, LocalGroups, GlobalGroups and CurrentUsers.

Users Query

This query contains a list of all NT user accounts plus some basic information.

LocalGroups Query

This query lists all the various localgroups.

GlobalGroups Query

This query lists all the (global) groups.

CurrentUsers Query

As of 1.4, the CurrentUsers query is returned. It lists all users currently logged in. Or should. Some older upgrade versions of NT apparently had "sticky" user accounts which would not be removed from the internal list when they logged out.

top

USER GROUPS/LOCALGROUPS AND BASIC INFO

<CFX_GetUserGroups USERNAME="" [SERVERNAME=""]>

Need to get some basic info about an NT account including what groups or localgroups it belongs to? If you pass to the tag the arguments Username and Servername you will retrieve three queries: UserGlobalGroups, UserLocalGroups and User.

UserLocalGroups Query

UserGlobalGroups Query

User

As of 1.5, this QUERY is also returned.

top

VERIFY USERNAME/PASSWORD

<CFX_GetUserGroups VERIFY="" PASSWORD="" [DOMAIN=""]>

As of 1.6, you can verify (or validate) whether a certain username with a certain password exists. This is typically used to validate a user that is trying to log into or manange an NT user account.

It works like this: You supply the username you wish to verify as the parameter VERIFY, their password as PASSWORD (and, optionally, their DOMAIN). If the username exists and the password is correct then GETUSERGROUPS will return "TRUE". If any error occurs or the account does not exist or the password is incorrect then "FALSE" will be returned.

Note that if an account is "DISABLED", or some other limitations are enabled then this function may tell you their usename/password are invalid. This is normal. Technically the VERIFY function is actually determining whether or not the account is able to be logged into, not whether it simply exists.

Please see the example page for a working example, but to query the Guest account you might do something like:

You might also get a A required privilege is not held by the client if you do not have the Cold Fusion Server logging is as SystemAccount. You'll need to add the advanced right to the group "Act as part of the operating system" for this special account.

<CFX_GETUSERGROUPS VERIFY="Guest" PASSWORD="Guest">

top

PARAMETERS

USERNAME
The NT User Account name. Up to 20 printable ANSI characters (case sensitive) except: " / \ [ ] : ; | = . + ? <>
SERVERNAME
Name of the server (such as \\SISSY).
DOMAIN
Name of the domain.
VERIFY
Same as USERNAME when doing a VERIFY.
PASSWORD
Used with VERIFY. The user's password.

top

RETURNED VARIABLES

This tag will echo back Username if you set it. It may return the Queries LocalGroups, GlobalGroups, UserLocalGroups, UserGlobalGroups and Users.

The tag will always return four other variables:

GetUserGroupsError
A detailed error message. Cumulative. Blank if no error. DO NOT TRUST ANY DATA RETURNED IF THERE ARE ANY ERRORS.
GetUserGroupsDescription
This is a general description of the tag.
GetUserGroupsVersion
This tells you the major/minor version as well as the release quality.
GetUserGroupsSeconds
The number of seconds the tag was processing.

top

BUGS or FEATURES?

Is it a bug or is it a feature? You tell us.

If you think you've discovered a blatant bug, or if the configuration of your servers is such that the tag is incorrectly handling your system, feel free to send copies of the html results for the all the examples pages or any page you have written for your site using this tag.

Send results to ihtk@intrafoundation.com.

Updates to the tag will be made ASAP.

I am also interested in seeing the results of the examples pages using this tag even if it works. And, I'm interested in comments on making a more useful examples pages.


top

VERSION HISTORY

[Fluffer the fuzzy footed - Rest In Catnip, Fluffer]



top
f i n i
-{ts '2001-12-03 03:35:35'} /ihtkdocs/GetUserGroups/index.cfm-