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

Redirect to requested page after succesful login

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

    Redirect to requested page after succesful login

    Hi
    I have an app with an autoexec.a5w that runs after a succesful login. In this file, i do redirects to specific pages depending on user's security group.
    Now i have a page ( let's call it x.a5w) where if the user tried to access that specific url, i would like to redirect to it ( upon sucessful login ), otherwise run the actual code i have now in autoexec.a5w. How can i accomplish that?

    Thanks
    Jaime

    #2
    Re: Redirect to requested page after succesful login

    ...or to put it simply

    if a user goes to x.a5w url ----> have him login then redirect to x.a5w
    otherwise--------> have him login then redirect to autoexec.a5w

    Comment


      #3
      Re: Redirect to requested page after succesful login

      Is there a way while in login component to know what was the original page that called the login component, so i can redirect to it?

      Comment


        #4
        Re: Redirect to requested page after succesful login

        on the web security configuration there is a login option that says
        ignore return to the page after login
        and this gets checked always if someone has component security turned on, like myself.
        this may be something you might want to check if you are not using component security.
        thanks for reading

        gandhi

        version 11 3381 - 4096
        mysql backend
        http://www.alphawebprogramming.blogspot.com
        [email protected]
        Skype:[email protected]
        1 914 924 5171

        Comment


          #5
          Re: Redirect to requested page after succesful login

          That can be tricky since there is only one security settings property sheet. I have a little different situation, but here is what I do.

          I am running several instances of Alpha on different ports, for example www.nfnportal.com which is for clients and www.nfnportal.com:9181 for employees.
          www.nfnportal.com defaults to mainmenu.a5w and the others go to index.a5w which has the regular login component used for employees.

          In the security settings I have the Redirect page after login set to startup.a5w (your autoexec.a5w), so everyone goes there.

          For clients, I have a menu with a bunch of buttons, some that do not require login and some that do. I call the buttons A,B,C, etc
          Looks like this:Capture1.PNG

          The buttons are in a UX on the page and the onClick is "Open an .a5w page..." and for pages that require login, the Page URL is, for example, cust_login.a5w?gt=A, target is Browser Window and Browser window name is _top. Buttons that do not require login just go directly to the non-secured page.

          In the head section of cust_login.a5w, I set a Session.GOTO and see if Session.ULINK exists (they are logged in). If so, I skip the login and redirect to the page. If not, they see the login component. Code is
          <%a5
          dim gt as c DEFAULT "Z"
          Session.GOTO = gt
          if variable_exists("Session.ULINK") = .F. .or. (variable_exists("Session.ULINK") = .t. .and. Session.ULINK = "") 'not logged in
          %>
          <%a5
          Code to create the cust_login component
          %>
          <title>
          Code for the page
          </body></html>
          <%a5
          else
          if Session.GOTO = "A"
          vGoTo = "http://www.enefen.com"
          elseif Session.GOTO = "B"
          vGoTo = "cust_contactus.a5w"
          and so on
          end if
          response.redirect(vGoTo)
          end if
          %>

          After login everyone goes to startup.a5w where I figure out who they are from the Session.ULINK and set up Session.FULLNAME, and other stuff and log the login
          For clients, Startup.a5w also contains the
          if Session.GOTO = "A"
          vGoTo = "http://www.enefen.com"
          elseif Session.GOTO = "B"
          vGoTo = "cust_contactus.a5w"
          and so on
          end if
          response.redirect(vGoTo)

          Yes, it is convoluted, but it gets around the single security properties issue.
          Pat Bremkamp
          MindKicks Consulting

          Comment


            #6
            Re: Redirect to requested page after succesful login

            Originally posted by WindForce View Post
            Is there a way while in login component to know what was the original page that called the login component, so i can redirect to it?
            Do your users go directly to x.a5w or do they get there via a link?

            It really depends on what your processing scheme is. Are you getting to x.a5w via xbasic, javascript, html, directly? If you're getting to x.a5w directly then there's no really great way to document that you're coming from x.a5w. If you're getting to x.a5w through another process then you could set a variable (client or server side) to help determine where you're coming from. The redirect after login could send you to a central processing page where you could test the variable.

            Comment


              #7
              Re: Redirect to requested page after succesful login

              The users go directly (i.e they type the link address) to x.a5w ...I have that same issue in many applications. If i could keep security on, but uncheck the "ignore return to page after login" then that would be perfect...

              Comment


                #8
                Re: Redirect to requested page after succesful login

                Create a <StartMenu> table with a field "StartPage" like mymenu.a5w <parameter etc>
                Link the Startmenu to your user table finish with a reponse.redirect <"yourpage">
                You can even place A5Template behavior from that field and run workflow proces.

                Comment


                  #9
                  Re: Redirect to requested page after succesful login

                  If i could keep security on, but uncheck the "ignore return to page after login" then that would be perfect...
                  it says component security, do you need component security when they are in a page? I have mine in tabbedui so I have setup component security.
                  thanks for reading

                  gandhi

                  version 11 3381 - 4096
                  mysql backend
                  http://www.alphawebprogramming.blogspot.com
                  [email protected]
                  Skype:[email protected]
                  1 914 924 5171

                  Comment


                    #10
                    Re: Redirect to requested page after succesful login

                    I am showing my age, but here is a proven method to do what you want.

                    First go uncheck Ignore return to page after login.

                    Add this to the very top of your login.a5w page. Modify the list of allowed pages to suit. If the bookmarked page is in the list of allowed pages, it will redirect back to that page after login. If not, it will go through your intermediate autoexec.a5w page. The request.variables.np is the magic trigger.

                    Edit: I added "dim request.variables.np" as c to the code.

                    Edit: Other methods like determining what page you came from do not work because if you hit a secure page and are redirected to the Login page, there is NO information about where you came from. Because of this you also cannot use any method in the intermediate autoexec.a5w page because again, you will have no information about what page they hit initially before being redirected to the login.

                    <%a5

                    allowed_pages = <<%txt%
                    secure_page.a5w
                    secure_page1.a5w
                    secure_page2.a5w
                    secure_page3.a5w
                    %txt%

                    dim request.variables.np as c
                    local_np = a5_split_url(request.variables.np,.t.).page

                    dim result as l = .f.
                    result = is_one_of(local_np,allowed_pages)
                    if result <> .t.
                    request.variables.np = "" '== will cause to go to the intermediate page
                    end if

                    %>
                    Last edited by Steve Wood; 06-29-2014, 11:30 PM.
                    Steve Wood
                    See my profile on IADN

                    Comment

                    Working...
                    X