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

    #46
    Re: Adding Users to Groups in Security

    Eric...
    Regmasterdemo worked without any problems!!
    Last edited by jkeeter; 05-09-2010, 11:11 PM.

    Comment


      #47
      Re: Adding Users to Groups in Security

      disregard this post.
      Last edited by eswindhauser; 08-16-2010, 08:41 PM.

      Comment


        #48
        Re: Adding Users to Groups in Security

        Thanks for all the information above however I still can not get the Groups part to update even after working through Wiki as well. All other fields are updated correctly.

        Are there special functions (perhaps not documented on Wiki) that will just update Groups only?

        Why is a dialog successful and a grid is not?

        I am using a Grid with a Detail View with the latest VS10 patches.

        Comment


          #49
          Re: Adding Users to Groups in Security

          Ron,

          You got this thread going and set everyone on fire with your success story and uploads. I've tried your templates but they are not working in my county Nigeria. The user's registration form "regdemo" refuses to accept data in some of it's fields while the admin's form "regmasterdemo" those not show security question. Pls see attached.

          I've had a frustrated day trying to make this work.

          If I can just find a way to import or link data from my security table to DBF table, I will stay with my darling dialogue component for user's registration.

          Anyone out there knows how I can achieve this?

          Comment


            #50
            Re: Adding Users to Groups in Security

            Originally posted by jkeeter View Post
            Eric...
            Regmasterdemo worked without any problems!!
            Jkeeter,

            Please let us see your Regmasterdemo that worked without a problem. Kingly upload everything together with the database.

            Comment


              #51
              Re: Adding Users to Groups in Security

              It looks like this very interesting thread has been unjustifiably abandoned. The thread has attracted so much attention and that shows that web security is key to any web application project.

              To all those that say regmasterdemo is working, I want to say that it is not completely working. regmasterdemo is supposed to perform two functions: "add users" and "edit users". The "add users" aspect is working but the edit is not working. It edits only the dbf table but does not edit the security table. That is a malfunction.

              Now, what of regdemo and regupdatedemo? Both of them are not working.

              Rod did a great job opening up this thread. I wish to call on all alphaholic gurus in the house to please look into this thread and make regdemo, regupdatedemo and regmasterdemo work properly.

              The strong have to share knowledge to strengthen the week in order to grow our alphaholic family into a larger and stronger global phenomenon.

              God bless you.

              Comment


                #52
                Re: Adding Users to Groups in Security

                I apologize for the troubles that some of you might be having with regdemo or regupdatedemo. Both programs worked on my site and it was the best knowledge I had at the time. My goal was that others would make it better and we could all use the ensuing product. I have recoded regmasterdemo using the active link described at http://wiki.alphasoftware.com/a5/Usi...20Security.pdf.

                It creates a much cleaner component and gives the programmer more power. I have not had a chance to recode the other components but will eventually get to it. I have put the component regmast and the sql in the Code Archive section.

                The only tricky issue was I had to create a function called changegroup() which would insert or update the members table with any changes.

                Please feel free to make it better. I have been extremely busy but now have a little more time and will attempt to contribute to this thread.

                Rod

                Comment


                  #53
                  Re: Adding Users to Groups in Security

                  Rod, can you please share your "recoded" regmasterdemo.
                  Last edited by lampro77; 10-16-2010, 02:40 PM.

                  Comment


                    #54
                    Re: Adding Users to Groups in Security

                    This code works in the CanUpdateRecord grid event:
                    Code:
                    function CanUpdateRecord as v (DataSubmitted as P, Args as p, PageVariables as p, Result as p )
                    WITH PageVariables
                        ' check for empty fields
                        IF DataSubmitted.User_name = ""
                            Result.Cancel = .t.
                            Result.ErrorHTML = "<div>User Name is required </div>"
                        END IF
                        
                        IF DataSubmitted.User_name <> "PeterGreulich"
                            IF DataSubmitted.password = ""
                                Result.Cancel = .t.
                                Result.ErrorHTML = Result.ErrorHTML+"<div>Password is required </div>"
                            END IF
                            IF DataSubmitted.groups.dump() = ""
                                Result.Cancel = .t.
                                Result.ErrorHTML = Result.ErrorHTML+"<div>Please select one or more permissions </div>"
                            END IF
                            
                            ''check for spaces in user_name & password
                            IF    chr(32) $ DataSubmitted.User_name = .t.
                                Result.Cancel = .t.
                                Result.ErrorHTML = Result.ErrorHTML+"<div>The User Name may not have any spaces </div>"
                            END IF
                        
                            IF    chr(32) $ DataSubmitted.password = .t.
                                Result.Cancel = .t.
                                Result.ErrorHTML = Result.ErrorHTML+"<div>The Password may not have any spaces </div>"
                            END IF
                            
                            ''check password length
                            IF    Len(DataSubmitted.password) < 6
                                Result.Cancel = .t.
                                Result.ErrorHTML = Result.ErrorHTML+"<div>The Password must be at least 6 characters long </div>"
                            END IF
                            
                            IF    Len(DataSubmitted.password) > 20
                                Result.Cancel = .t.
                                Result.ErrorHTML = Result.ErrorHTML+"<div>The Password cannot be longer than 20 characters </div>"
                            END IF
                        END IF
                            
                    'add to Alpha Security
                    IF Result.Cancel = .f.    
                        dim uservalue as p
                        dim uservalue.guid as c
                        dim uservalue.ulink as c
                        
                        dim output as p
                        dim output.controls as p
                        dim output.controls.guid.value as c
                        
                        dim request as p
                        dim session as p
                        dim response as p
                        
                        dim vResults as p
                    
                        request = args.GridDefinition.request
                        session = PageVariables.session
                    '    response = args.GridDefinition.response
                    
                        uservalue.guid = a5ws_get_guid_from_ulink(DataSubmitted.ulink, request)
                        uservalue.ulink = DataSubmitted.ulink
                    
                        ''only dim security variables if they have been changed
                        IF DataSubmitted.password <> DataSubmitted.Oldpassword
                            dim uservalue.password as c
                            uservalue.password = DataSubmitted.password
                        END IF
                        
                        IF     DataSubmitted.user_name <> DataSubmitted.Oldusername
                            dim uservalue.userid as c
                            uservalue.userid = DataSubmitted.user_name
                        END IF    
                        
                        IF DataSubmitted.groups.dump() <> DataSubmitted.Oldgroups
                            dim uservalue.groups as c
                            uservalue.groups = DataSubmitted.groups.dump()
                        END IF
                    ''--------------------------------        
                        vResults = a5ws_Save_WebUser_Values(output,uservalue,Args.GridDefinition.request)
                        ''if not added to Alpha security do not save and display error message
                        IF vResults.errors = .T.
                            Result.Cancel = .t.
                            Result.ErrorHTML = vResults.error_text
                        END IF
                    END IF
                    
                    IF DataSubmitted.lock <> DataSubmitted.oldlock
                        IF DataSubmitted.lock = "True"
                            a5ws_LockOutUserSet(DataSubmitted.user_name)
                            DataSubmitted.lockdate = Now()
                        ELSE
                            a5ws_LockOutUserRelease(DataSubmitted.user_name)
                            DataSubmitted.lockdate = ""
                        END IF
                    END IF
                    
                    END WITH
                    END FUNCTION
                    ...and Rod was the guy who got me going on this. ;)
                    Peter
                    AlphaBase Solutions, LLC

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


                    Comment


                      #55
                      Re: Adding Users to Groups in Security

                      It is in the Code Archive section of the message board.

                      Comment


                        #56
                        Re: Adding Users to Groups in Security

                        RodMc and Peter.Greulich,

                        You guys are great guys and I applaud your efforts but I've tested your codes and found that they are still not working.

                        Regmasterdemo is for admin to add and edit users. It adds perfectly well but when you try to edit existing users, you get the following error message:

                        XHTTPRequest Error:

                        500 Internal Server Error

                        "Script ErrorError:Script: /RegisterMe/Default/__a5RunGrid.a5w line:35x_out = a5_ajax_grid(tmpl)Property not found
                        rtc.Parameters_Combined subelement not found."
                        When you change the codes in CanUpdateRecord to Peter.Greulich's codes, it still works fine to add new users but an attempt to edit an existing user generates the following error message:

                        Error executing CanUpdateRecord event handler: command: getpass = lookup("[security]\websecurity_user.dbf",passfilter,"password") error: lookup([security]\websecurity_user.dbf,ulink = '0',password) The system cannot find the path specified.
                        [security]\websecurity_user.dbf

                        Regdemo is for users to register themselves but it produces the following error message.

                        XHTTPRequest Error:

                        500 Internal Server Error

                        "Script ErrorError:Script: /RegisterMe/Default/__a5RunGrid.a5w line:35x_out = a5_ajax_grid(tmpl)Missing END FUNCTION command"

                        Regupdatedemo gives this error message:

                        Error executing CanUpdateRecord event handler: command: getpass = lookup("[security]\websecurity_user.dbf",passfilter,"password") error: lookup([security]\websecurity_user.dbf,ulink = '0',password) The system cannot find the path specified.
                        [security]\websecurity_user.dbf
                        If we can bring this thread to the point where these 3 components: regdemo, regupdatedemo and regmasterdemo work effectively we would be doing great service to our dear alphaholic family. Until then, this thread remains begging. We're making progress.
                        Last edited by lampro77; 10-16-2010, 11:09 PM.

                        Comment


                          #57
                          Re: Adding Users to Groups in Security

                          I too am having a problem with adding users to security.
                          I cannot seem to assign a user to a group. Everything else works fine.

                          I have tried the following script as an Xbasic script, but to no avail.
                          dim request.variables.userid as c
                          dim request.variables.email as c
                          dim request.variables.password as c

                          request.variables.userid = "[email protected]"
                          request.variables.email = "[email protected]"
                          request.variables.password = "password"

                          dim request.variables.groups as c
                          request.variables.groups = "Administrators"

                          dim output as p
                          dim output.controls as p
                          dim output.controls.guid.value as c

                          'The function will return the values saved as <pointer>.controls.<fieldname>.value. The result.errors value can be tested to determine if any errors occured during processing. Any error messages will be should in the result.error_text value.

                          dim result as p
                          dim error_message as c
                          dim group_list as c

                          result = a5ws_Save_User_Values(output,request)
                          if result.errors = .T. then
                          error_message = result.error_text
                          ui_msg_box("",error_message)
                          end
                          end if
                          user_guid = output.controls.guid.value
                          ui_msg_box("",user_guid)
                          I do have a group called Administrators, and I have security turned on, and I have the latest build.

                          Any thoughts?
                          Jay Talbott
                          Lexington, KY

                          Comment


                            #58
                            Re: Adding Users to Groups in Security

                            Jay,

                            I don't know how much it matters, but a5ws_Save_User_Values is deprecated, and you should now use a5ws_Save_WebUser_Values. May not matter, but its worth a try.
                            Stephen Pilon
                            Associate Librarian
                            Christendom College

                            Comment


                              #59
                              Re: Adding Users to Groups in Security

                              Thanks, Stephen, but no luck still.
                              Jay
                              Jay Talbott
                              Lexington, KY

                              Comment


                                #60
                                Re: Adding Users to Groups in Security

                                Originally posted by Jay Talbott View Post
                                Thanks, Stephen, but no luck still.
                                Jay
                                I seem to recall you have to specify the role guid
                                e.g.
                                dim groupGuid as c
                                groupGuid=a5ws_get_guid_from_group("Administrators",request)
                                userValue.groups=groupGuid
                                dim result as p
                                result=a5ws_save_webuser_values(output,uservalue,request)
                                https://appsbydesign.co.uk/

                                Comment

                                Working...
                                X