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

Adding Users to Groups in Security

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

    #16
    Re: Adding Users to Groups in Security

    Rod,

    Many thanks for this--should this code work when updating info as well as inserting?

    Comment


      #17
      Re: Adding Users to Groups in Security

      Chris,

      The code as is will not work for updating. A few more steps would need to happen to pull the user information from the security .dbf and then update it. It if definitely possible. If I can find a few minutes, I will throw it up there but I currently do not see a hole in my schedule.

      Rod

      Comment


        #18
        Re: Adding Users to Groups in Security

        I've seen in the forum numerous questions about how to do this with a grid, so I'm quite glad to have it working for the insert piece, but I'm betting there's a lot of folks that would be equally grateful for the update side as well. That said, I don't have extra time in my day either, so I'm quite happy to have this even if the other side isn't readily available.

        thanks again.

        Comment


          #19
          Re: Adding Users to Groups in Security

          Here are three pages that can be used for registration and account control. The Alpha security is handled in the CanInsert, CanUpdate and CanDelete events. The downside to this is that the CanValidate events fire before the validation handlers on each field so all validation must be placed in these events. I created the validation for the fields in these component.

          Enclosed is a .dbf called user that just has a few fields. I would recommend limiting the fields to the bare minimum and creating a set or a view. I normally use SQL but did this to see how Alpha used .dbfs and to make it easier for posting.

          It could probably be tested better so let me know about any bugs.

          User Registration:
          The first one is called regdemo and is the regular register component. I changed from the last one I uploaded to put the security control piece in the CanInsertRecord event. If it is not added to security then the security message is displayed to the user. Assignment of groups and redirect pages are handled in the CanInsertRecord event because I would assume you would not want your users to have access to this. Security is set on this to Always Allow.

          User Change:
          The second component is called regupdatedemo and allows the user to change their email, password and security question. I probably cheated because I could not find an Alpha function that returned the password and I wanted to put in a little more security. The user is required to put in their password to make the changes and the component verifies the current password before allowing changes to be made. The current security is Always Allowed make sure to change it to Requires Login

          Account Administration:
          The third component is called regmasterdemo and will allow an administrator to add, update and delete users. Please change the component security as it is also Always Allowed.

          Let me know if you have any questions and I hope I can answer them. Looking over the code will give you a pretty good idea of how the security framework works.

          Rod

          Comment


            #20
            Re: Adding Users to Groups in Security

            Rod...
            Thanks for sharing!

            Where do you update the security questions? They show in preview until I try to edit the component. Once I go to working preview or publish they are gone.

            Comment


              #21
              Re: Adding Users to Groups in Security

              John,

              Sorry it took me awhile to respond, I changed my e-mail address and lost my privileges to post. Had to create another account.

              The first question would be do you have security questions turned on in your web security? The easiest way to find out is to go to the interactive window and type in this command - ?a5ws_User_File_Field_List(). It will list out the available security parameters. If secques, secans are not listed then turn them on in web security.

              Rod

              Comment


                #22
                Re: Adding Users to Groups in Security

                I added a Lock User Out method to the RegMasterDemo component.

                Comment


                  #23
                  Re: Adding Users to Groups in Security

                  Found a bug in the last upload. Forgot to release the lock!

                  Rod

                  Comment


                    #24
                    Re: Adding Users to Groups in Security

                    Hey Rod...
                    I keep getting "not a valid email address". Any idea what I am doing wrong?

                    Comment


                      #25
                      Re: Adding Users to Groups in Security

                      John,

                      Does it say "Invalid Email address" or "not a valid email address." If it is the first it is the regex expresssion in the CanUpdateRecord or CanInsertRecord validation. You can comment it out and re-test. If it is the second, I am not sure. Keep me posted.

                      Rod

                      Comment


                        #26
                        Re: Adding Users to Groups in Security

                        is definately says "not"

                        Comment


                          #27
                          Re: Adding Users to Groups in Security

                          Here are some screen shots...
                          I commented out the entire regex and still the same error
                          Last edited by jkeeter; 05-08-2010, 09:31 PM.

                          Comment


                            #28
                            Re: Adding Users to Groups in Security

                            Found this...how do you have this set in your project?
                            It must be in my security setting...
                            I made a little changes to the settings and I get this error now "user is must be unique"
                            Last edited by jkeeter; 05-08-2010, 09:58 PM.

                            Comment


                              #29
                              Re: Adding Users to Groups in Security

                              Originally posted by jkeeter View Post
                              is definately says "not"
                              If you have an invalid email address the rs = a5ws_Save_WebUser_Values(...) will return a system error message in: Result.ErrorHTML = rs.error_text

                              However, what is baffling is that your error message appears to be a "block" field error style - which is physically related to the field. As far as I know, a system security error is only returned to an icon, since system security has no way of knowing the physical location of the field on your form. That seems to suggest that you have field level validation turned on for the email field? Any insights into this?

                              Originally posted by jkeeter View Post
                              ...
                              It must be in my security setting...
                              I made a little changes to the settings and I get this error now "user is [id?] must be unique"
                              You must have already saved that user_id to security. Go to security settings, select utilities & import the security users & groups from local host. then click on Users & Groups" and check if it is already there.
                              Peter
                              AlphaBase Solutions, LLC

                              [email protected]
                              https://www.alphabasesolutions.com


                              Comment


                                #30
                                Re: Adding Users to Groups in Security

                                There is no reason to include your own data validation if you are using the function "a5ws_Save_WebUser_values()" as the function will test all of the validation defined in the Security Settings, including applying a uniqueness test to the user id. In fact, we recommend you do not all any validation to the security fields, as it is possible to add a validation that conflicts with the validation in the Security Settings.

                                If you just want to test the values being submitted, use the function "a5ws_Validate_WebUser_values()". It will run all of the validation tests but not save the values. The return pointer variable will have a true value for the .errors parameter, and a false if there are errors. If there are errors, the .error_text parameter will include the error messages defined in the Security Settings.

                                One of the important keys to making the functions work correctly is to ALWAYS submit a value for the user guid. If this is not supplied as an input value, the functions will consider the submission as a new record as it can't accurately determine if the record exists. ALWAYS include the security "guid" field in the fields for the component. This should be a hidden field, but it must be on the component.

                                Input values are values submitted in the "UserValue" or "request" variables as shown in the function help. Output values are returned in the "CurrentForm" or "output" as shown in the function help. As described above, the function returns errors in the output of the "result" variable. However, each output value in the "CurrentForm" will also show a result if there is an error. For example, if the validate function finds an error in the "UserId" field (Using Currentform as the name of the output variable), the following values will be returned.
                                Code:
                                CurrentForm.has_error = .T.
                                CurrentForm.Error_Message = error message from Security Settings
                                CurrentForm.Controls.userid.has_error = .T.
                                CurrentForm.Controls.userid.error_message = error message from Security Settings specific to this field
                                This was designed to use in a dialog component which will show the specific error messages by field. A dialog component will show the specific errors as "column heading: error message".

                                This offers some additional flexibility when the functions are used elsewhere as you can also add a value to the submitted values for the control column heading and have it returned as part of the error message. If you are using "output" instead of "CurrentForm",the code would partially look like this for "userid"
                                Code:
                                dim output.controls.userid.column.Heading as c
                                output.controls.userid.column.Heading = "Enter Your Login ID"
                                If the user id has an error such as a duplicate userid, the message would be returned in "output.Controls.userid.error_message" and have a value of "Enter Your Login ID: User ID must be unique"

                                Comment

                                Working...
                                X