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 & Groups Issue

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

    Users & Groups Issue

    I am trying to find a way to give my users an update to my software without overwriting their "Defined Users and Groups". I am installing using Astrum and do not include data files or the runtime files for the update. Problem is, after installing the update their users/groups are deleted. Is there a solution? Thank you,

    Don

    #2
    Re: Users & Groups Issue

    Give them a button which runs

    A5_USER_GROUPS_DIALOG()

    and have them Export the users and goups before the update then import them after?
    There can be only one.

    Comment


      #3
      Re: Users & Groups Issue

      Stan,
      That is a possible solution... but, I don't want to leave it up to a user to do that. I'd rather they install my update like any other update for other software. But, you do give me an idea:

      In my programs, users are added, deleted, edited from a form (User Form) using Alpha's a5_add_new_user("mpassword", "John", "John"). I could just write a function to check that those users from my "user" table are in Alpha's "Defined Users and Groups". If they're not, just add them. If anyone has a better solution please let me know.

      Don

      Comment


        #4
        Re: Users & Groups Issue

        I don't want to leave it up to a user to do that
        Can the installer check for the existence of files before beginning? You might be able to code that they must create the user file, then install, then import, then the user file is deleted.

        I think users & groups export/import preserves existing user passwords. I don't think you can do that with the other functions.
        There can be only one.

        Comment


          #5
          Re: Users & Groups Issue

          I realized that my solution would only work if they first entered a generic username and password to open the program because their own usernames/passwords would no longer be there to login. Though, I could also create a startup script for that generic user to automatically add all the users/passwords/groups on first run... and then delete that generic user when complete.


          Don

          Comment


            #6
            Re: Users & Groups Issue

            A possible solution is:

            1. Export users data to a file every time the user exits. I do not know a way to do this automatically, but maybe someone else does.
            2. In your update, include a file called update.txt. This is a script to add the users, groups and passwords from the file created in step one. Alpha provides all the necessary funtions to do this. Update.txt is then used in script in next step
            3. Include in your autoexec file something like the following code (this was based on an article some years ago but I do not remember who wrote it so cannot give the appropriate acknowledgement).

            Code:
            vPath = a5.Get_Master_Path()
            IF a5.Get_Master_Path() = ""
            	vPath = a5.Get_Path()
            END IF
            vFileName = vPath + chr(92)+"update.txt"
            IF FileFind.get(vFileName)
            	vReturn = ui_msg_box("Up Date File Found","Proceed with update?",UI_ATTENTION_SYMBOL+UI_YES_NO)
            	IF vReturn = ui_no_selected
            		end
            	END IF
            ELSE
            	'ui_msg_box("No Update File Found","No update has been processed",UI_INFORMATION_SYMBOL)
            	end
            END IF
            vCmd = get_from_file(vFileName)
            file.remove(vFileName)
            vSuccess = evaluate_template(vCmd)
            IF vSuccess = "" 'will return "mMssing or invalid keyword" IF unsuccessful
            	ui_msg_box("Completed","Update was completed successfully",UI_INFORMATION_SYMBOL)
            ELSE
            	ui_msg_box("ERROR","Update did not complete successfully",UI_STOP_SYMBOL)
            END IF
            xbasic_wait_for_idle()
            END
            Hope this helps.
            Garry

            Comment


              #7
              Re: Users & Groups Issue

              This really is a major flaw in the built in insecurity module. I know it has made the wish list previously, requesting Alpha provide a way of updating without over writing.

              Not sure how easy it would be for Alpha as sometimes the things we think are easy can be found to be quite difficult especially when you have to take security into account.

              Comment


                #8
                Re: Users & Groups Issue

                Given that it is possible to export the users and groups within Alpha, I have little doubt that a new function from the Alpha team would be extremely easy to write.
                Garry

                Comment


                  #9
                  Re: Users & Groups Issue

                  Geoff, I agree it seems very odd that Alpha chose to put the user, group and password information in the database dictionaries, instead of using an external file.

                  In looking over the available xbasic functions I don't see a way to build a list of users with their current passwords. Is this possible?

                  Has anyone tried rebuilding the user, group, and password list from scratch? It seems to me that the installer might be able to run a script that opens the database, builds lists of users, groups, and passwords. Maybe it could then close the database and finish its installation. Then maybe it could re-open the database and delete all the users and groups. Finally, maybe it could re-build the user, group and password records using the previously created lists.

                  Comment


                    #10
                    Re: Users & Groups Issue

                    Tom,
                    Stan shows here how to import the security records. The only technical problem I see is how do you export the current security records with xbasic or AS given that there does not seem to be any functions.
                    Garry

                    Comment


                      #11
                      Re: Users & Groups Issue

                      Morning, Garry.

                      I don't see a function to get the passwords, was hoping others could point me to one.

                      Other functions exist to get lists of the groups, users, and the groups for each user. Seemingly these lists could be used to reconstruct the security framework using other functions to add groups, add users, and then assign users to groups. I think we have all the pieces we need to rebuild the framework from scratch (without using the high level import function) ... except for the passwords.

                      Review: I'm wondering about this sequence:
                      a) you capture lists of existing users, groups, and users' groups
                      b) you install an update and overwrite the existing users, groups, and users' groups
                      c) you run a script that deletes all users and groups
                      d) the same script rebuilds the groups, users, and users' groups from the lists captured in the first step

                      Seems possible. Don't know if anyone has tried...

                      Comment


                        #12
                        Re: Users & Groups Issue

                        The exportation of users, groups, and assignments seems straightforward enough, if a bit tedious to construct. The problem I see is that none of the functions reveals an exiting user's password.

                        This means to me that while you could export all the existing security info structure and reimport it, you would have to know the existing user passwords to reimplement them. Lacking those passwords you could always assign new passwords during the process.

                        Add an email field to the user table I attached in the other thread and you could email the users the passwords assigned to them.
                        There can be only one.

                        Comment


                          #13
                          Re: Users & Groups Issue

                          Hi Stan,

                          As you can import the same file that was exported.

                          Is there a way to create the same file outside of Alpha to Import?
                          Regards
                          Keith Hubert
                          Alpha Guild Member
                          London.
                          KHDB Management Systems
                          Skype = keith.hubert


                          For your day-to-day Needs, you Need an Alpha Database!

                          Comment


                            #14
                            Re: Users & Groups Issue

                            You can create the file any way you please as long as you save it as a .dbf table or import it into a .dbf table with the field names used in the script.


                            Here's the script to export the existing security, sans passwords.

                            Code:
                            master_pass = "test"
                            usrs = a5_get_users(master_pass)
                            tbl = table.open("ex_users")
                            FOR each foo in usrs
                            	grps = a5_get_user_assignments(master_pass,foo)
                            	FOR each nod in grps
                            		tbl.enter_begin()
                            		tbl.Master_password_ = master_pass
                            		tbl.User_name = foo.value
                            		tbl.User_password = "abc"
                            		tbl.Groups = nod.value
                            		tbl.enter_end(.t.)
                            	next
                            next
                            tbl.close()
                            So to your other question about overwriting existing user information, you should

                            export the existing security using the above
                            make any changes/additions - configure passwords to the exported table
                            install an update (which wipes out existing security ?)
                            import the table
                            Last edited by Stan Mathews; 09-24-2009, 09:09 AM.
                            There can be only one.

                            Comment


                              #15
                              Re: Users & Groups Issue

                              Stan,
                              Excellent work as usual!
                              Garry

                              Comment

                              Working...
                              X