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

Users / web security / registered users / filtering lists on a logged in user

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

    Users / web security / registered users / filtering lists on a logged in user

    Does anyone have detailed instructions or a link to a video on how to tie the web security stuff to another table emplyoyee table (for example). Or could someone send me a generic .a5wcmp file so i can pick through it and figure it out.

    Ultimately, I want to filter list controls based on the current logged in user. My list is looking in the employee table for the employeeId and filtering on this. That part works, now how do I have Alpha associate that employeeId with a user in the websecurityusers table?

    Any help on this topic is much appreciated. I have been reading through tons of stuff but cant figure it out. I feel like the info i keep reading is for old versions and i'm not sure if its valid on AA12.3... Im also NOT advanced so keeping the terminology understandable for a new Alpha user is key here.

    Thanks,

    -Joe G.
    Alpha Anywhere V12.4.1 Build 3594-4665
    Application Server V12.4.1 Build 3594-4665 Running on Windows Server 2008 R2 Standard 4GB Ram X3430 @ 2.40GHz
    MySQL 5.5.38

    #2
    Re: Users / web security / registered users / filtering lists on a logged in user

    I think I can explain in simple text - in all of my applications I have the security framework, but also a local Users Table (called wt_users in my apps). That wt_users is tied to the security framework on Userid, which is their email address in my applications. I do not alter the security framework table ever. Then in your case I would add a field to my wt_users table for EmployeeID. That would tie wt_users to my employee table.

    Now when someone logs in, I get their login userid using a5ws_getcurrentuser() (or sometimes different methods), then I can get any value from either wt_users or employees using simple lookup functions. Then:

    dim empid as n = do a lookup to the wt_users table to get the empid
    dim empname as c = do a lookup to the employees table to get the employee name

    Lots of other methods to get the info.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: Users / web security / registered users / filtering lists on a logged in user

      Thanks Steve. I will use what you have given me and try to apply it to my ux.

      I think a big issue for me is there always seems to be 10 ways to do everything in Alpha.
      Some of them are easy, some complex, some are dated for old versions, some are opinions that others say are bad practice, and some might as well be in Chinese because I just don't get it!
      Alpha Anywhere V12.4.1 Build 3594-4665
      Application Server V12.4.1 Build 3594-4665 Running on Windows Server 2008 R2 Standard 4GB Ram X3430 @ 2.40GHz
      MySQL 5.5.38

      Comment


        #4
        Re: Users / web security / registered users / filtering lists on a logged in user

        That wt_users is tied to the security framework on Userid
        Steve,

        Could you explain this in detail a little further?
        Alpha Anywhere V12.4.1 Build 3594-4665
        Application Server V12.4.1 Build 3594-4665 Running on Windows Server 2008 R2 Standard 4GB Ram X3430 @ 2.40GHz
        MySQL 5.5.38

        Comment


          #5
          Re: Users / web security / registered users / filtering lists on a logged in user

          "tied" just means that security framework, specifically the websecurity_users table, and my wt_users table both have a field named USERID that contains the value used to login, known also as the username. So the USERID value Steve Wood in both security framework and wt_users is "[email protected]". When I login, the value of a5ws_getcurrentuser() is also [email protected], so I can use lookup to get anything I want from security framework or wt_users based on that USERID value.

          How I keep those values in sync, so that security framework and wt_users value for USERID is always in sync, is another matter. I don't mean to turn this in to a plug, but I use my own Framework to always keep USERID in sync from Registration on, including if the user goes to MyAccount and changes their USERID.

          The reason I have a wt_users table is because Alpha repeatedly says not to mess with their security framework tables. If that were not the case, I would just add fields to security framework (the websecurity_users table) for firstname, lastname, etc. But since I am told not to mess with those, I have my own wt_users table with those custom values.
          Steve Wood
          See my profile on IADN

          Comment


            #6
            Re: Users / web security / registered users / filtering lists on a logged in user

            In my case, the Userid in the websecurityusers (Alphas Security Framework) table is an email address like yours.

            I did not have a Userid field in the employee table. I do, however, already have an Email field in the employee table. I created a Userid in the employee table. Now, the Userid and the Email field are going to contain the same data. Im sure this is ok. Do I have one control populate the other with identical data? Or do I "tie" the employee.Email field to the websecurityusers.Userid field? Is it necessary that the field name be identical in both tables?
            Alpha Anywhere V12.4.1 Build 3594-4665
            Application Server V12.4.1 Build 3594-4665 Running on Windows Server 2008 R2 Standard 4GB Ram X3430 @ 2.40GHz
            MySQL 5.5.38

            Comment


              #7
              Re: Users / web security / registered users / filtering lists on a logged in user

              are you using dbf for security or sql?
              when you login the user name is available, as you have indicated it is an email address.
              now on the employee table you should have employee_id which is an autoincrement int ( that's what I use ) and an email address field which will contain the same email address as in the login part.
              now in dbf to get the employee_id you use
              employee_id = lookup("your_user_table","email_address='user_name_from_login'","employee_id")
              look at the single quotes inside the double quotes!
              in sql
              open connection etc.,
              SELECT id FROM your employee_table WHERE email_address = user_name_from_login

              that will give you the employee_id
              then you do whatever you want to do with that.
              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


                #8
                Re: Users / web security / registered users / filtering lists on a logged in user

                Steve I guess im still stuck at "so I can use lookup to get anything I want from security framework or wt_users based on that USERID value"

                It makes sense in my head but again I don't know how to put it into effect... Where do you define this "lookup"? Can you provide an example?

                Gandhi, I am using MySQL. I don't know how to define the WHERE clause. I have tried several things with no luck.
                Alpha Anywhere V12.4.1 Build 3594-4665
                Application Server V12.4.1 Build 3594-4665 Running on Windows Server 2008 R2 Standard 4GB Ram X3430 @ 2.40GHz
                MySQL 5.5.38

                Comment


                  #9
                  Re: Users / web security / registered users / filtering lists on a logged in user

                  Capture.JPGCapture2.JPG
                  ok so here is exactly what I have. How do I filter MYJOBSLIST with CurUser? Again, It is a MySQL database.
                  Last edited by joegrun4; 02-06-2015, 05:06 AM. Reason: swapped picture
                  Alpha Anywhere V12.4.1 Build 3594-4665
                  Application Server V12.4.1 Build 3594-4665 Running on Windows Server 2008 R2 Standard 4GB Ram X3430 @ 2.40GHz
                  MySQL 5.5.38

                  Comment


                    #10
                    Re: Users / web security / registered users / filtering lists on a logged in user

                    I do not know how panels work.
                    I do this in my mobile version
                    in the first page I have master list then the link selects particular item with detail in the next page they are connected and it is a single page application ( which in my opinion is the panel in alpha)
                    to do the where clause use it in your select statement
                    SELECT jobs FROM job_table WEHRE employee_id = :newEmployee
                    args.set ("newEmployee", the current user name)
                    cn.execute (sqlSelect,args)
                    then you can assign the result set to it.
                    as I said I do not know how panel work I cannot help there
                    I am sure steve will.
                    Last edited by GGandhi; 02-06-2015, 07:46 AM.
                    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


                      #11
                      Re: Users / web security / registered users / filtering lists on a logged in user

                      In a UX isn't this now all doable in the onlogin server side event using e.userNameFriendly, or e.username? I watched the 5 videos UX_V12-65, and experimented with the logincomponentmobilapp template that gets you to retrieving the user ID through the onlogin event. It would be helpful if the videos went one step further and provided a full example that retrieves an Id that is then used to filter related records in a list control of an embedded UX like the one shown in the videos.

                      Here's the scenario:
                      1)Sequel tables: salespersontbl, cusatomertbl, salesperson_has_customertbl.
                      2)Salesperson logs in username matches their email within the salespersontbl through a lookup the SP-Id is retrieved
                      3)The SP-Id is used in a second lookup to retrieve the related records within salesperson_has_customertbl
                      4) These matching records are retrieved from customertbl
                      5) The result set is used to populate a list control within a UX embedded in the login template component.

                      Extra credit: update, add, or delete a record from the list control in the customertbl, and salesperson_has_customertbl

                      This would bring filtering, adding, and updating linked records in linked table based on the logged in user into the future along with self driving google cars!
                      Bob

                      Comment


                        #12
                        Re: Users / web security / registered users / filtering lists on a logged in user

                        Joe,
                        I have only just this week solved the filtering issue with a logged in user, so I recognize your situation. I understand what is written in this post and have been watching videos on the subject.
                        All very good advice but I needed and example of how and where. With the bits and pieces I found, I finally managed to get things going the way I wanted.

                        I will try to give you an example of how I have done things.
                        Using latest build of Alpha Anywhere and MYSQL.
                        Created a Tabbed UI page with integrated Login.
                        Mainpage.png
                        This example has two frames because of different access rights of certain grid components.
                        Which frame is to be displayed is configured in Security Groups.
                        In this example the focus is on Frame 1 that is displayed when a coordinator is logged in.
                        The situation is that I have a table with employees from a certain company with several business units.
                        Each business unit has a coordinator, responsible for the employees in that unit.
                        A coordinator is only allowed access to employees in his/her business unit.
                        The coordinator details are stored in a table named "coordinator". (Comparable with wt_users as mentioned by Steve Wood.)
                        Under Web Security the user accounts are defined and assigned to a group "Coordinators".
                        Example is user "KON561".
                        In the coordinator table he is registered as Userid "KON561" and Contactname "Fred Olsen"
                        In order to being able to filter employees from business unit "561" a Server-Side Event onLogin is created on the Tabbed UI page.
                        onLogin.png
                        After successful Log in "session.var1" contains "561". This session variable can be used to Link the required employee records as shown in the first image under Link properties.

                        In my example each grid is a standard grid, showing all records. So you don't have to build a new grid but just apply the Link CON-ID (C)=session.var1.

                        Hope this example helps you in finding your way.
                        Jo Hulsen
                        Dommel Valley Solutions
                        The Netherlands

                        Comment

                        Working...
                        X