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

From Userentry table to Framework Security

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

  • From Userentry table to Framework Security

    I have read a few of the threads and some how, I can make a connection.
    A Member enters information in a enroll web page.
    It gets added to the member/salesperson table.
    The web security uses this table to confirm the name and password, it works.
    The user can not login unless I import the member table into the security framework. If I do, all is OK.
    Was there a thread to explain this task?
    Is there an automatic setting for this to happens?
    Does it require xbasic code to accomplish this task?
    DO this task is applied at the time the user presses "ADD"?

  • #2
    Re: From Userentry table to Framework Security

    I am attaching a sample with the web components.
    The table sales_page has an event to post to websecurity_users.

    From the desktop, if I add a user, it does post. The new user is not recognized during login.

    From the web page, if a user signs in, the table sales_page get updated, but not the websecurity_users.

    The first 3 users were imported from the websecurity setup. They can login.

    Is there a better way?

    Comment


    • #3
      Re: From Userentry table to Framework Security

      A (very) short course that may help:

      First, get a list of fields in your web security. Use Interactive window, like this:

      Code:
      ?a5ws_user_file_field_list()
      = Guid
      Password
      Ulink
      Userid
      Then in your dialog component's AfterValidate event, establish variables with matching names to hold these values (this example expects that you have the values in controls on the current form. There are other ways to get the values, depending on your design):

      Code:
      dim UserValues as p 
      UserValues.password = alltrim(currentform.Controls.password.value) 
      UserValues.ulink = alltrim(currentform.Controls.Ulink.value) 
      UserValues.UserID = alltrim(currentform.Controls.UserID.value) 
      UserValues.groups = a5ws_get_guid_from_group("member")
      The last line about "groups" will assign this user to the "Member" group.

      Then, save the values to the security table:

      Code:
      a5ws_save_webuser_values(CurrentForm,UserValues)
      -Steve
      sigpic

      Comment


      • #4
        Re: From Userentry table to Framework Security

        Thanks Steve, I am working on it. I will post it shortly.

        Comment


        • #5
          Re: From Userentry table to Framework Security

          Almost working.
          I tried to add the above codes to the events in the ENROLLNEW component. See attached picture. It did not work.

          After reading above instructions, I realize you are suggesting a DIALOG not the entry form itself.

          Note: I did get the same fields when using the ?a5ws_user_file_list()

          I did develop the dialog component and I did add the code so down.
          It did work as far as adding the record to the sales_page table and to the websecurity record. withe the following 3 problems

          a. The ulink is to have the em_id and I have no idea how to read the em_id after id added to the sale_page table (which is a self incrementing #.

          b. as a consequence the user can not log in.

          c. In the websecurity USERS & GROUPS, The record is shown, but
          it can not be edited, I get this error "NO USER IDENTIFICATION VALUE SPECIFIED"

          Questions:
          How to add the ULINK from the sales_page table after is added?

          In the code for the websecurity, did I miss something?

          ' ====== This code is used in the aftervalidate
          dim tbl as p
          tbl=table.open("[Pathalias.ADB_Path]\sales_page.dbf")
          tbl.enter_begin()

          tbl.display_name = alltrim(CurrentForm.Controls.display_name.value)
          tbl.picture_path = alltrim(CurrentForm.Controls. picture_path.value)
          tbl.banner_color = alltrim(CurrentForm.Controls. banner_color.value)
          tbl.banner_text = alltrim(CurrentForm.Controls. banner_text.value)
          tbl.username = alltrim(CurrentForm.Controls.username.value)
          tbl.pw = alltrim(CurrentForm.Controls.password.value)

          tbl.enter_end()

          tbl.close()

          dim uservalues as p
          uservalues.password = alltrim(currentform.controls.password.value)
          uservalues.ulink = alltrim(currentform.controls.username.value)
          uservalues.userid = alltrim(currentform.controls.username.value)
          uservalues.groups = a5ws_get_guid_from_group("users")

          a5ws_save_webuser_values(currentform,uservalues)

          CurrentForm.RedirectTarget = "loginpage.a5w"
          ' =============

          Comment


          • #6
            Re: From Userentry table to Framework Security

            OK, I've experimented for a while. I don't see a way to do this very directly from the grid. I won't be surprised to see someone suggest an easier way, but I also note that, if it's there, no one else has posted it here after a couple days. So here's one way that makes sense to me:

            (1) I built an employee table that included an extra field. I named it Ulink. Name it whatever you want - you'll see that it's just a field for query purposes.

            (2) Every record that gets added via the grid will have a blank Employee->Ulink field.

            (3) Set the grid's Update Setting property of Target Page to Security_Additions.A5W. I've attached that page here for your use/review.

            (4) When the grid records are saved, Security_Additions is called. I found that you can't use a5ws_save_webuser_values(currentform,uservalues) because "currentform" expects to be on a dialog component. So I just open and add records to the security table with standard Xbasic.

            The records that are added to security are the records with a blank Employee->Ulink field. After they're added, the Employee->Ulink filed gets filled so the record isn't queried again for this purpose. There are other and more elegant ways to do this, but this is quick/rough stuff.

            (5) Security_Additions.A5W then redirects to whatever target page you wish. I think the Xbasic in Security_Additions.A5W is pretty straightforward, but I'll be glad to help with any questions, etc.
            -Steve
            sigpic

            Comment


            • #7
              Re: From Userentry table to Framework Security

              Thanks, I will check this out.

              Comment


              • #8
                Re: From Userentry table to Framework Security

                I did this at the end of another long day, and remembered later that I left out a couple minor items - the pathalias and closing tables. Revised version is attached here.
                -Steve
                sigpic

                Comment


                • #9
                  Re: From Userentry table to Framework Security

                  I was not successful with Security_additions .

                  I tried to use it with the enrollnew webcomponent.

                  I did developed a dialog webcomponent called enroll_dlg and it does create the record in the sales_page, but does not create the websecurity record.
                  This is the code I did use in the webcomponent enroll_dlg, afterevent.

                  dim tbl as p
                  tbl=table.open("[Pathalias.ADB_Path]\sales_page.dbf")
                  tbl.enter_begin()
                  tbl.display_name = alltrim(CurrentForm.Controls.display_name.value)
                  tbl.picture_path = alltrim(CurrentForm.Controls.picture_path.value)
                  tbl.banner_color = alltrim(CurrentForm.Controls.banner_color.value)
                  tbl.banner_text = alltrim(CurrentForm.Controls.banner_text.value)
                  tbl.username = alltrim(CurrentForm.Controls.username.value)
                  tbl.pw = alltrim(CurrentForm.Controls.password.value)
                  tbl.enter_end()
                  tbl.close()
                  dim uservalues as p
                  uservalues.password = alltrim(currentform.controls.password.value)
                  uservalues.ulink = alltrim(currentform.controls.username.value)
                  uservalues.userid = alltrim(currentform.controls.username.value)
                  uservalues.groups = a5ws_get_guid_from_group("users")

                  a5ws_save_webuser_values(currentform,uservalues)

                  CurrentForm.RedirectTarget = "loginpage.a5w"

                  Is there a way to make this code to create the record in the websecurity?
                  Since we are using the a dialog could we get the em_id from the record just entered and then save it as the ulink?
                  If you notice above the ulink is taking the wrong source.
                  Will the GUI will be saved automatically when the record is created?

                  Attached is the application.

                  Just to mention the scope of the project as of now.

                  The first page is called FIRST.a5w and links to ENROLL new person by DLG.

                  Then upon enrolling it takes you to a loginpage. So you can login with the new username and PW, just entered. If successful, will show a grid. With the data just entered.

                  Right now it fails to create a websecuity record.

                  Let me ask, what would be the right way to accomplist this task?
                  Is my approach wrong?
                  I am open to suggestions

                  Thanks in anticipation, for all the efforts.

                  Comment


                  • #10
                    Re: From Userentry table to Framework Security

                    Jack -

                    My first response to you was how to implement security with a dialog component.

                    You then wrote that you were trying to do this with a grid component.

                    So then I built, and most recently presented, a way to do this with a grid component. Security_Additions.A5w can work with a dialog component, but that's not what I described.

                    Now you seem to be back to a dialog component.

                    I'm unclear what you're doing, and where you need additional help. Please specify: Are you going to do this with a grid or a dialog component?
                    -Steve
                    sigpic

                    Comment


                    • #11
                      Re: From Userentry table to Framework Security

                      I had prepared this while Steve was probably writing his response, but I will put it up anyway.

                      dim tbl as p
                      tbl=table.open("[Pathalias.ADB_Path]\sales_page.dbf")
                      tbl.enter_begin()
                      tbl.display_name = alltrim(CurrentForm.Controls.display_name.value)
                      'etc other statements here
                      tbl.enter_end()

                      myulink = tbl.em_id

                      tbl.close()

                      dim uservalue as p
                      uservalue.ulink = myulink
                      uservalue.groups = a5ws_get_guid_from_group("users")
                      uservalue.guid = ""
                      a5ws_save_webuser_values(currentform,uservalue)

                      You must have the following controls on your grid, hidden.

                      groups
                      guid
                      ulink

                      And these are normally for entry by the user.

                      userid
                      password
                      password_confirm
                      Any Other Fields you want

                      In my example, I did away with your username field and named it userid.

                      The security save function looks for those fields name. I save "" to the guid field to guarantee this is saved as a new user record.

                      I also include these functions:

                      Initialize event:
                      a5ws_get_webuser_values(currentform)

                      Validate Event:
                      a5ws_save_webuser_values(currentform)

                      This is important as they will automatically pull data from any existing user record and display, and in the Validate event, will test to ensure this is a unique record.
                      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)

                      Comment


                      • #12
                        Re: From Userentry table to Framework Security

                        Steve Working, I think you miss posting 5 Trying to follow your original suggestions to add to aftervalidate. I guess in the mean time you tried to build around the grid rather using a dialog.

                        Sorry for the failed communication.

                        I am posting the application and perhaps we can take a look where the problem is.

                        In the "FIRSTPAGE.aw5" I have the option to use any of the 3 options.
                        Originally my approach using a grid.
                        second you approach using a dialog.
                        and third Steve Wood option.

                        option 1 and 2 does almost the same as option 3.
                        3 seems to load better but it has the following problems:

                        a. you can not use the person created. It allows to login, but the salespers_grid do not display.
                        (probably because the websecurity_user table does not have a ulink.)

                        b. you can not edit the users created by option 3 in the websecurity control. you get the error "NO USER IDENTIFICATION VALUE SPECIFIED"

                        The only users you can edit are those that were imported and not created by any of the options.(the first4 users in the table)

                        You can see the difference in the field contents at the table "websecurity_user"

                        In the "enroll_dlgsw" I did add at initilalize event "a5ws_get_webuser_values(currentform)"
                        also I did add to validate event "a5ws_save_webuser_values(currentform)" but it gave errors so I did remove it.

                        It seems that when we save to websecurity_user, we are not sending the proper details.
                        How can we see what is being stored?

                        Help, help, help!!!!

                        Comment


                        • #13
                          Re: From Userentry table to Framework Security

                          I have accomplished the task. Thanks to both Steve.
                          I did review the lines of code and It works.
                          A person signs in and it creates the enroll record.
                          It does not create a framework record, yet it allows the person to log in and show only its records.

                          Something is wrong and yet it works. Why?

                          Comment


                          • #14
                            Re: From Userentry table to Framework Security

                            If they can log in, and security is turned on, then they ARE in the framework. Maybe the reason you can't see them is because, even when you publish to localhost, there are TWO copies of the framework user files. There is one sitting in your project which remainds unaffected by anything that happens online, and one at your published location, which contains records that control login.

                            If you open Web Control panel > Web Security, look for Utilities. This will let you import the localhost or server copy of your project security files. Then you will see them in Users and Groups.
                            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)

                            Comment


                            • #15
                              Re: From Userentry table to Framework Security

                              Thanks, I was wondering if there were 2 different tables at the 2 locations.
                              So If I were to backup, I will be backing up Both the desktop server side and the localhost as they are in under the same directory?

                              In actual use, (uploaded to a website) I would have to bring the framework users, before reloading the security tables. Correct?

                              Comment

                              Working...
                              X