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

Cannot Save Group GUID

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

  • Cannot Save Group GUID

    I have created a simple GRID to allow users to self register.

    I ask for their:
    Name
    Email (to be used as their user ID)
    Password

    The group they belong to is set to "applicant" until they they click on a link to register that is contained in an email that is sent to them.

    What I cannot get the code to do is to save the group GUID that is related to this applicant.


    Code:
    function OnGridInitialize as v (e as p)
    
    ''''' Ok now we need to make the security framework avaiable to the grid ''''''
    
    	dim request as p
    	dim session as p
    	dim response as p
    	request = e.tmpl.request
    	session = e.rv.session
    	'response = e.tmpl.response
    
    end function
    
    
    function AfterInsertRecord as v (e as p)
    
    '''' Ok lets write data to the security table '''''''
    
    	dim uservalue as p
     	dim uservalue.guid as c
     	dim uservalue.userid as c
     	dim uservalue.ulink as c
     	dim uservalue.group as c
     	dim uservalue.password as c
     	
     	dim groupGuid as c
     	groupGuid = a5ws_get_guid_from_group("applicant",request)
     	
     	uservalue.userid = e.DataSubmitted.userid
     	uservalue.ulink = e.DataSubmitted.userid
     	uservalue.group = groupGuid 
     	uservalue.password = e.DataSubmitted.password
      
      	dim output as p
    	dim output.controls as p
    	dim output.controls.guid.value as c 
    	dim result as p
    	
    	result = a5ws_Save_WebUser_Values(output,uservalue,e.GridDefinition.request)
    	if result.errors = .t.
    		result.errorHTML = result.error_test
    	end if
    	
    end function

    Code:
    Here is the results
    mysql> select * from myusers_groups;
    +---------------------+------------+
    | userid              | group_name |
    +---------------------+------------+
    | mn@gmail.com        | applicant  |
    | f@gmail.com         | applicant  |
    | admin@flowspec.net  | admin      |
    | mark@gmail.com      | applicant  |
    | bs@gmail.com        | applicant  |
    | freethink@gmail.com | NULL       |
    | sara@bigbbbs.com    | NULL       |
    | michael@gmail.com   | applicant  |
    +---------------------+------------+
    8 rows in set (0.06 sec)
    Please note that the groups marked NULL where added with my GRID only as where all of the other entries, but I used the group security tool to add them to the applicant group.

    In the debugger I can see that the GroupGUID that is being passed matches up in the the groups table.

    Code:
    mysql> select * from websecurity_groups where websecurity_groups.group_guid = "09b52013a54d41db98035048aff6a21a";
    +----------+----------------------------------+------------+--------+---------------------+
    | group_id | group_guid                       | group_name | updweb | updlocal            |
    +----------+----------------------------------+------------+--------+---------------------+
    |        2 | 09b52013a54d41db98035048aff6a21a | applicant  | NULL   | 2010-12-14 23:14:06 |
    +----------+----------------------------------+------------+--------+---------------------+
    1 row in set (0.00 sec)
    Any help here would be greatly appreciated.

    Thanks,

    Michael Carroll

    www.redrocksbluesky.com
    michael.vision360@gmail.com
    435-275-5170
    Last edited by MichaelCarroll; 12-15-2010, 04:36 AM.

  • #2
    Re: Cannot Save Group GUID

    Going out of my mind on this. When I use the function:

    a5ws_Save_WebUser_Values(output,uservalue,e.GridDefinition.request)

    as per this discussion post:
    http://msgboard.alphasoftware.com/al...10&postcount=4

    It writes the correct information to the websecurity_users table, but it does not write any data at all to the websecurity_members table. If I use the web security, users and groups tool I can freely add groups to the users I have registered. The users that save from the GRID do show up correctly also here.

    If the MySQL table websecurity_members was configured incorrectly I could not have the web security users and groups tool write to it correctly

    Am I missing something?

    Thanks,

    Michael Carroll

    www.redrocksbluesky.com
    michael.vision360@gmail.com
    435-275-5170

    Comment


    • #3
      Re: Cannot Save Group GUID

      Mike,

      Am I missing something? Why don't you update the mysql tables? Isn't that the purpose of having set it up that way? That is how I do it and so far no problems.
      Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

      Comment


      • #4
        Re: Cannot Save Group GUID

        Originally posted by frankbicknell View Post
        Mike,

        Am I missing something? Why don't you update the mysql tables? Isn't that the purpose of having set it up that way? That is how I do it and so far no problems.
        Frank,

        That is what I ended up doing -- writing directly to the tables via SQL.

        Thanks,

        Michael Carroll

        www.redrocksbluesky.com
        michael.vision360@gmail.com
        435-275-5170

        Comment


        • #5
          Re: Cannot Save Group GUID

          Originally posted by frankbicknell View Post
          Mike,

          Am I missing something? Why don't you update the mysql tables? Isn't that the purpose of having set it up that way? That is how I do it and so far no problems.
          Frank,

          How do you encrypt the password field so that the password shows up encrypted when you do a select * from minimalist.websecurity_users;

          Regards,

          Michael Carroll

          www.redrocksbluesky.com
          www.theminimalistrunner.com
          michael.vision360@gmail.com
          435-275-5170

          Comment


          • #6
            Re: Cannot Save Group GUID

            My pws are not encrypted at this time. I know there is an algorithm to encrypt and decrypt but I don't know where to find it. My system is only used by my people right now and my databases are behind a firewall so it is not quite as risky for me to use plain pws. I would like to encrypt if someone can share the method.
            Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

            Comment


            • #7
              Re: Cannot Save Group GUID

              Michael,

              As far as I know, the web-security works with dbf files stored in the application folder on the application server. It does not work with mysql tables, I think, unless there is a recent update to handle this.

              Your concern has been my concern as well for a long time and in fact am thinking of making a basic user handler project and uploading on the forums for others to improve upon it.

              Yesterday only I made one using a Dialog component from the description in the alpha help - Add Users with a web component. This uses a Dialog Component, which is considered outdated by alpha's enhancement in the detail views. This worked perfectly to add users and added a GUID as well.
              This also updates the group memberships. No problems.

              However, this works on existing groups only. If you want to add a new group and then do something, or edit existing record, I could not do it.

              I made a grid component with a detail view and tried using the same functions, as described in the help, but could not get it to update the GUID. I to am stuck here now.

              All this while I used the system generated dbfs and not SQL or MySQL tables, which is my knowledge does not control the internal security of the alpha. Only you can use these with a link field 'Ulink' to process other information about users, if you need.

              I would be curious to know more on this. I am sharing my experience (whatever little I have).

              Ah..by the way, you can put asterisks by checking the 'Is a password field' in the field properties of a grid or a detail view.

              CJ

              Comment


              • #8
                Re: Cannot Save Group GUID

                If this is the case then you would have had to write your own log in component as the reverse password decrypt algorithm would cause and error? Was this the case?

                If it was, what did you do to overcome this?


                Originally posted by frankbicknell View Post
                My pws are not encrypted at this time. I know there is an algorithm to encrypt and decrypt but I don't know where to find it. My system is only used by my people right now and my databases are behind a firewall so it is not quite as risky for me to use plain pws. I would like to encrypt if someone can share the method.

                Comment


                • #9
                  Re: Cannot Save Group GUID

                  CJ,

                  When you convert to SQL security the dbf files in the published directory (not the data directory) are the active linked tables that were created to basically ghost the system into believing it is still writing to dbf tables, but in fact you are writing to the SQl database. Anyway that is how I understand it.

                  Regards,

                  Michael Carroll

                  www.redrocksbluesky.com
                  www.theminimalistrunner.com
                  michael.vision360@gmail.com
                  435-275-5170


                  Originally posted by cjsingh View Post
                  Michael,

                  As far as I know, the web-security works with dbf files stored in the application folder on the application server. It does not work with mysql tables, I think, unless there is a recent update to handle this.

                  Your concern has been my concern as well for a long time and in fact am thinking of making a basic user handler project and uploading on the forums for others to improve upon it.

                  Yesterday only I made one using a Dialog component from the description in the alpha help - Add Users with a web component. This uses a Dialog Component, which is considered outdated by alpha's enhancement in the detail views. This worked perfectly to add users and added a GUID as well.
                  This also updates the group memberships. No problems.

                  However, this works on existing groups only. If you want to add a new group and then do something, or edit existing record, I could not do it.

                  I made a grid component with a detail view and tried using the same functions, as described in the help, but could not get it to update the GUID. I to am stuck here now.

                  All this while I used the system generated dbfs and not SQL or MySQL tables, which is my knowledge does not control the internal security of the alpha. Only you can use these with a link field 'Ulink' to process other information about users, if you need.

                  I would be curious to know more on this. I am sharing my experience (whatever little I have).

                  Ah..by the way, you can put asterisks by checking the 'Is a password field' in the field properties of a grid or a detail view.

                  CJ

                  Comment


                  • #10
                    Re: Cannot Save Group GUID

                    Originally posted by MichaelCarroll View Post
                    If this is the case then you would have had to write your own log in component as the reverse password decrypt algorithm would cause and error? Was this the case?

                    If it was, what did you do to overcome this?
                    In the web security configuration , settings uncheck Password Encryption under Password options.
                    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                    Comment


                    • #11
                      Re: Cannot Save Group GUID

                      Michael,

                      I do not think security is 'controlled' by SQL tables. I think the Apha WAS connects to the dbfs residing in its application folder to authenticate. If you make a ghost of these dbfs to a SQL server and somehow sync the two, it should be possible. Please search more on this forum on this subject, as I am not an expert on this. This is my understanding from the discussions on the forum in the past.


                      Regarding the login component, the alpha's in built component is good enough to handle this automatically. In the web security configuration, you can define if you want encryption or not and also the encryption key.

                      CJ

                      Comment

                      Working...
                      X