Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

New User Registration Xbasic Function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    New User Registration Xbasic Function

    I am trying to do a new user registration in my system using an XBasic function. Below is what I have, with CheckUser I am trying to see if an email already exists in the database table and if it doesnt then insert that user. Then with Continue, I want to lookup the newly inserted user's id based on the email and insert some information in other tables including that id which ties the tables records back to that user. The insert user seems to be working but from where 'if Continue == 1' down it doesnt seem to work. Not sure what the issue is here. Also, if there is a better way to do new registration then I open to do it that way too.


    dim globalcn as sql::connection
    dim sql as c
    dim args as sql::arguments
    dim flag as l
    dim sqlCommand as c
    dim NewUserValue as n
    dim CheckUser as c
    dim Continue as n

    flag = globalcn.open("::name::conn")
    args.set("currentuser", e.dataSubmitted.USERNAME1)
    args.set("currentdate", date())

    CheckUser = sql_lookup("::name::conn", "pvv_o", "EMAIL = :currentuser","email",args)

    if CheckUser == ""
    flag = globalcn.execute("INSERT INTO pvv_o(email, profile_create_date, last_login, status) VALUES (:currentuser, :currentdate, :currentdate, '1')",args)
    Continue = 1
    end if

    if Continue == 1
    NewUserValue = sql_lookup("::name::conn", "pvv_o", "EMAIL = :currentuser","id",args)

    flag = globalcn.execute("INSERT INTO pvv_info (id, full_name, status) VALUES (:NewUserValue, 'NEED INFO', '1')"
    flag = globalcn.execute("INSERT INTO pvv_l (id, l, status) VALUES (:NewUserValue, 'NO', '1')",args)
    flag = globalcn.execute("INSERT INTO pvv_v (id, status) VALUES (:NewUserValue, '1')",args)
    end if

    #2
    Re: New User Registration Xbasic Function

    You can get the id immediately after you do the first insert. What I might suggest is this: This is assuming the ID you want is the unique number the system assigns when the record is first inserted.

    sql_insert = <<%str%
    INSERT INTO pvv_o(
    email, profile_create_date, last_login, status
    ) VALUES (
    :currentuser, :currentdate, :currentdate, '1'
    );
    \
    select @@identity;
    %str%

    flag = globalcn.execute(sql_insert,args)
    user_id = globalcn.ResultSet.data(1)

    args.set("NewUserValue",user_id)

    Note, you must add the ; and \ after the first command. Then the second command gets the ID number for you.
    Mike Reed
    Phoenix, AZ

    Comment


      #3
      Re: New User Registration Xbasic Function

      Thanks, seemed to work. However, none of that code would constantly set the user would it. Now when I try to login as a user it only filters data for one user, no matter if it is another user that is login. I have a value that is set when a user logins and then a list control is suppose to be filtered on that value. Now it just has the same value and I am not sure why. I dont think it was happening before this code.

      Comment


        #4
        Re: New User Registration Xbasic Function

        This wasn't your question but you appear to be making a form where users can register just by using their email address, no password, and no validation the user is who they say they are. If that is correct, then what would stop me from registering using someone else's email address?
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: New User Registration Xbasic Function

          Yeah, want to add user validation where the user has to confirm themselves through their email before the account is active. Is that easily implemented? The other thing I was talking about above is for some reason the same user is logged in everytime now, not sure why that is. I have a value that gets set from a sql lookup that defines the user not sure if that’s the issue with that and wasn’t sure if this code is constantly setting it for some reason.

          Comment


            #6
            Re: New User Registration Xbasic Function

            Originally posted by swest View Post
            Yeah, want to add user validation where the user has to confirm themselves through their email before the account is active. Is that easily implemented?
            Ideally after the potential user finishes the registration an email is then sent to the email address with a code and link. They press the link in the email and type in the code thus completing the validation process.

            Easily implemented? ...if you're asking then probably not. It's a bit on the advanced side in my opinion (although once you get it down the first time it all makes sense). In a nutshell you'd have an a5w page (to process the validation in xbasic) for the link and a page variable (a GUID is what I use) that was generated at the time of registration. The variable would expire after maybe 24 hours or sooner. Something similar to myValidationPage.a5w?regGUID=17Fc3!z6RTl055x_%tGe@.

            All the information such as the email address, the GUID, the expiration time, etc. is stored in SQL (or the DB you are using) and your validation page checks the page variable to see if it's valid and not expired. Then complete the registration process.
            Mike Brown - Contact Me
            Programmatic Technologies, LLC
            Programmatic-Technologies.com
            Independent Developer & Consultant​​

            Comment


              #7
              Re: New User Registration Xbasic Function

              I would like to learn how to do it and implement it. Anymore information you can give me or point me to a video demonstrating it?

              Comment


                #8
                Re: New User Registration Xbasic Function

                A better more practical user registration process in terms of validation, implemetation and security is to ONLY ask for the email address at first, once the user enters it, you would insert it in a tempUser table along with its GUID and addedDate. Upon successful insert, you would send a confirmation email that contains a confirmation link that has tempUser GUID as a confirmation variable.
                You'd then capture that variable in processing registration page where you'd check if it exists in the tempUser table first. If it does you'd get that email that the user entered and ask the user to complete registration where you'd add them only then to the security tables. Use the SecurityFramework UX template - CreateNewUserAccount - There are plenty of videos that show you how to do that. Once successfully added to the system, you'd then delete that associated record from the tempUser table. In case the user doesn't confirm registration in 30 days you'd also delete that record.

                Hope this helps.

                Comment


                  #9
                  Re: New User Registration Xbasic Function

                  Not intended as a plug but you can get some ideas on user management by looking at the videos on this page for my Framework: http://alphatogo.com/framework.a5w
                  Steve Wood
                  See my profile on IADN

                  Comment

                  Working...
                  X