Query SqlServer2003 stored procedure
-
Hi, I am working on a forgot password module in which i have to send the mail having password to the user.I am using UserID,Email,IsApproved,IsVisible fields in my table.The module is working fine with sending mail on the basis of existing email of user.But i have to apply checks on the stored procedure that if the IsApproved and IsVisble fields are set to 0 by admin then the password would not be sent to the user and if IsApproved is 0 and IsVisible is 1 then do not send mail and if IsApproved is 1 and IsVisible is 0 then send mail. I am using SqlServer2003 stored procedure. Vivek Rathore
-
Hi, I am working on a forgot password module in which i have to send the mail having password to the user.I am using UserID,Email,IsApproved,IsVisible fields in my table.The module is working fine with sending mail on the basis of existing email of user.But i have to apply checks on the stored procedure that if the IsApproved and IsVisble fields are set to 0 by admin then the password would not be sent to the user and if IsApproved is 0 and IsVisible is 1 then do not send mail and if IsApproved is 1 and IsVisible is 0 then send mail. I am using SqlServer2003 stored procedure. Vivek Rathore
-
Hi, I am working on a forgot password module in which i have to send the mail having password to the user.I am using UserID,Email,IsApproved,IsVisible fields in my table.The module is working fine with sending mail on the basis of existing email of user.But i have to apply checks on the stored procedure that if the IsApproved and IsVisble fields are set to 0 by admin then the password would not be sent to the user and if IsApproved is 0 and IsVisible is 1 then do not send mail and if IsApproved is 1 and IsVisible is 0 then send mail. I am using SqlServer2003 stored procedure. Vivek Rathore
vivek_r wrote:
I am using SqlServer2003 stored procedure
I very much doubt that.
vivek_r wrote:
I am working on a forgot password module in which i have to send the mail having password to the user
Personally, I think that is a bad idea. You should never store the password in a form where it can be sent via email. It is better to store the password as a salted hash which means that it can never be retrieved. Then, if the user forgets the password, it has to be regenerated.
vivek_r wrote:
if the IsApproved and IsVisble fields are set to 0 by admin then the password would not be sent to the user and if IsApproved is 0 and IsVisible is 1 then do not send mail and if IsApproved is 1 and IsVisible is 0 then send mail.
SELECT columns WHERE Email = @email AND IsApproved = 1 The logic is very simple. You have stated that if IsApproved is 0 then do not send the email, and IsVisible is unimportant (reread what you wrote if you think that is an incorrect interpretation)
IsVisible IsApproved Send Email
0 0 No
0 1 Yes
1 0 No
1 1 Doesn't say: likely yes
Upcoming Scottish Developers events: * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos
-
vivek_r wrote:
I am using SqlServer2003 stored procedure
I very much doubt that.
vivek_r wrote:
I am working on a forgot password module in which i have to send the mail having password to the user
Personally, I think that is a bad idea. You should never store the password in a form where it can be sent via email. It is better to store the password as a salted hash which means that it can never be retrieved. Then, if the user forgets the password, it has to be regenerated.
vivek_r wrote:
if the IsApproved and IsVisble fields are set to 0 by admin then the password would not be sent to the user and if IsApproved is 0 and IsVisible is 1 then do not send mail and if IsApproved is 1 and IsVisible is 0 then send mail.
SELECT columns WHERE Email = @email AND IsApproved = 1 The logic is very simple. You have stated that if IsApproved is 0 then do not send the email, and IsVisible is unimportant (reread what you wrote if you think that is an incorrect interpretation)
IsVisible IsApproved Send Email
0 0 No
0 1 Yes
1 0 No
1 1 Doesn't say: likely yes
Upcoming Scottish Developers events: * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos