locked
Confirmation link

    Question

  • Hey there,

     

    Here's the scenario: I already created a login/registration form in my application that works fairly well. The user fills a form with his username, email, password and then the application sends an email with a randomly generated code to his email. In order to activate his account, the user copy - pastes the code received to the application, that then accepts it if valid and makes activated=true in the database, allowing the user to use the application normally.

     

    Now my problem is, I really needed to make an approval for a user-created document fully automatic as a link. Most of the users that approve stuff will rarely want to log into the application at all. If I could send an also randomly generated code along with the id for the document that needs to be approved as a parameter in a link or something like that, it would be awesome!

    The user would only have to check out the document (if sent as an attachment in the email), press the link to approve and voilá, the document would be set as approved in the database.

    So, I wanted to know the best way to do this. Preferably the cheapest if not free.

    I'm OK with using web stuff, if I really need to.

     

    Please advise me if this is not the best place in the forum to ask such a question.

    Thanks!




    Friday, April 15, 2011 8:43 AM

Answers

All replies

  • Hi Yokiharo,

    Sorry, I don't understand these words: "make an approval for a user-created document fully automatic as a link". Is that mean: you want to create a document, when the users confirm their account, they can access these documents, if not, they can't, right?

    Have a perfect day.


    Call me ghost for short, Thanks
    To get the better anwser, it should be a better question.
    Monday, April 18, 2011 1:41 AM
  • Hey there, thanks for answering!

    I'm really sorry if I didn't make myself clear:

    At that point the user would already be registered, he would just need to approve documents (preferably, and that's where I need some help, in the form of link)

    Imagine this: I register a document and set that the person who should approve it is the user "Admin". The application checks for the email of that user, and then sends a link to that email, that the user can click on, if approved.

    I hope I explained the situation in a better way this time - Don't hesitate to ask any further questions if needed.

    Thanks!

    Monday, April 18, 2011 7:34 AM
  • Hi Yokiharo,

    OK, I have understood something, but need more.

    Maybe the senario like this:

    1. a user fill user name and password and what else.

    2. the user click the button named "register", then the application insert a line of data into the database, "register a document", send a mail to the mailbox which the user had provided.

    the mail include a link to confirm a user account and a link of the document.

    when the user confirm the the first link, he can open the document link.

    And your question is "How to make the document link valid when the user confirm the account link"

    If I have misunderstood you, please correct me as soon as possible.

    Have a perfect day.


    Call me ghost for short, Thanks
    To get the better anwser, it should be a better question.
    Monday, April 18, 2011 8:18 AM
  • Let me try to rephrase it:

    1. A user registers in the application normally;
    2. The same user registers a document in the application;
    3. The application automatically sends an email with the link to another user (who has higher permissions and is able to approve documents);
    4. That link, when clicked, must pass the value approved=true or something like that to the database and/or application;
    5. Document is set as approved, scenario solved;

    My only problem really is the link, the rest I think I can already solve.

    I only mentioned the way that I use to register users as an example - What I need is probably something like http://application.documents/id?=docID&approve?=XYZ12345 so that it could be somewhat automatic instead of copy pasting a code somewhere in the application.

    P.S.: Being docID the ID for the document in the database and XYZ12345 a randomly generated code that approves the document. 

    Thanks!

     

    EDIT: Why was this marked as answer? I still have no idea how to implement the link system!



    • Marked as answer by Mike FengModerator Monday, April 18, 2011 10:14 AM
    • Edited by yokiharo Monday, April 18, 2011 3:44 PM Marked as Answer
    • Unmarked as answer by yokiharo Monday, April 18, 2011 3:45 PM
    Monday, April 18, 2011 9:29 AM
  • Hi Yokiharo,

    As you said, the link can be like "http://application.documents/id?=docID&approve?=XYZ12345", Is anything unclear? Is it about how to get the randomly code?

    If so, this can be helpful: rand function.

    I hope this will be helpful.

    Best regards,


    Mike Feng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 26, 2011 1:53 AM
  • Hey Mike Feng,

    I'm really sorry if I wasn't clear enough.

    No, that I already know. My problem now is how to implement that system the best way possible:

    • Is there a VB component which makes an application able to accept links like that from the web? (If so, should I make a server-side application that accepts the links and then process them accordingly?)
    • Should I turn to PHP instead, making a sort-of-website for the server and manage the database directly by running SQL through PHP with SQL Server Drivers for PHP?
    • Is there an even better way I haven't thought about yet?

    I'd be most grateful for an answer to my issue.

    Thanks!

    Tuesday, April 26, 2011 8:12 AM
  • Hi Yokiharo,

    When the user click the confirmation link in his/her mail, you need a webservice to accept the message. In the webservice, we can check the approve ID, if ok, alert the account status to confirmed.

    On the other hand, when a user try to log on, check its confirmation status first.

    I hope this will be helpful.

    Best regards,


    Mike Feng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 26, 2011 9:14 AM
  • Hi Mike Feng,

     

    Can you explain me what you mean by webservice? Is it a component or control I can use?

    Or are you talking about building a separate web application for it?

     

    Thanks for all the help!

    Tuesday, April 26, 2011 9:26 AM
  • Hi Yokiharo,

    Yes, it should be web application.

    Best regards,


    Mike Feng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by yokiharo Tuesday, April 26, 2011 9:57 AM
    Tuesday, April 26, 2011 9:53 AM
  • Thank you, I'll look into web application development then.
    Tuesday, April 26, 2011 9:58 AM
  • Hi Yokiharo,

    You are welcome.

    Best regards,


    Mike Feng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 26, 2011 10:02 AM