Jump to content
Salesforce and other SMB Solutions are coming soon. ×

How IWP users can change their password?


lenosane
 Share

Recommended Posts

My application has 4 users.I want that the users can change their own password via IWP Interface.I tried to make a Layout with: "Old Password", "New Password", "Confirm New password" and a button with script :

 

if[table::newpass=table::confirmnewpass]

Change Password[Old Password: table::oldpass; New password: table::newpass;No dialog]

Insert Text[select,table::passStatus;"Password changed with sucess"

Eles

Insert Text[select,table::passStatus;"The Confirm Password is wrong"

 

 

But this script is not good,it's wrong....anyone have any ideia?

Sorry for the english,

Thank you!

Link to comment
Share on other sites

Can you provide more details about the ways in which your script "is not good, it's wrong"? Does it always result in "The confirm password is wrong", or does it report that it changed pw successfully but when you try to log in you find that the old password, not the new one, is valid? Does it throw error messages of some sort?

 

 

I mean, I suppose I could build a test file replicating your script and find out for myself, but I might make assumptions about your setup that aren't accurate; better if you provide as many details as possible yourself.

 

I assume you did examine the privileges pertaining to the account name you're using when you test this, to make sure the checkbox "Allow user to modify their own password" is checked?

Link to comment
Share on other sites

Can you provide more details about the ways in which your script "is not good, it's wrong"? Does it always result in "The confirm password is wrong", or does it report that it changed pw successfully but when you try to log in you find that the old password, not the new one, is valid? Does it throw error messages of some sort?

 

 

I mean, I suppose I could build a test file replicating your script and find out for myself, but I might make assumptions about your setup that aren't accurate; better if you provide as many details as possible yourself.

 

I assume you did examine the privileges pertaining to the account name you're using when you test this, to make sure the checkbox "Allow user to modify their own password" is checked?

 

Thank you for the help first.

But all users in this moment have Full-Access, so in fact i can change the password without problems.But i don't know how to give a warning in "passStatus" if the Old Password is wrong.

And now i have to create a record every time user changes de pass,other problem is how can i make a Password Box(The password is appearing as user types it) ?

Link to comment
Share on other sites

I'm not sure I followed all of that (I sure don't see why you'd need to create a new record every time the user logs on unless you're intentionally keeping a log file showing who logged on when from what workstation with what privs, etc etc).... but hang on a mo...

 

OK, here's the relevant fragment of a logon script I like to use in my solutions. (If users want to change their PW they have to do it in the course of logging into the system). See if you can cannibalize it or draw ideas from it. I've annotated it a bit to hopefully make it self-explanatory.

Link to comment
Share on other sites

I'm not sure I followed all of that (I sure don't see why you'd need to create a new record every time the user logs on unless you're intentionally keeping a log file showing who logged on when from what workstation with what privs, etc etc).... but hang on a mo...

 

OK, here's the relevant fragment of a logon script I like to use in my solutions. (If users want to change their PW they have to do it in the course of logging into the system). See if you can cannibalize it or draw ideas from it. I've annotated it a bit to hopefully make it self-explanatory.

 

Sorry, i'm new in FM8 and in this forum...do i have to pay 23$/year do download files in this forum?I'm from Brazil and my english i not too good.I don't know if that it's possible but it's allowed to send the file to my e-mail: lenosane@gmail.com ???

Thank you,

Leandro

Link to comment
Share on other sites

OK... i'm not going to do this every time

 

I assume Ahunter does not mind

 

btw smilies can be disabled, i did so for your first post

 

kjoe

 

screenshot of the attachment posted by Ahunter:

 

scriptahunter.jpg

Link to comment
Share on other sites

Sorry, i'm new in FM8 and in this forum...do i have to pay 23$/year do download files in this forum?I'm from Brazil and my english i not too good.I don't know if that it's possible but it's allowed to send the file to my e-mail: lenosane@gmail.com ???

Thank you,

Leandro

 

 

I've try to put your code in my script,but not work too,when i press "Save"(Name of my button script) nothing happens.

 

In "Change Password" layout i have 4 global text fields: "CurrentUser", "OldPass","NewPass" and "ConfirmNewPass" and also a button called "Save"

I've put your script in the "Save" button and make the changes necessary to run in my Application.But the script does not worked.

 

Sorry, i don't know why the script is not working

Thank you for the patience...

Link to comment
Share on other sites

Can you print out your script as PDF and email it to me? (ahunter3@earthlink.net).

 

Literally "nothing happens"? No dialog at all pops up, no error message, no change in the password, nothing?

Link to comment
Share on other sites

Can you print out your script as PDF and email it to me? (ahunter3@earthlink.net).

 

Literally "nothing happens"? No dialog at all pops up, no error message, no change in the password, nothing?

 

I've sent to you a e-mail with the FM file,have you received?

Thank you!

Link to comment
Share on other sites

No, oddly enough.

 

I do have really formidable spam filters but they're all client-side (i.e. local to my machine) and I do check my trash. Didn't see anything likely in the trash.

 

Can you send again, with "filemaker" mentioned in the subject line?

Link to comment
Share on other sites

No, oddly enough.

 

I do have really formidable spam filters but they're all client-side (i.e. local to my machine) and I do check my trash. Didn't see anything likely in the trash.

 

Can you send again, with "filemaker" mentioned in the subject line?

 

Okay,no problem i've sent it again...it's a example of what i want to do in my project,if you could give a look is this FM file i will really aprecciate.And i'm not sending the project it self because it's all in portuguese.

Thank you a lot!

Link to comment
Share on other sites

Got it. I won't be able to look at it until tomorrow. I will post a copy so that others who can download files can also take a peek and advise you as need be.

Link to comment
Share on other sites

Got it. I won't be able to look at it until tomorrow. I will post a copy so that others who can download files can also take a peek and advise you as need be.

 

Ohh no problem!!!I'm really pleased for the attention. smiley-smile smiley-smile smiley-smile

 

Thank you again!

Link to comment
Share on other sites

Sorry, I forgot all about this

 

Opps!

 

 

OK, here's your diagnosis:

 

• You didn't set the global fields to blank. In a local file that means the last set of Old, New and New Confirm password global values are still going to be in there.

 

• You left in my routine for making sure the Account Name matches a record in the table for all non-Admin users. That's not necessary, unless you want to prevent anyone non-administrative from logging in unless their name is in the table of users and user info, but if you're going to do it, you need to have a relationship between global field CurrentUser and local field User Name (you didn't) and you need the Go to Related Record script step after you've set CurrentUser to Get(AccountName), which you didn't have.

 

• You left in my trap for active modifier keys. My script was a login script that had, printed on the screen users would be looking at, the instruction that if they wanted to change their password, hold down the alt or option key. In your case, changing the password is the whole purpose, so there's no real reason for only running the change-password routine if the mod key is held down. I bet this is why "nothing happened" —*you didn't hold down any modifier key (there being no message on screen telling you to) and the script essentially didn't do anything visible without option/alt being held down.

 

• Your dialog has the message part, but not the Allow Field Entry part. So the instructions would come up telling the user to type in old & new passwords, but didn't give them anywhere to put it!

 

• You didn't trap for activemessagechoice = 2, yet you had a Cancel button in the dialog. Nice to give someone a chance to bail if they change their minds, yes? Hmm, looks like the script fragment I handed you as a template didn't put in a Cancel either, so I'll take the blame for that one.

 

 

 

Here is the file with the edits. Should work now. password for account "Admin" is currently "hello".

Link to comment
Share on other sites

It's exactly what i want,it's working wonderfull,but how can i run it in a WebInterface(IWP)?I've tried to create a text field and put the the OldPass,NewPass and ConfirmNewPass in the layout but doesn't work...you have used "Message Dialog" it's excelent in FileMaker but in the Web inerface it's doesn't supported.

 

Sorry again for all this worknad for my english Opps! ,i'm really trying to solve too!

Thank you!

 

Sorry, I forgot all about this

 

Opps!

 

 

OK, here's your diagnosis:

 

• You didn't set the global fields to blank. In a local file that means the last set of Old, New and New Confirm password global values are still going to be in there.

 

• You left in my routine for making sure the Account Name matches a record in the table for all non-Admin users. That's not necessary, unless you want to prevent anyone non-administrative from logging in unless their name is in the table of users and user info, but if you're going to do it, you need to have a relationship between global field CurrentUser and local field User Name (you didn't) and you need the Go to Related Record script step after you've set CurrentUser to Get(AccountName), which you didn't have.

 

• You left in my trap for active modifier keys. My script was a login script that had, printed on the screen users would be looking at, the instruction that if they wanted to change their password, hold down the alt or option key. In your case, changing the password is the whole purpose, so there's no real reason for only running the change-password routine if the mod key is held down. I bet this is why "nothing happened" —*you didn't hold down any modifier key (there being no message on screen telling you to) and the script essentially didn't do anything visible without option/alt being held down.

 

• Your dialog has the message part, but not the Allow Field Entry part. So the instructions would come up telling the user to type in old & new passwords, but didn't give them anywhere to put it!

 

• You didn't trap for activemessagechoice = 2, yet you had a Cancel button in the dialog. Nice to give someone a chance to bail if they change their minds, yes? Hmm, looks like the script fragment I handed you as a template didn't put in a Cancel either, so I'll take the blame for that one.

 

 

 

Here is the file with the edits. Should work now. password for account "Admin" is currently "hello".

Link to comment
Share on other sites

In a web interface you cannot use Show Custom Dialog, so you'd have to have a layout with the actual fields on it. Off the top of my head, I can't htink of any other function in that script that's not web-compatible, but the way to tell is to check the little checkbox at the bottom of the script window, where it says "indicate web compatibility". The web-incompatible script steps show ina different color (light grey, I think?). Admittedly there may be a few routines that aren't quite as web-compatible as FileMaker indicates they are: a recent thread referred to Pause [specified number of seconds] and said that via the web it behaves like Pause [indefinitely]. So experiment: open a browser and point it to localhost and see how it looks in a web browser.

Link to comment
Share on other sites

Close file [ ] is also not web compatible.

You can test if the user is logging in using a browser using

patterncount(get(applicationversion);"web")

 

see here

 

btw shouldn't it be

 

if[Example::Username?Get(AccountNaam) OR not PatternCount(Get(NaamPrivilegeset); "Full Access")]

 

instead of AND?

 

Also, from the KB:

Allow User Abort- Determines how unsupported script steps are handled. Enable to stop scripts from continuing, and disable to skip over unsupported steps.

 

Set Error Capture- This is always enabled with Instant Web Publishing, and prevents web users from aborting scripts.

 

 

 

kjoe

Link to comment
Share on other sites

btw shouldn't it be

 

if[Example::Username?Get(AccountNaam) OR not PatternCount(Get(NaamPrivilegeset); "Full Access")]

 

 

That ? should be a ≠. The ideas is that either the user is the developer (who might need access even if someone for some reason deleted his/her User record or something) or the user is not the developer (doesn't have full privs) in which case they are required to have a User record. I dunno whether lenosane has reason to care about that, it happened to be a requirement I made on the script I posted for cannibalizing. lenosane left it in.

 

The Get(ApplicationVersion) test for "web" is a good idea; even in places where you could just write a web-compatible version and use it for the local FileMaker users as well, sooner or later you're going to want a feature that will only be possible for the native-FmPro folks.

Link to comment
Share on other sites

In a web interface you cannot use Show Custom Dialog, so you'd have to have a layout with the actual fields on it. Off the top of my head, I can't htink of any other function in that script that's not web-compatible, but the way to tell is to check the little checkbox at the bottom of the script window, where it says "indicate web compatibility". The web-incompatible script steps show ina different color (light grey, I think?). Admittedly there may be a few routines that aren't quite as web-compatible as FileMaker indicates they are: a recent thread referred to Pause [specified number of seconds] and said that via the web it behaves like Pause [indefinitely]. So experiment: open a browser and point it to localhost and see how it looks in a web browser.

 

I've created a "PassChange" Layout and a "Status" field.I have tried to put "Insert Text Fields" in the place of "Show Custom Dialog".When i press "ChangePass" the script stops in the "loop".Just for test i've tried to left only "Example::NewPass = Example::ConfirmNewPass" in "Exit Loop if"...but the script stops in the last "else", the Status field said "OK, you've got a new password now.... " but actually the script doesn't change the password....

It's intrigant because the same script in working with the "Show Custom Dialog" but not working when i tried to change it

Link to comment
Share on other sites

a) I'd use Set Field, not Insert Text

 

b) A Custom Dialog continues when the user presses a button. You'll need a button the layout that the user clicks to continue the script (a Resume Script), and another button to halt the current script and take the user to a friendly layout.

 

c) You need a dialog field to set to the value that would have been in the Custom Dialog. A big old global text field will work fine.

 

d) Showing a Custom Dialog automatically pauses the script while the user reads the dialog, and it stays paused until the user clicks a button. You'll have to insert "Pause [indefinitely]" script steps at every point after youv'e assessed field contents and/or changed the dialog, or there's no opportunity for the user to react to the dialog or input data into the password fields.

 

 

Keep at it. If you just can't get unhung with it, I'll write one for you, but I think you'll probably get it after a couple experiments.

Link to comment
Share on other sites

a) I'd use Set Field, not Insert Text

 

b) A Custom Dialog continues when the user presses a button. You'll need a button the layout that the user clicks to continue the script (a Resume Script), and another button to halt the current script and take the user to a friendly layout.

 

c) You need a dialog field to set to the value that would have been in the Custom Dialog. A big old global text field will work fine.

 

d) Showing a Custom Dialog automatically pauses the script while the user reads the dialog, and it stays paused until the user clicks a button. You'll have to insert "Pause [indefinitely]" script steps at every point after youv'e assessed field contents and/or changed the dialog, or there's no opportunity for the user to react to the dialog or input data into the password fields.

 

 

Keep at it. If you just can't get unhung with it, I'll write one for you, but I think you'll probably get it after a couple experiments.

 

I've tried to do what you said and i don't get it...I've used "Pause [indefinitely]" and "set field"in the place of "Show Custom Dialog"

Says that account name and password doesn't match,but the OldPassword is correct.Can you write a code for me?Sorry for the problem i've tryed everything...

 

Thank you!

Link to comment
Share on other sites

Here you go. Catch —

 

 

Use "Admin" for username and "hello" for password. If you fool around changing the password over and over and forget what you changed it to, the "back door" combo is "oops" and "oops".

Link to comment
Share on other sites

Here you go. Catch —

 

 

Use "Admin" for username and "hello" for password. If you fool around changing the password over and over and forget what you changed it to, the "back door" combo is "oops" and "oops".

 

Can you send me it for e-mail...i can't download files in this forum smiley-cry

My e-mail is lenosane@gmail.com

Sorry for the work,and thank you for all the help smiley-smile

Link to comment
Share on other sites

You'd think I'd remember by now about that. OK, check your email.

 

It's wonderful!!!!!Really,really thank you,i've put the code in my project yet!!!!!

 

I have just 2 more questions now:

 

Is it possible to make a password box in OldPass, NewPass...?

Example: Istead "hello" showed in the field "OldPass",the field show me "*****" just to prevente any other person see what i'm typing.

 

And i thinh the button "Cancel" is not working properly,when i press this button i go to the Dialog Layout,when i press okay i back to the start layout okay,but i think he lock the FM,i just can not close the file....do you know why is it happening?I've try to Unlock Status Area but not work too....

 

 

But this question It's just for increment my project, have no problem it's really excellente,it's what i needed...really thank you for all the patience

Link to comment
Share on other sites

In a Show Custom Dialog: yes, it's an option in the script step.

 

As fields on a layout: no, but you can fake it with a combination of weird fonts and sizes.

 

Back in the days before FileMaker 6 there was no Custom Dialog feature so it's all we had.

 

Most Windows machines have the font "Wingdings". Format the field in Wingdings, bold, italic, condensed, 12 point.

 

You need a separate layout for MacOS, which won't have Wingdings except by accident, so in your script test for Get(SystemPlatform) and diverge your script to navigate to the appropriate otherwise-identical layout according to platform.

 

Macs are most likely going to have the font Hoefler Text Ornaments. Use that instead.

 

In both cases, the passwords being entered will be an incoherent string of garbage to anyone idly passing by looking over shoulders. Not as secure as password bullets by any means, but generally good enough.

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use