info@toolsandcomps.com
Phone: 55 (27) 3389 1138

CodeGear - Where Developers Matter

 

 

Tools&Comps
1999-2007

F.A.Q.

TUsers v2.x Frequently Asked Questions

Q: How do I change the master password?

A: The master user can change his password as a normal user. Login in the application as master and execute the method ChangeUserPassword

Q: I have my forms in separated DLLs, which are called from a main application. How to setup TUsers so I can protect my forms with it?

A: There is a small trick to solve this problem:

1. Open the DLL project
2. Drop TUsersReg into your DLL form
3. Open the main form of the project which will call your DLL form. This is the form where TUsers is located
4. Go to the TUsersReg and type manually the referecence to TUsers in the other form. Ex: frmMain->Users1
5. Double click TUsersReg to register the components you want into Tusers
6. Go to the form where TUsers is located and double-click it. You should see the DLL form in the Form List.
7. Save all and build the DLL project.
8. Build the main project and run it. The Form into the DLL will appear in the Form List (user adm)

Q: When I click in the property ComponentList of TUsersReg, in order to activate the Component Registration Form, it shows the TStringList editor. What I'm doing wrong?

A: It usually happens because the package users_ide.dpk is not properly installed. You can go to the menu item Components|Install Packages and click in the Add button, then choose the users_ide package from the TUsers directory so the package will be installed again.

Q: Can I use my own login form?

A: Yes. You need to write code to the OnLogin event. Collect user name and password and pass these values to the parameters of the event. Take a look at the CustomLogin sample for a better explanation on how to write your own login form.

Q: How do I have access to the current user information, as for example, the user profile?

A: You can use the property CurrentUser (from TUsers). You can get the user name, profile, user id and other user information.

Q: I Have three applications in a same enviroment . Will I need a security database for each application or can I use the same security database for all of them?

A: You can use the same security database for all your applications. You just will need the TUsers component in each one of them pointing to the same database and set a different value for the property AppKey for each one.

Q: I Have a main application that activates other applications through ShellExecute. How do I do so that my user doesn't have to type your login and your password again, since he is already using the main application ?

A: You can execute your other applications passing user name and password as parameters for those applications, as below:

WinExec(PChar(ExtractFilePath(Application.ExeName)+'SecondApp.EXE ' + Users1.CurrentUser.UserName + ' ' + Users1.CurrentUser.Password),SW_SHOW);

Then, write code for the event OnLogin of TUsers, passing user name and password received as command line parameters for the parameters of the event.

procedure TForm1.Users1Login(var UserName, Password: String;
var ModalResult: TModalResult);
begin
' UserName:=ParamStr(1);
' Password:=ParamStr(2);
' ModalResult:=MrOk;
end;

 

 

devhost - webhosting para desenvolvedores delphi - isapi/intraweb/asp.net/interbase