close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Send random password to approved user

Thread began 1/29/2012 6:17 am by steelace396915 | Last modified 1/29/2012 12:54 pm by steelace396915 | 3501 views | 3 replies |

steelace396915

Send random password to approved user

Hi

I wonder how I can accomplish the following task:
I have a registration page built in SA where a user apply for membership to my site. They just enter their personal information like name, address, email etc. These values are written into my db. I also have a accesslevel column and new users gets a applicant status when they register that wont let them login until I change that value in db to approved user. When they register they don't enter a desired password so that column remains blank in db. Now from my admin pages built with DA I have the userupdate page where I can change the registered users personal information if needed and also update the users status to approved user via a accesslevels menufield. All this works but at the time I change the users accesslevel to approved and submitting the changes (updating the form) I would like to have an email sent to the user with login information to my site containing their ID/email and an autogenerated password (random password) which is also inserted in db at the time I submit the change. I would like this password to be inserted encrypted with SHA1 in db. Of course the user should recieve the email showing that password none-encrypted. When the user is successfully logged in with his sent credentials he/she should be able to change that autogenerated password in the userupdate page (SA built page) to whatever he/she chooses according to password rules of course and when submitting the change the password should be updated in db with SHA1 encryption. I hope my explanation on what I'd like to accomplish is clear? I need some input in how to accomplish this!

Thanks in advance!

Regards,
Martin J.

Sign in to reply to this post

Ian S

Hi Martin,

They way that I achieve this is to have a PHP function that randomly generates a string. This then populates a hidden field on the signup page, which is inserted into the database.

Then when the database entry for the account has been inserted you can fire an email to the user containing the randomly generated string.

Hope this helps

Cheers
Ian

Sign in to reply to this post

steelace396915

Ian, thanks for replying! I have been thinking about a solution like that but Im not sure how to do it with my VERY limited knowledge in PHP. Is there a way using accomplishing this only using the WA server behaviours or do one have to handcode this function?!

When a new user signs up there is no password inserted into the db as choosed by me when creating the signup page. I have 4 accesslevels on my site. 1= Visitors, 2= Applicants (People who sign up but are not yet approved), 3 = Approved users & 4= Administrators. When a new user signs up he/she is asigned value 2= applicant in db. Ive then set up rule on login page to only allow accesslevel only 3-4 users to be able to login.

What I have now is a admin/userupdate page where I can change the accesslevel value for a previously signed up user who is not yet able to login. At the time I change the accesslevel for that user to approved I wonder if one could implement the random password behaviour to autogenerate a password that is sent to the approved user and at the same time insert this password in db for that user.

On the userupdate page I have now it works inserting a password for a user in the initial empty password field manually and its inserted correctly in db but what I really want is to have it automated when I change the accesslevel for the user and press submit.

I do understand what you say about having a hidden password field inserting a static password on the signup page but that should not matter if the password field is blank or filled with some initial value when entering the userupdate page?

Im not smart enough yet to figure out how to do this correctly on my own so I hope for some more input!?

I did find another thread that deals with similar problem but Im not positive how I can implement this for my needs!? showthread.php?t=21907

/Martin J.

Sign in to reply to this post

steelace396915

I just discovered that the Update Record server behaviour applied to userupdate page created with latest version of DA does not function when trying to insert encrypted (SHA1) data in db. I tried this with my password field that is empty initially but page freezes when trying to format the password field with encryption. Without encryption data is inserted correctly. I remember this being a"bug" discussed recently and that this should have been fixed now? I tried deleting the update record server behaviour and instead inserting the Update Record Server Behaviour from the SA install found in Server Behaviours/Webassist/DataAssist/Update Record manually. I copied all the values from the original Update Record behaviour and all of a sudden SHA1 encryption works and writes correctly to db!!?

/Martin J.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...