#1  
Old 6th June 2014, 01:07 AM
Holger Franke
 
Posts: n/a
Default TnxSecurityMonitor::AddUser - Replacement

Hello,

I migrate my application from nx 2.07 to 3.1203.
Upgrading my own secure server, I've notified, that the function
TnxSecurityMonitor::AddUser is not more available.
It seems there is a new Admin login, which is able to create new users.
Does anybody has a code-snip in C++, to create a new login?
This would be very helpful.

Best regards, Holger

Btw. How can I change the Admin - password?
  #2  
Old 6th June 2014, 08:01 PM
Holger Franke
 
Posts: n/a
Default Re: TnxSecurityMonitor::AddUser - Replacement

***Update***
I've found a Delphi example in server source code, but unfortunately it
don`t works beneath C++ Builder.

In Delphi it is possible to create a variable of type InxLoggedInUser31000:

var
User : InxLoggedInUser31000;

If I do the same in C++:

InxLoggedInUser31000 User;

I get the following error messages from the compiler (translated from
German):

[BCC32 Error] ServerDM.cpp(480): E2352 Could not create instance of
abstract class 'InxLoggedInUser31000'

[BCC32 Error] ServerDM.cpp(480): E2353 Class 'InxLoggedInUser31000' is
abstract, because '_fastcall InxLoggedInUser31000::GetUserNameW() = 0'

Any hints or workarounds how to solve this?
Best regards, Holger
  #3  
Old 6th June 2014, 10:52 PM
Thorsten Engler [NDA]
 
Posts: n/a
Default Re: TnxSecurityMonitor::AddUser - Replacement

While I don't know the exact syntax in C++, you shouldn't try to create a stack
backed instance of the "class" (it's actually an interface, which is a pure
virtual "class"). You should define a pointer to an instance of the class.

Holger Franke wrote:

> Update
> I've found a Delphi example in server source code, but unfortunately it don`t
> works beneath C++ Builder.
>
> In Delphi it is possible to create a variable of type InxLoggedInUser31000:
>
> var
> User : InxLoggedInUser31000;
>
> If I do the same in C++:
>
> InxLoggedInUser31000 User;
>
> I get the following error messages from the compiler (translated from German):
>
> [BCC32 Error] ServerDM.cpp(480): E2352 Could not create instance of abstract
> class 'InxLoggedInUser31000'
>
> [BCC32 Error] ServerDM.cpp(480): E2353 Class 'InxLoggedInUser31000' is
> abstract, because '_fastcall InxLoggedInUser31000::GetUserNameW() = 0'
>
> Any hints or workarounds how to solve this?
> Best regards, Holger


  #4  
Old 7th June 2014, 12:32 AM
Holger Franke
 
Posts: n/a
Default Re: TnxSecurityMonitor::AddUser - Replacement

Hello Thorsten,

many thanks for your quick help. It works on my side.

For other users, here is the code:

_di_InxLoggedInUser31000 LoggedInUser =
SecurityMonitor->LogIn("Administrator", "NexusDB");

String UserName = LoggedInUser->UserName;
bool IsUser = LoggedInUser->IsUser;
bool IsAdmin = LoggedInUser->IsAdmin;
if (IsAdmin) {
_di_InxLoggedInAdministrator31000 LoggedInAdmin = LoggedInUser;
LoggedInAdmin->AddUser("Name", "PWD", false, true, true);
TnxUnicodeStrings UserList = LoggedInAdmin->UserList();
...
}

Best regards, I wish you a great Pentecost weekend.
Holger


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
/ADDUSER problem David Rose nexusdb.public.support 4 14th March 2014 10:07 PM
tnxSecurityMonitor.addUser v3.1004 d7 nick nexusdb.public.support 2 20th August 2012 04:29 PM
Replacement Orpheus components Brian Robinson nexusdb.public.discussions 8 18th March 2009 06:34 AM
OT TxQuery Replacement Shane Stump nexusdb.public.discussions 0 17th May 2007 04:34 AM
Linux replacement for Delphi? ron schultz nexusdb.public.discussions 16 21st April 2004 04:54 AM


All times are GMT +11. The time now is 04:17 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.