226

(9 replies, posted in General)

asawyer13 wrote:

If I do this on the OnClick event, I believe I get the right info.

Will test some more

My Bad. I wasn't on my mind when I suggest that. LMAO, I updated my first reply. Stick to OnAfterClick event for it must be saved first. Anyway, I think derek's solutions is an awesome solution. Having many fields to check will require you to add additional components but I think it is the best solution. Anyway, if you really want to have it on after click even the user didn't change any record, here I modified derek's solution.

227

(9 replies, posted in General)

asawyer13 wrote:

Derek,
If I don't want to go to the work of adding extra fields to tell if the actual values have changed, and just want to update modified date if they click save, but only if it's not a new record, how could I do this?

procedure frmMedications_Button5_OnAfterClick (Sender: TObject);
begin
        If Action <> 'NewRecord'  then
        Begin
            SQLExecute('Update Medications set ModifiedDate = CurDate() Where ID = ' + frmPerson.tablegrid1.sqlvalue );
        End;
end;

I tried this but either have a typo or something in it.

I can think of 2 solutions:
1. Have a global boolean variable e.g. IsANewRecord and set its value on the OnShow of frmMedications

IsANewRecord = (Action = 'NewRecord');

2. Set frmMedications.Tag in the OnShow of the form

if Action = 'NewRecord' then
    frmMedications.Tag = 0
else
    frmMedications.Tag = 1;

Then, change

If Action <> 'NewRecord'  then

to
case 1:

if Not IsANewRecord then

case 2:

if frmMedications.Tag=1 then

228

(3 replies, posted in General)

The main block of any module, i.e. program, unit or library, has to be closed with an end “dot”:

It can be seen as an adoption of natural (written) languages, where a full stop marks an end of a sentence.

Anything else after the final end., assuming syntactical correctness, will be ignored by the compiler.

https://wiki.freepascal.org/period

229

(187 replies, posted in General)

Good Day MVD Devs.

I got an idea on the password being implemented in User-Role feature. I successfully determined the hash being used in it and will help me in my future development when I have to reset user's password, have an auto-generated password etc. But for the other developer who doesn't know how that password is being hashed/encrypt will bump to a dead-end. I think it is much better to encrypt the password using the EcryptRC5 Function and let the Key disclosed/editable to the developer or make it as a property or a setting something like that. In that way, it is more secure for the password and less hassle for the developer.

Thank you and looking forward for the next update. Please do notice us. smile

230

(26 replies, posted in Script)

Have you tried the search feature of MVD? Searching it by code can be done but will require you additional code in populating the Grid so I suggest you use the search of MVD

231

(7 replies, posted in General)

ehwagner wrote:

Derek, Alan,

Or you could use one line of code to retrieve the record without going through a tablegrid. See attached.

I'm about to do something like this. Anyway. if you already have that frmUser form. You can open it and change Form1

frmUser.ShowRecord('_user', Application.User.id); // current logged on user

232

(30 replies, posted in General)

asawyer13 wrote:

Thanks
In this case the Change Password form is hidden so I don't know the names of the edit fields.

But yes, if I had that info, I could use your technique.

Alan

//Showmessage(frmdbCoreUserChangePassword.Components[3].Name);
frmdbCoreUserChangePassword.edCurrentPassword.PasswordChar := '*' ;
frmdbCoreUserChangePassword.edNewPassword.PasswordChar := '*' ;
frmdbCoreUserChangePassword.edConfirmPassword.PasswordChar := '*' ;

233

(30 replies, posted in General)

asawyer13 wrote:

I appreciate it.

I sent it. check it on your spam

234

(30 replies, posted in General)

asawyer13 wrote:

Hopefully MVD Dev will read this and have a solution.

Even disabling the encryption would be better than not being able to use it.

Alan

I got on how the password is being hashed. I just don't know if it is proper to post I here. smile I'll email it to you

235

(30 replies, posted in General)

asawyer13 wrote:

I have confirmed that MVD must be using some sort of salt to create the passwords.

I added two users thru the app with the same password and when it stores it in the database, they are different.

This sort of messes up any idea that I can think of to do a reset or forgotten password.

HELP....

Thanks
Alan

Oh Sorry. I remembered that I already tried copying a password from one user to another and it really didn't work so the 1234 password is not possible on the current User-Role function of MVD. My bad. Well, you will have to wait for MVD dev to disclose on how the password really works then or have your own User-Role Feature. I think the Dev used/added the Username on encrypting the password of the user that's why it is different, so you can also use it in your Custom User-Role.

236

(2 replies, posted in General)

Here. I made a sample to give you an idea. That's one way I can think about. You can add a module or form to update the record limit of the user.

237

(47 replies, posted in Script)

As for the registration, auto-generated password cannot be done for now if you are using the MVD User-Role feature. Only MVD Dev knows the password hash key being used. I hope it gets the attention of the Dev for it seems that there are couple of topics looking for something like that.

238

(47 replies, posted in Script)

Here. I got something for you. I added a re-usable function Confirm at the end of the script.

239

(1 replies, posted in Script)

var yr: String = FormatDateTime('yyyy',Now);

240

(30 replies, posted in General)

asawyer13 wrote:

Brian

I like the idea of the 1234 password. I can make that work.

Now if I can find the secret to adding a label that looks like a link to the login page and when the user clicks on it I can show them a forgot password form and then send them the new password.

I think cdb has done something similar but I was not able to get it to work.
If someone would be willing to create a working example that would be fantastic.

Thanks again

Alan

Here, I created an alteration to Login form, hope it helps to start on your program.

241

(30 replies, posted in General)

Good day Alan,

If you are using the user and role feature of MVD, for now, I think it is not possible. Only MVD Dev is the one who knows the key used in that password hash. It's been a while since MVD got an update, but I'm hoping that MVD Dev will make that password hash key available or can be change by the programmers for some various reasons (one is your case). For now I think you can stick to the MVD User and Role. Then,
    a. Wait for an update that will cater what you are looking for.
    b. Or, Have a default password, e.g. "1234", copy it(the hashed password in the database) and save somewhere else. Retrieve, use it to change user's password and give it to the user when they ask for password reset. Then, have a form that will make sure that they change the password. You can add boolean field to __user table to handle the checking if the user changed their password. (If there's an MVD update, you can also update this function)

242

(47 replies, posted in Script)

kofa wrote:

hello all

I would like to ask for new help

I noticed that the first element in combobox is empty, how to change it to  = choose all

excuse me for more questions but i am very happy to learn it

thanks for help

Just uncheck the FirstEmptyItem on the property of the Combobox. See attached picture

243

(47 replies, posted in Script)

Good day. Add form and call the New Record Action on the add button. As for the delete button, I think it is better to just use the Reference Table from Form1 for most of the time, it will fail because of the foreign key. It can be done by script but personally, I wouldn't recommend it.

244

(7 replies, posted in Script)

Maybe this is what you are looking for

form1.label1.caption := Application.User.Role;

Application.User do handle the details of logged in user.

245

(7 replies, posted in Script)

That's nice CDB. From CDB's reply, I think I was able to get the component you are trying to change kees. Here, try this one.

// showmessage(frmdbCoreUserChangePassword.Components[0].Name);
frmdbCoreUserChangePassword.lbCurrentPassword.Caption := 'current:';
frmdbCoreUserChangePassword.lbNewPassword.Caption := 'new:';
frmdbCoreUserChangePassword.lbConfirmPassword.Caption := 'confirm:';

246

(10 replies, posted in General)

Here's another workaround using the Delay on the Getshot

247

(7 replies, posted in Script)

kees.krause wrote:

Hello Brian, thanks very much for your contribution. In my ignorance I just copied the "connection script" to the existing script. I also changed: Form1.TableGrid1.dbUpdate. Now I can also see all records. Thanks again.

Hopefully my question to MVD develeptors (e.g.Dmitry): "how can I translate menu "Change your own password" and translate the upcoming forms", will be answered

You're welcome. Maybe this one is what you are looking for the "Change your own password".

Form1.mniChangePassword.Caption := 'Change password?';

As for the form after that, I have no luck to what is the form name. LMAO. The MVD developer/s can give you an answer to that.

248

(7 replies, posted in Script)

kees.krause wrote:

Hallo Brian. I used thuis script. It dit not work. See my post.

Maybe you didn't comment unnecessary codes. Try to update your credential here. Credentials from mysql.txt can't connect to database.

249

(7 replies, posted in Script)

Check this one.
http://myvisualdatabase.com/forum/viewtopic.php?id=1805

250

(10 replies, posted in General)

You might want to use the script to connect in your server. In that way you can use external file, a hidden label on a hidden form (which I'm using) to read the server details for additional security..
Check this: http://myvisualdatabase.com/forum/viewtopic.php?id=5366