Alpha Video Training
Results 1 to 21 of 21

Thread: Help creating a link that "Approves" a record or a link that autologins and filters.

  1. #1
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Help creating a link that "Approves" a record or a link that autologins and filters.

    OK,
    First, this all runs over LAN or if somone has logged into a VPN and has his/her hosts file setup properly.

    I have a request system set up that emails various people throughout the chain that may need to approve the request. Basically, when a user creates a new record, he picks the person that should be approving the record and that person is automatically emailed when the record is saved.

    I want to send a link in that email to make it easy for the recipient to "approve" it. Approval, in this case, would be changing a logical field from 0 to 1 in an SQL table.

    Originally, I'd thought to try to create a link that would autologin the user and redirect that user to the proper page, filtered to the proper record. This is still something I'd entertain. In fact I may need this for one part of the chain and just an approval link (below) for a differnt part. I know it will be harder to do but I know it would be more secure as well. Security is a "bit" less of a concern because this is all on the LAN at the moment.

    If I just wanted to create a link that actually approves the record my guess is that I'd have to:

    1. Create an a5w page that runs the operation and must be set to always allowed for security.
    2. Make a link to that a5w page with the variables that the page needs to run included in it. (I'll probably need a bit of help with this)
    3. Make sure the page can't run without the above variables using xbasic and conditions.
    Optionally, I think it may be a good idea to grab the users computer user name and pass that in. I setup my alpha security to match our network security user names.s

    Does that sound about right?

    Any help or better ideas would be greatly appreciated!

    Thanks!

  2. #2
    "Certified" Alphaholic
    Real Name
    Andy Gill
    Join Date
    Jul 2011
    Location
    Barbados
    Posts
    1,029

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    I would agree with your proposed approach (items 1-3). You could create a UUID for each e-mail request, and this would be included as a URL variable in the link.
    EDITED...
    Have a separate DB table for such requests containing fields like UUID, RequestDateTime, Username, IsCompleted.
    You would then query the request table for this UUID and if found, change the approval flag to 1.
    No need to log in or navigate to a page in this case, but if you wanted extra security, just prompt for the user's password before making the change (either popup or in-page field).
    Sounds like you've got it covered!

  3. #3
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Hi Andy,
    I'm not sure what is meant by; or how to create, a UUID. I'll need a little help with the link. The page itself I think I can handle.

  4. #4
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Part 1 - Saving the Record
    Code:
    //add a field to your database table (the one that has the 0/1 approve flag) and name it reqKey
    //when you save the record, save this reqKey in the table
    dim reqKey as C=remspecial(api_uuidcreate()) 
    //blabla record save code
    dim recordid as N='write code here to populate this properly
    
    dim emailResponseLink as C="http://mywebsite.com/email_link_handler.a5w?rid="+recordid+"&rk="+reqKey
    dim approvalLink as C=emailResponseLink+"&action=APPROVE"
    dim denyLink as C=emailResponseLink+"&action=DENY"
    
    dim emailBody as C
    emailBody="Approve this post:<br/>"
    emailBody=emailBody+"<a href="+quote(approvalLink)+">"+approvalLink+"</a>"
    emailBody=emailBody+"Deny this post:<br/>"
    emailBody=emailBody+"<a href="+quote(denyLink)+">"+denyLink+"</a>"

    email_link_handler.a5w [SET TO ALWAYS ALLOWED]:
    Code:
    if eval_valid(Request.Variables.rid) .and. eval_valid(Request.Variables.rk) .and. eval_valid(Request.variables.action) then
         dim idToUpdate as N=convert_type(Request.Variables.rid,"N")
         dim requestKey as C=Request.Variables.rk
         dim requestAction as C=upper(Request.Variables.action)
         
         if requestAction<>"APPROVE" .and. requestAction<>"DENY" then
              ?"INVALID ACTION"
              end
         end if
    
         dim args as SQL::Arguments
         args.set("idToUpdate",idToUpdate)
         args.set("requestKey",requestKey)
         dim rec_count as N=sql_lookup("::name::conn","mytable","id=:idToUpdate AND reqKey=:requestKey","COUNT(*)",args)
         if rec_count==1 then
               'record was found, run our update
               if requestAction=="APPROVE" then
                     args.set("approval_flag",.t.)
               else
                     args.set("approval_flag",.f.)
               end if
    
               sql="UPDATE mytable SET approval=:approval_flag"
               'You need to do a conn open here, im not gonna show you this code, im sure you know how to do this
               IF conn.execute(sql,args) then
                       ?"Record has been: "
                       if requestAction=="APPROVE" then
                                ?"Approved"
                      else
                                ?"Denied"
                      end if
               else
                     ?"REcord could not be updated, please contact your system administrator"
               end if
         else
               'record not found, either ID was not found, or an invalid request key was provided
         end if
    else
    ?"Invalid Request"
    end if
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

  5. #5
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Jinx, the page itself needs to validate that the UUID used exists.
    First of all, hopefully youre using MySQL but anyways, the same concept applies
    UUIDS (GUIDS) stand for Universally/Globally Unique IDentifiers.
    They are basically mumbo jumbo, but they are really random and you RARELY (and i mean RARELY if ever) generate the same guid twice.

    Anyways, lets say you made a page email_link_handler.a5w?rid=5&action=DENY
    Then anyway who accesses that can change rid to 8, rid to 9 , rid to 11, and deny a whole bunch of records.
    When you save the record, you save a sort of ACCESS KEY / KEY / PASSWORD (this is where we are using the UUID).
    So each record looks like this

    Code:
    rec_id      approval_flag       access_key
      1                  0                apple
      2                  0                banana
    So now, if I want to update a record I must say:
    email_link_handler.a5w?rid=1&action=APPROVE&ak=apple <<This will update the record
    email_link_handler.a5w?rid=1&action=APPROVE&ak=banana <<This will not, note the banana access key does not correlate to record 1
    email_link_handler.a5w?rid=2&action=APPROVE&ak=banana <<This will update, notice that banana is the access key for record 2

    You are using the remspecial(api_uuidcreate()) to generate the access key for you.
    Its just a random alphanumeric string. Anyhow, the api_uuidcreate() brings back a guid with - , you can keep these or you can use remspecial() to get rid of them.
    For this purpose I recommend getting rid of htem, otherwise you should url encode and url decode your links.

    If you require assistance implementing the above, REA INC would be happy to assist you.
    We provide mentoring and component development, so if you wanted us to write you a small sample that does this, we would be able to.
    The above sample is provided as is and may/may not work.
    However, if you would like us to provide you with a full working example, we can do so.

    Feel free to call us using the number below.
    Ask for Scott

    Hope you appreciate the time I took giving you this example (im actually on my lunch break) :)
    Enjoy - and please feel free to call us if you need guidance or a push in the right direction!
    Thanks,
    Scott
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

  6. #6
    Member nlights's Avatar
    Real Name
    pertti karjalainen
    Join Date
    May 2011
    Location
    California
    Posts
    217

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Sounds pretty straight forward. I've done stuff like that -- I have one app that batch emails a bunch of people with a A5W page link and their specific various ID's inserted into it (e..g, www.mypage.a5w?eventid=434&participantid=445.) The landing page validates the ID's and recognizes the (in this case) event and participant ID, and if those are correct, allows them access to a web component waiting behind the web page.

    One thing I've noticed, though, that you are MUCH better off making sure that you "harvest" and validate incoming request variables and turn them into session variables ASAP. That is, in the A5W page rather than, say, the onGridExecute() -event, because in my experience the request variables become randomly unreliable by the time the web component is invoked.

    In my case I don't have too many security concerns since the user domain is pretty small, but if this was a more public site I would definitely create much more obtuse parameter names and keys. I don't know if relying on the computer user name is a good idea, because you never know where people might decide to connect to your page from.

  7. #7
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    "One thing I've noticed, though, that you are MUCH better off making sure that you "harvest" and validate incoming request variables and turn them into session variables ASAP" - Agree with the first part 'harvesting', but you do not need session variables for this. Also, I would recommend using keys.

    If you did not use keys, then anyone who sees those links can input different numbers and effectively approve/deny records as they please.
    By using a key on the record, you are effectively creating a link that is harder to guess.

    delete_table.a5w?tablename=mytable <<I can pretty much figure out that by passing table names here it will delete a table. I can change this to delete_table.a5w?tablename=customer and BANG there goes your customer table

    delete_table.a5w?tablename=mytable&key=0293120930123921039129 <<Ok this deletes ok
    delete_table.a5w?tablename=customer&key=0293120930123921039129 <<This key will not match and the customer table will not be deleted.

    It really depends on your security concerns.
    Another option is to put security on the approve page, and then on that page, save redirect variables in session, then after login in your post login processor parse those variables and determine whether you need to approve/deny.
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

  8. #8
    "Certified" Alphaholic
    Real Name
    Andy Gill
    Join Date
    Jul 2011
    Location
    Barbados
    Posts
    1,029

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    UUID just makes it easy to create a unique string per request.
    http://wiki.alphasoftware.com/API_UUIDCREATE+Function

  9. #9
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,629

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Hi Jinx,

    I do a very similar thing to what Scott has suggested, using a UUID for the link. Based on that experience, I suggest you send two UUID codes, one for approve and one for disapprove. That way, you know if the person has responded and tickle them if they haven't.

    Pat
    Pat Bremkamp
    MindKicks Consulting

  10. #10
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Wow, that's a lot of info! It might take me a little while to read through this carefully and start testing some stuff out.

    What I think I understand so far is:
    1. Add a new field to the table that I want someone to approve the record on.
    2. Change my submit code to Save UUID to that field using something like: dim reqKey as C=remspecial(api_uuidcreate())
    3. Right now I have an email button so I'd have that ajax callback to grab the UUID out of the table and create a link in the email.
    4. Make a page that handles the link and checks against the UUID in it to run the SQL and approve the record.

    Sound about right?

    Thanks everyone!

  11. #11
    Member nlights's Avatar
    Real Name
    pertti karjalainen
    Join Date
    May 2011
    Location
    California
    Posts
    217

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Of course you are right about that, especially when the web site is not running in a "walled garden." My approach is ripe for abuse out in the wild, but given the people who know about this site and use this particular application, I don't worry about security too much. And you are right about the id -name as well -- one should ideally make that one non-sensical as well, so that it is harder to guess what it refers to.

    Quote Originally Posted by aburningflame View Post
    "One thing I've noticed, though, that you are MUCH better off making sure that you "harvest" and validate incoming request variables and turn them into session variables ASAP" - Agree with the first part 'harvesting', but you do not need session variables for this. Also, I would recommend using keys.

    If you did not use keys, then anyone who sees those links can input different numbers and effectively approve/deny records as they please.
    By using a key on the record, you are effectively creating a link that is harder to guess.

    delete_table.a5w?tablename=mytable <<I can pretty much figure out that by passing table names here it will delete a table. I can change this to delete_table.a5w?tablename=customer and BANG there goes your customer table

    delete_table.a5w?tablename=mytable&key=0293120930123921039129 <<Ok this deletes ok
    delete_table.a5w?tablename=customer&key=0293120930123921039129 <<This key will not match and the customer table will not be deleted.

    It really depends on your security concerns.
    Another option is to put security on the approve page, and then on that page, save redirect variables in session, then after login in your post login processor parse those variables and determine whether you need to approve/deny.

  12. #12
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    For records I expect to link to from the outside world, I often have an ID (simple autoinc for internal linking) and then an "eid", stands for "encrypted ID". The eid is normally 32 character using remspecial(api_uuidcreate()). I use the eid in URL's to link to the record, same as others have mentioned here using the uuid.

    That allows me to do something like:

    ...enrollment_form.a5w?eid=aftre1fa03cd4f038ae0891e5fedc788&app=student

    The app parameters tells the A5W page to display the "Student" application and the eid ties back to the Customer record to pick off Customer Name, email address, etc. I could encrypt the word "student" as well if I felt that was necessary.

    For better security you can embed the date in the eid, like:

    d = cdate(date())
    eid = eid + base64encode(d)


    Now the string starting in position 33 to the end is the date of the link. You can parse that as well, and if the date is older than X, you can report that the link has expired. If you do that, you have the security knowing no one can ever use the link after it expires.

    If I don't have an eid, I might use an algorithm on the ID to create encrypted id on the fly, using something like this:

    id = 100
    tt = alltrim(str(id)) + "some_seed_string"
    pp = urlencode(base64encode(tt))
    ?pp
    = "MTAwc29tZV9zZWVkX3N0cmluZw%3d%3d"


    And this to decrypt:
    ?stritran(base64decode(urldecode(pp)),"some_seed_string")
    = "100"


    If you take that logic and add an encrypted parameter to indicate Yes or No, you can make it work.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  13. #13
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Thanks again guys!

    I was able to get this to work a lot easier than I expected.

    First, I was able to "cheat" and use the automatically created email action to make the link. I just used this in the action editor:
    Code:
    <a href="http://mywebsite.com/email_link_handler.a5w?rid={unique_id}&rk={ReqKey}&action=APPROVE">Click To Approve This Request</a>
    The only problem is that this was failing:
    Code:
    eval_valid(Request.Variables....)
    So I just changed it to:
    Code:
    variable_exists("Request.Variables....")
    Which seems to work fine for my purposes.

  14. #14
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Now, since that was relatively painless...and because I KNOW a user is going to ask for this soon....

    How would I go about creating a link that will automatically login the user (which redirects to my tabbed UI), open the proper tab in the tabbed ui, and then filter the grid to that record? I think I know how to make the grid filter once I get there but the rest of the process is a bit of a mystery at the moment.

    Thanks again!

  15. #15
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    You are correct about eval_valid(Request.Variables...etc
    It should be eval_valid("VARIABLENAMEASCHARACTERSTRING") , what alpha does underneath is try to eval it, retrurns true if it evals (e.g the variable DOES indeed exist) and false otherwise.

    My mistake
    SO yes, use
    if eval_valid("Request.Variables.varname")

    "How would I go about creating a link that will automatically login the user (which redirects to my tabbed UI), open the proper tab in the tabbed ui, and then filter the grid to that record? I think I know how to make the grid filter once I get there but the rest of the process is a bit of a mystery at the moment." - THINK LONG AND HARD....Do you really want a link to automatically login the user (this would mean passing the password in the link)? This is a HUGE, I stress, HUGE security hole.

    Are you sure you dont want to link to the LOGIN page, make the user enter their password, and THEN automatically open the tab in the proper page etc?
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

  16. #16
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Anyhow:
    emailbody
    Code:
    <%a5
        dim pageToHandle as C="gridpage.a5w?id=100"
        dim pageLink as C="http://mywebsite.com/login.a5w?r="+urlencode(pageToHandle)
    
        'use pagelink in an email
    %>

    login.a5w
    Code:
    if eval_valid("Request.Variables.r") then
            session.__protected__redirect=urldecode(Request.Variables.r)
    end if


    As for opening the tab, on the main.a5w page (the one with your tabbedUI on it), check if the session.__protected__redirect exists, if it does, print out javascript to open a new tab

    I forgot the code to open a new tab. Im pretty sure its tabalias.addPane() or something like that.
    Search for TabbedControlUI javascript functions.
    In the below, the tabalias is "tbi" so you would use tbi.addPane


    HTML Code:
    Delete tmpl
    DIM tmpl as P
    tmpl = a5w_load_component("tabui_mainpage") ''SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE (LOAD:tabui_mainpage)
    
    'Override settings start -----------------------------------------
    with tmpl
    [B].alias = "tbi"[/B]
    end with 
    'Override settings end -----------------------------------------
    
    delete x_out
    dim x_out as p
    x_out = a5w_run_Component(tmpl) 'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE (RUN:tmpl) (EDIT:tabui_mainpage)
    
    ?x_out.Output.Head.JavaScript
    ?x_out.Output.Head.CSS_Link
    ?x_out.Output.Head.Title
    Last edited by aburningflame; 03-14-2013 at 04:35 PM.
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

  17. #17
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    If you inspect your page with the TABBEDUI (using firebug or view source) youll see your buttons have an ONCLICK event to an action() javascript method

    Here is an example of such method.
    See the tbiObj.add() call? - This is the method that actually adds a pane to the tabbed ui.
    Code:
    window['action_tbi_de0161f6_e5a9_4b0a_961f_ec918981d5d3'] = function() {
    tbiObj.add({title: 'My Account', type: 'url', url: 'myaccount.a5w' , header: {
    className: 'GradientBlueFooterTD',
    style: {
    borderTopStyle: 'none',
    borderBottomStyle: 'solid',
    borderBottomColor: '#ddd',
    borderBottomWidth: '1px',
    padding: '0px'
    },
    show: true,
    html: '<div id="de0161f6_e5a9_4b0a_961f_ec918981d5d3"><div></div></div>'
    }, autoRefresh: false });
    }
    Good luck, call us if needed!
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

  18. #18
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Quote Originally Posted by aburningflame View Post
    You are correct about eval_valid(Request.Variables...etc
    It should be eval_valid("VARIABLENAMEASCHARACTERSTRING") , what alpha does underneath is try to eval it, retrurns true if it evals (e.g the variable DOES indeed exist) and false otherwise.

    My mistake
    SO yes, use
    if eval_valid("Request.Variables.varname")

    "How would I go about creating a link that will automatically login the user (which redirects to my tabbed UI), open the proper tab in the tabbed ui, and then filter the grid to that record? I think I know how to make the grid filter once I get there but the rest of the process is a bit of a mystery at the moment." - THINK LONG AND HARD....Do you really want a link to automatically login the user (this would mean passing the password in the link)? This is a HUGE, I stress, HUGE security hole.

    Are you sure you dont want to link to the LOGIN page, make the user enter their password, and THEN automatically open the tab in the proper page etc?
    Hi Scott,
    Thanks again for your help so far.
    I understand what you are saying about it being a huge security hole. I was only thinking about encrypting the password and stuff before but after thinking some more I realize that someone could actually share that link. That would be the problem. Unless it could expire after a certain time or after one login.

    I suppose I should stick with going through the login component. I do wonder if I could make a happy medium though. Say a user is already logged in (which most of mine are, all day), the link would just redirect him/her to that particular place in my app.

    Anyway, I'll read carefully over your posts again and see what I can come up with.

    Thanks!

  19. #19
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Not a problem.
    I do wonder if I could make a happy medium though. Say a user is already logged in (which most of mine are, all day), the link would just redirect him/her to that particular place in my app.
    Use the method I outlined above, on the login page do this:

    login.a5w
    Code:
    if eval_valid("Request.Variables.r") then
         session.__protected__redirect=urldecode(Request.Variables.r) 'store the variable
        if eval_valid("session.__protected__ulink") then
                'any other code ot ENSURE user is logged in (sometimes ulink is valid but is set to 0 or something, so make sure you handle whatever cases you need to
                response.redirect("main.a5w")  ' were already logged in, redirect to main 
                end 'stop any further processing of the page (stop fallthrough effects)
        end if    
       
           
    end if
    Process:
    Already Logged IN: Link > Login Page > Login Page will set Session Variable and Redirect to Main > Main will open tab pane based on presence of session variable
    NOT logged in: Link > Login Page > Login Page sets Session variable > Enter password and login > Successful login redirects to main > Main opens tab page based on presence of session variable

    If they are already logged in, they will just be redirect to the page

    Goodluck
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

  20. #20
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    Thanks again.

    I wonder if I can edit an included page in my tabbed ui as the tabbed ui a5w won't save any changes to it. It just get's overwritten. I have a "logged in as" page included in my header. I would "think" it would allow me to make "button clicks" in javascript or what have you in the tabbed ui but I guess I'll see.

  21. #21
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Re: Help creating a link that "Approves" a record or a link that autologins and filte

    In short, yes you can.

    In the tabbed UI head section use this code:
    <%a5 a5w_include("tabbed_ui_header.a5w") %> or wherever.
    But yes youre correct the tabbed ui overwrites the tabbed ui page anytime you edit.
    I have inlcuded pages like that before in a tabbed ui head / body section
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

Similar Threads

  1. Can you remove/replace "New Record" link on grids??
    By Madbillz in forum Application Server Version 11 - Web/Browser Applications
    Replies: 5
    Last Post: 10-26-2012, 09:41 AM
  2. Error "Extra characters at end of expression" when LINK field is type "K"
    By RichCPT in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 10-29-2011, 01:11 AM
  3. How do I link data from tables "z","y"+"x" in set A to tables "x" + "z" in set B?
    By Nancy in forum Alpha Five Version 9 - Desktop Applications
    Replies: 2
    Last Post: 01-09-2009, 11:22 AM
  4. Active Link, tbl.query_create(), "Cannot use function in this context"
    By fsi in forum Alpha Five Version 9 - Desktop Applications
    Replies: 2
    Last Post: 05-25-2008, 11:55 AM
  5. Bug in V8? Create link in set, "child table in use" error
    By kthibeault1965 in forum Alpha Five Version 8
    Replies: 2
    Last Post: 10-02-2007, 10:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •