New call-to-action
Results 1 to 11 of 11

Thread: Security - Showing on the main screen AFTER sign in, sign off and the user name

  1. #1
    Member
    Real Name
    Roelof
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    763

    Default Security - Showing on the main screen AFTER sign in, sign off and the user name

    How can I after people have signed in, change the title from sign, for that user, to sign out and show the users name on the top of the page?

    Thanks
    Roelof

  2. #2
    Member StephenP's Avatar
    Real Name
    Stephen Pilon
    Join Date
    Apr 2000
    Location
    Front Royal, Virginia
    Posts
    491

    Default Re: Security - Showing on the main screen AFTER sign in, sign off and the user name

    Put code similar to the following on a page called something like "header.a5w" and use a5w_include() to include this head on each page.

    Code:
    if eval_valid("session.__protected__ulink") then
        dim user_info as c
        user_info = table.external_record_content_get("[PathAlias.ADB_Path]\user_table", "firstname-' '+lastname", "", "userid="+s_quote(session.__protected__ulink))
        ? "Logged in User: " + user_info - " (<a href=\"logout.a5w\">Logout</a>)"
    else
        ? "<a href=\"login.a5w\">Login</a>"
    end if
    Stephen Pilon
    Associate Librarian
    Christendom College

  3. #3
    Member
    Real Name
    Roelof
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    763

    Post Re: Security - Showing on the main screen AFTER sign in, sign off and the user name

    Thanks I really appreciate it.

    Question, how can I sign someone out when they click on the link?

    thanks

  4. #4
    Member StephenP's Avatar
    Real Name
    Stephen Pilon
    Join Date
    Apr 2000
    Location
    Front Royal, Virginia
    Posts
    491

    Default Re: Security - Showing on the main screen AFTER sign in, sign off and the user name

    Your logout.a5w page can be as simple as:

    Code:
    <%a5
    a5ws_logoutuser(session,request,response)
    response.redirect("login.a5w")
    %>
    you can also add a lot more to it, like tracking who's logged in/out (in conjunction with the login page), how long they were online, etc.
    Stephen Pilon
    Associate Librarian
    Christendom College

  5. #5
    Member
    Real Name
    Roelof
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    763

    Default Re: Security - Showing on the main screen AFTER sign in, sign off and the user name

    Stephen I am totally new to this. Where in the html do I put the include and do I have to put it in between <%5 and %>

    I am getting
    "Script Error
    Error:Script: /newproject.a5w line:5
    A5WINCLUDE header
    Variable "header" not found."

  6. #6
    Member
    Real Name
    Roelof
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    763

    Default Re: Security - Showing on the main screen AFTER sign in, sign off and the user name

    Quote Originally Posted by StephenP View Post
    Put code similar to the following on a page called something like "header.a5w" and use a5w_include() to include this head on each page.

    Code:
    if eval_valid("session.__protected__ulink") then
        dim user_info as c
        user_info = table.external_record_content_get("[PathAlias.ADB_Path]\user_table", "firstname-' '+lastname", "", "userid="+s_quote(session.__protected__ulink))
        ? "Logged in User: " + user_info - " (<a href=\"logout.a5w\">Logout</a>)"
    else
        ? "<a href=\"login.a5w\">Login</a>"
    end if
    And when I copy and paste your code AND sign in it does not show the name of the person.

    Any help would be appreciated.

  7. #7
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,656

    Default Re: Security - Showing on the main screen AFTER sign in, sign off and the user name

    Quote Originally Posted by Atta View Post
    And when I copy and paste your code AND sign in it does not show the name of the person.

    Any help would be appreciated.
    Roelof,

    It won't work if you don't have a custom user table called "user_table" with the fields: "firstname" and "lastname".

    This should work for you IF you have a session variable called __protected__ulink in your security settings:
    Code:
    <%A5 
    Dim vUser as c
    dim Request as p
    if eval_valid("session.__protected__ulink") 
        vUser = A5WS_Get_User_From_GUID(a5ws_Get_GUID_From_Ulink(session.__protected__ulink,Request),Request)
        ? vUser + " is logged in."
    else
        ? "ERROR: Not logged in !"
    end if
    %>
    The above code, in this case, is in the header section of a tabbed_ui component.

    I use this to logout by calling an a5w page from a tabbed_ui button:
    Code:
    <%a5
    a5ws_logoutuser(session,request,response)
    session.reset()
    response.redirect("index.a5w")
    %>

  8. #8
    Member
    Real Name
    Roelof
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    763

    Default Re: Security - Showing on the main screen AFTER sign in, sign off and the user name

    Peter REALLY appreciate your help.

    Of course there are always more questions.

    How do I make that data file just an DBF or can I make that as an SQL file?
    Ones I make it how can I enter data into it?

  9. #9
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,656

    Default Re: Security - Showing on the main screen AFTER sign in, sign off and the user name

    Quote Originally Posted by Atta View Post
    How do I make that data file just an DBF or can I make that as an SQL file?
    Ones I make it how can I enter data into it?
    If you want a user defined data file you can do it in SQL or dbf. But, in that case, remember you create the users on your related grid, and write back to the security tables using Alpha security functions.

  10. #10
    Member
    Real Name
    Roelof
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    763

    Default Re: Security - Showing on the main screen AFTER sign in, sign off and the user name

    Guys I really appreciate all of your input. But does anybody know a good link / documentation, where all of this is?

    Alpha5 is such an enormous product, that people like myself can create programs, but get stuck as soon as some programming needs to be done. I understand that that is what this website is for.

    It would be nice to have a video or documentation where a person could step through how to......

    I work at the big M and we are using it, but this product is so powerful and I am not capable of using all of the feautures. Some of my biggest issues are
    - Email
    - Getting information from one grid to use in another grid.

    If someone has some time I will pay for it to explain to me how to use/setup email I would appreciate it.

    Thanks

    PS Peter I agree with your statement concerning the subscription program. I just don't have the money to do that.

  11. #11
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,656

    Default Re: Security - Showing on the main screen AFTER sign in, sign off and the user name

    This tells you how to move web security over to MySql.

    http://alphafivewiki.com/a5/Using%20...20Security.pdf

Similar Threads

  1. the $ sign on JQuery and Alpha
    By mmaisterrena in forum Application Server Version 10 - Web/Browser Applications
    Replies: 5
    Last Post: 06-02-2010, 02:50 PM
  2. Displaying Plus sign
    By barry685 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 20
    Last Post: 03-04-2009, 10:13 PM
  3. £ sign
    By Ian_Edwards in forum Application Server Version 8
    Replies: 0
    Last Post: 05-23-2007, 01:27 PM
  4. £sign in component changes to ? in page
    By Robert Rough in forum Web Application Server v7
    Replies: 2
    Last Post: 03-17-2006, 12:34 PM
  5. currency sign
    By Ian_Edwards in forum Alpha Five Version 5
    Replies: 3
    Last Post: 07-21-2004, 09:44 AM

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
  •