1 (edited by reteinformatica 2023-03-29 18:59:22)

Topic: Login to the program with credentials

Hi everyone,
I have created a project and I would like to enter a username and password to access the program. I first studied the "Small Library software" example project (http://myvisualdatabase.com/database_ex … brary.html) which has this feature.
I was perplexed because the forms, in this project, which manage access via password are not present, none from the one for logging in to those for modifying and creating users and passwords. Yet starting the program there are. I also looked at all the code but there seems to be no trace of this function.

Furthermore, in the "Options" menu of this project there is an additional item to manage users which, however, is not present in a new project.
Then in this project there are these instructions:

procedure Form1_OnShow(Sender: TObject; Action: string);
begin
    Form1.bSearchPerson.Click;
    Form1.bSearchBook.Click;
    Form1.bSearchHistory.Click;
    Form1.bSearchOutdated.Click;
end;

In the control bar there are these buttons Form1.bSearchPeople etc. but even if I select them from the control bar I can't find them anywhere.

Would someone be so kind as to give me some explanation? Thanks and greetings to all.

Re: Login to the program with credentials

Hi Fabio,
1.  The form that asks you for your userid and password is generated by the system as part of MVD's 'role based access' function and so does not show in the list of controls like user designed forms (although it can be accessed by script).
2.  If you have not selected the 'role based access' function, the standard options you see are shown in Screen1 (see attached).
3.  To select 'role based' access', go to the database tables screen and click the 'role based access' option (Screen2).
4.  This automatically creates 2 tables - _role and _user (Screen3).
5.  If you then look at the 'options', you will now see 2 additional items which relate to user maintenance (Screen4).  The 'Change Your Password option is where an individual user changes his password'.  The 'Users' option is where users are created, roles changed etc;  this option is only available to those who are flagged as 'administrators'.
.
With regard to your questions about the 'library' application
1.  Form1 uses the 'page control' function (Screen5);  a 'page control' (highlighted in red) consists of one or many 'tab sheets' (highlighted in blue);  they can be used as a way of logically dividing your business processes.
2.  On each 'tab sheet' in the downloaded 'library' application there is a different 'search button';  for example, the 'persons' 'tab sheet' contains form1.bsearchperson (Screen6), the 'books' 'tab sheet' contains form1.bsearchbook (Screen7) and so on and so on.
Just click on the relevant 'tab sheet' and you will find the buttons you were looking for.
Hope this makes things clearer.
Derek.

Post's attachments

Attachment icon fabio.zip 144.44 kb, 127 downloads since 2023-03-29 

Re: Login to the program with credentials

Hi Derek, it was easier than it looked! Thank you very much, as always you are decisive and clear in your explanations.
Do you think there is a way to at least translate the window labels related to user management?
Thanks so much Derek.

Re: Login to the program with credentials

Hi Fabio,
Have a look at the attached which takes the standard windows menu options and translates the ones you might want, hides the ones you don't want etc.  If you don't use the 'windows menu' you can always achieve the same thing using buttons.
You can also change the basic 'login' screen that comes as standard with MVD (a simple example of the sort of things you can do is in the attachment).
Valid users and passwords are admin/admin, derek/derek and fabio/fabio. 
Note that 'fabio' is not set up as an administrator and therefore does not see the 'utenti' option (the ability to hide / disable any object on any form based on your 'role' is automatic and comes as part of the 'role based access' functionality which is a really powerful feature (although I wonder how extensively it is used, which is a great pity).
Regards,
Derek.

Post's attachments

Attachment icon bespoke login form.zip 743.74 kb, 150 downloads since 2023-03-30 

Re: Login to the program with credentials

Hi Derek, perfect I understood everything, many thanks.
Now I would like to understand if there is a list of names of the forms and controls to translate also the first window with the list of users and the other two, the one for adding the user and the one for modifying the user. Thanks again derek.

Re: Login to the program with credentials

Hi Fabio,
Try using this (see attached - login details are admin / admin).
Any object that begins with 'lb' is a label so all you need to do is change its caption into your language.
Hope this helps,
Derek.

Post's attachments

Attachment icon frmdbcore form components.zip 436.95 kb, 145 downloads since 2023-03-30 

Re: Login to the program with credentials

Thank you Derek, you are always so kind.

Re: Login to the program with credentials

Hi derek, with your scheme I managed to translate all the forms. Thank you so much, you are the best

Re: Login to the program with credentials

Hi Fabio,
In addition to changing all the relevant labels, you might want to change the headings in the 'Users' tablegrid.  To do this, you need to redefine the 'Users' procedure to be able to get access to the form - have a look at the attached which might help (and sorry for the translations - I'm sure they're not quite right!!).
Derek.

Post's attachments

Attachment icon change frmdbcoreusers grid headings.zip 551.92 kb, 139 downloads since 2023-04-01 

10 (edited by reteinformatica 2023-04-01 09:29:09)

Re: Login to the program with credentials

Hi Derek, you are a seer! I would have asked you. Don't worry about the translations, you've done too much too. I Translated the TableGrid too. Thank you!