PDA

View Full Version : Set-Reset Passwords


ABC123

martinwcole
04-24-2005, 06:17 AM
Installation: Paste the attachment inside the folder addins_installed inside the folder a5v6, the full version. (This code has the potential for abuse, so it is offered as an encrypted addin only.)

Audience: V6 developers (will not currently work below V6), especially who use xbasic and want to protect their scripts. (I rarely use action scripting, so it has limited testing for action scripting, but works with action scripting with the following complication: it will successfully add a password to an event with action scripting, but if you edit the script and save it, it will be saved without a password, and you will have to re-run the function.)

Use: from the control panel, from interactive, start typing and use resetpasswords(). You will be asked to enter an “Old Password,” a “New Password,” and select from the following 3 choices – “Update Only if Has Password,” “Update Only if Has Code,” and “Update Regardless.”

Example Use: on a full blown app, there may be a total of 25,000 events and may take 5 minutes to complete, but the statusbar will keep you informed of where you are in the process. The function will check every event for every form for all [form events,] [button events,] [field events,] and [embedded browse events,] as well as every global script and every global UDF. But it will NOT update [named browses,] [browse by expressions,] or [sub forms,] or any “fly over” events.

Say you have 100 forms with 10 events per form with scripts. Say you originally used “3333” as the password, but forgot to protect half of the scripts and/or want to change the password – if you enter “3333” as the old password and “4444” as the new password and select the option “Update Only if Has Code” the function will check all events for all forms and update all scripts on all forms where there is code, and where there is code that has the password “3333” it will change it to “4444” and where there is no password, it will add one for “4444.”

If the “Old Password” you entered does not match the existing password, you will be alerted and have the option to stop the function – but the script WILL NOT be updated.

Global Scripts and Global Functions are updated regardless, providing the password is correct.

To update passwords, you can use the same “Old Password” and “New Password” and it will reset and/or add the password to scripts.

I RECOMMEND YOU MAKE A COPY OF YOUR APP AND RUN THIS FROM THE COPY. If you like the results you can run it from the original.

I wrote this for myself, to be sure all scripts were protected, and when I suspect someone has discovered the password, (or I had to give it to them to deal with an emergency,) I can change it.

Ronald Anusiewicz
05-08-2005, 06:50 PM
Thank you Martin.

What a handy tool.
I've been using it now for about two weeks.

Ron

martinwcole
07-10-2005, 12:29 PM
this version will work in either V5 or V6