Inheritance diagram for IUserDatabase:
The user database is the database inside the reader that holds all card information, user names, valid periods, usergroup etc. Depending on the filesystem (see IProximityReader::SetFileSystem), the following items are stored in this database:
The number of users that the user database can hold also depends on the selected filesystem (see IProximityReader::SetFileSystem) of the reader. Use the Size property to determine the maximum number of users for the current filesystem.
The users can be retrieved from the database using the CollectUsers method. When this method is finished, the entire collection of users can be retrieved using the Users property. It is possible to collect the users asynchronously using a flag in the CollectUsers method. The IsCollectingUsers property can then be used to check if the asynchronous process has finished collecting all users. The asynchronous collect process can be canceled using the CancelCollectingUsers method. Note that while collecting users, events are fired that can be used to show the progress or perform other tasks (see the CollectUsers method for detailed information).
The FindUser method is a simplified method to retrieve a single user.
To edit an existing user, simply modify the IUser object and call the IUser::Save method. Adding a new user can be done by first creating a new IUser object using the CreateUser method. Fill in the user details on the returned IUser object, call the IUser::Save method.
When saving a newly created user who's ID is already inside the user database, the existing user's information will be overwritten with the new information. All IDs in the user database are unique.
The adding, removing and changing of all users in the user database can be monitored using the general events of processtype ptUserdatabaseChange. When a new user is added to the user database, or users are collected for the first time, an OnProcessInfo event of processtype ptUserdatabaseChange is fired with the sptItemAdded sub process type. If a existing user is modified, the sub process type will be sptItemModified. If a user is removed, the sub process type will be sptItemRemoved. The Info argument of all those events will contain the related user object (IUser).
The user database also contains advanced search facilities to search users. Users can be search by id, (or part of) a name or a range of levels (for instance: search all AddMasters).
All users currently in the database can be saved to disk using the IXMLBase::Download method. It is also possible to upload a previously saved file into the reader using the IXMLBase::Upload method. The user data can be saved to an HTML file, XML file or to a comma separated file (.CSV). These .CSV files can be easily imported and exported into/from Excel.
For more information about methods and properties, see the detailed sections of each method and property.
Public Member Functions | |
HRESULT | Reader ([out, retval] IProximityReader **ppintfReader) |
Returns the reader this user database belongs to. | |
HRESULT | Count ([out, retval] long *plCount) |
Retrieves the number of users currently in the reader's user database. | |
HRESULT | Size ([out, retval] long *plSize) |
Retrieve the total number of users that can be stored in the user database. | |
HRESULT | IsEmpty ([out, retval] VARIANT_BOOL *pfEmpty) |
Returns true if the userdatabase is empty. | |
HRESULT | Configuration ([out, retval] EUserConfiguration *peConfiguration) |
Retrieves the user configuration of the database. | |
HRESULT | CollectUsers ([in, defaultvalue(0)] VARIANT_BOOL CollectAsync,[in, defaultvalue(ulNormalUser)] EUserLevel LowLevel,[in, defaultvalue(ulInstallerProgrammer)] EUserLevel HighLevel,[in, defaultvalue(1)] VARIANT_BOOL fDisableRFID,[out, retval] long *plUsers) |
Collect all users. | |
HRESULT | IsCollectingUsers ([out, retval] ECollectingStatus *peStatus) |
Returns the status of the asynchronous user collecting process. | |
HRESULT | CancelCollectingUsers () |
Cancel an asynchronous collection process that is currently in progress. | |
HRESULT | Users ([out, retval] ICollection **ppintfUsers) |
Returns the internal collection of all users. | |
HRESULT | Users ([in] ICollection *pintfUsers) |
Adds new users into this reader. | |
HRESULT | CreateUser ([out, retval] IUser **ppintfUser) |
Create a new user object. | |
HRESULT | Remove ([in] ECardType ECardType,[in] BSTR bstrCardNumber,[in, defaultvalue("")] BSTR bstrFacility,[in, defaultvalue(0xffff)] VARIANT_BOOL fDisableRFID,[out, retval] VARIANT_BOOL *pfSucceeded) |
Remove a user from the userdatabase. | |
HRESULT | Clear ([in, defaultvalue(0)] VARIANT_BOOL ClearAsync,[in, defaultvalue(1)] VARIANT_BOOL fDisableRFID) |
Remove all users from the user database. | |
HRESULT | RemoveExpiredUsers ([in, defaultvalue(0)] VARIANT_BOOL ClearAsync,[in, defaultvalue(1)] VARIANT_BOOL fDisableRFID) |
Remove all expired users from the user database. | |
HRESULT | FindUser ([in] ECardType CardType,[in] BSTR bstrCardNumber,[in, defaultvalue("")] BSTR bstrFacility,[out, retval] IUser **ppintfUser) |
Search for a particular user, if found, returns the found user object. | |
HRESULT | SearchUsers ([in] ESearchFlags eFlags,[in] VARIANT User,[in, defaultvalue(0)] VARIANT LevelRange,[in, defaultvalue(0)] VARIANT Reserved1,[in, defaultvalue(0)] VARIANT Reserved2,[in, defaultvalue(1)] VARIANT_BOOL fDisableRFID,[out, retval] VARIANT_BOOL *pfSucceeded) |
Search a specific user or users that match certain search criteria. | |
HRESULT | CancelSearch () |
Cancel a search process that is currently in progress. | |
HRESULT | SearchResults ([out, retval] ICollection **ppintfResults) |
Return the internal collection of all search results. | |
HRESULT | SearchStatus ([out, retval] ESearchStatus *peStatus) |
Return the status of the search process. | |
HRESULT | ClearSearchResults ([out, retval] VARIANT_BOOL *pfSucceeded) |
Clears the last search results. | |
HRESULT | GetSearchResults ([in] ESearchFlags eFlags,[out, retval] ICollection **ppintfResults) |
Returns an internal collection of searched results. | |
HRESULT | UserGroups ([out, retval] ICollection **ppintfUserGroups) |
Returns a collecting of all usergroups. | |
HRESULT | CreateUserGroup ([out, retval] IUserGroup **ppintfUserGroup) |
Create a new user group object. | |
HRESULT | RemoveUserGroup ([in] IUserGroup *pintfUserGroup) |
Remove an existing user group. | |
HRESULT | FindUserGroup ([in] long lID,[out, retval] IUserGroup **ppintfUserGroup) |
Return a user group with the specific ID. |
|
Returns the reader this user database belongs to.
|
|
Retrieves the number of users currently in the reader's user database.
|
|
Retrieve the total number of users that can be stored in the user database. The size returned here is a mimimum size. Due to variance in memory requirements for user objects, more users then returned by this method might be added to the userdatabase.
|
|
Returns true if the userdatabase is empty.
|
|
Retrieves the user configuration of the database. This method can be used to check whether the current filesystem supports a user database with IDs and/or PinCodes and/or Names, etc.
|
|
Collect all users. This method creates an internal collection with all users currently available in this reader and returns the number of found users. To get the collection, use the Users property. A collection with all users is created. This collection is cached internally for future use. Only users that have a userlevel between eLowLevel and eHighLevel are added to the collection. It is possible to collect the users asynchronously using a fCollectAsync flag. The IsCollectingUsers property can be used to check if the process has finished collecting all users. The collect process can be canceled using the CancelCollectingUsers method. All default events (including progress events) of processtype ptCollectingUsers or fired by this method. When a new user is collected, the OnProcessInfo will be fired with the sptItemFound sub process type. The found IUser object is passed in the Info argument.
|
|
Returns the status of the asynchronous user collecting process.
|
|
Cancel an asynchronous collection process that is currently in progress.
|
|
Returns the internal collection of all users. If the CollectUsers method is not yet called, this property will fail. So please call the CollectUsers method first before calling this property.
|
|
Adds new users into this reader. If a user from the new user collection is not found in this reader, it is added to this reader. If the CollectUsers method has been called before this method, and a user with the same ID is already in the userdatabase, all values of this existing user will be overwritten with the new values (name, userlevel and pincode). An OnProcessInfo event of processtype ptUserdatabaseChange and sub process type sptItemModified will then be generated. If the CollectUsers has not yet been called, the new user data is simply passed to the reader. An OnProcessInfo event of processtype ptUserdatabaseChange and sub process type sptItemAdded will then be generated for every succesfully stored user (even if the user is already in the reader's userdatabase!). Events of processtype ptSettingUsers are fired by this method including progress events.
|
|
Create a new user object. When adding a new user, use this method to create a new user object, then set all properties of the user object and finally call the IUser::Save method. If the users are already collected, using the CollectUsers method, and the ID of the new user is already present in the user database, a modified event of type ptUserdatabaseChange will be generated instead of an added event. See IUser::Save for more information.
|
|
Remove a user from the userdatabase. If the users are already collected using the CollectUsers method and the specified user cannot be found, the user cannot be removed and the pfSucceeded flag will be set to false. If the user is found, the user will be removed from both the reader and the internal collection. When a specific user is removed, the OnProcessInfo of processtype ptUserdatabaseChange is fired with sptItemRemoved sub process. The Info argument will receive a copy of the user that has just been removed.
|
|
Remove all users from the user database. This method clears the entire user database in the reader (as well as this object's cached collection). Since this can be a very long operation, it can be executed asynchronously (in the background). All normal events of processtype ptClearingUsers are fired by this method including progress events.
|
|
Remove all expired users from the user database. Clears the entire user database of all expired users. Expired users are users who's valid period has expired, see IUser::SetValidPeriod for more information. All normal events of processtype ptClearingUsers are fired by this method including progress events.
|
|
Search for a particular user, if found, returns the found user object. When there is already an internal cached user collection (when the CollectUsers method is already called), this method will first try to find the requested user in the internal collection. If it is found in the collection, it will be returned. If not the requested user will be retrieved from the reader itself (if the user exists) and added to the internal collection. When a new user is found that is not yet part of the internal collection, the OnProcessInfo of processtype ptUserdatabase is fired with sub process type sptItemAdded. The newly added user is passed in the Info parameter.
|
|
Search a specific user or users that match certain search criteria. Perform a search operation on the user database. A collection with all search results can be retrieved using the SearchResults property. When the sfSearchAsync is set in the eFlags argument, the search is performed asynchronously (in the background). To get the status of the pending asynchronous search process, use the SearchStatus property. It will be set to ssUsersSearched when the search operation is complete. It is then possible to get the search results using the SearchResults property. Cancel a pending search process by calling the CancelSearch method. Note that the last search results will be cached inside this object. To clear the last search results of this userdatabase, use the ClearSearchResults method or specify the sfClearResults flag when searching again. It is possible to search users using different search criteria:
Note that all arguments are optional, you do not have to provide them (for C++ programmers, simply set the VARIANT to VT_EMPTY). Only the arguments that are provided will influence the search results.
|
|
Cancel a search process that is currently in progress.
|
|
Return the internal collection of all search results. Only returns valid data when this reader is finished searching. Check the search status of this reader using the SearchStatus property before calling this method.
|
|
Return the status of the search process. When searching, this property will return ssSearchingUsers. When ready searching ssUsersSearched will be returned. When no search operation has been started yet, the ssNoSearchResults is returned.
|
|
Clears the last search results.
|
|
Returns an internal collection of searched results. Only returns valid data when this reader is finished searching. Check the search status of this reader using the SearchStatus property. This API is able to cache two collections of search results. When specifying the sfSearchResults2 flag when calling SearchUsers, the search results will be placed in the secondary internally cached collection. This method can be used to retrieve both the first and second search results collections whereas the SearchResults property can only be used to retrieve the first search results. This method returns a copy of one of two internally cached collection of search results.
|
|
Returns a collecting of all usergroups. When this method is called for the first time, it will collect all usergroups from the reader and return a collection with all usergroups. This collection will be cached internally and returned when this method is called again. When the user groups are collected from the reader, all normal events of processtype ptCollectingUserGroups are fired. For every found user group, the OnProcessInfo event is fired, with the sptItemFound sub process type, the Info argument contains the found user group. This method will also fire progress events. Since a reader can hold only 16 user groups, only 16 progress events will be fired.
|
|
Create a new user group object. When adding a new user group, use this method to create a new user group object, then set all properties of the user group object and finally call the IUserGroup::Save method. If the usergroups have already been collected, using the UserGroups method, and the ID of the new user group is already present in the user database, the user group will be modified. See IUserGroup::Save for more information.
|
|
Remove an existing user group. This method removes a specific user group.
|
|
Return a user group with the specific ID. This method starts by searching the specified ID in the internal cached collection of user groups. If it cannot find the specified user group in this collection (or when the collection does not exists), it will search for the user group inside the reader. If the user group is found in the reader, it will be added to the internal collection. If the user group is not found, an empty (null) object will be returned and the return code of this method will be set to 1 (S_FALSE).
|