Read-Only access and other changes

Developers
2004-09-24
2013-04-24
  • John Finlay
    John Finlay
    2004-09-24

    I've added the following changes to the cvs code for gdbi.php.  These changes are backwards compatible, but provide serveral new features.

    1. Anonymous connect option.  You can now connect to PGV without specifying a username or password.  When connecting anonymously the readonly flag will automatically be set and privacy settings will be enforced by stripping down the returned gedcom records with anything that should not be displayed for privacy reasons.

    2. Read-only user connect.  A user no longer has to have editing rights on the gedcom to be able to connect.  Privacy will be enforced on the gedcom records before they are returned to the client.

    3. Read-only connect with readonly paramter.  During the 'connect' action a new 'readonly' paramter has been added that will force the connection to be read-only regardless of the connecting users access privileges.

    4. 'listgedcoms' action no longer requires 'connect' action.  This means that you can call the 'listgedcoms' action before the 'connect' action so that you can get the gedcoms available on the server before the user connects.  This would make it easier for a UI to provide a drop-down list of gedcoms so the user can choose which one to connect to.

    5. Set gedcom with 'ged' parameter during 'connect' action.  To make the ability to choose a gedcom less confusing, I have added the specific example of specifying the desired gedcom with the 'ged' parameter during the 'connect' action.

    I've also updated the documentation at http://www.phpgedview.net/racp.php with these changes and more detailed descriptions of the error codes that can be returned.

    --John

     
    • Daniel Kionka
      Daniel Kionka
      2004-09-24

      That sounds great!

      I have never used the version check other to verify PGV was working.  I was going to start using it for the earlier 'listgedcoms' problem.  It looks like I am going to have several version-dependent checks now, and hopefully more as you add new features in future releases.

       
    • Daniel Kionka
      Daniel Kionka
      2004-10-06

      I finally tried the anonymous connection, and I found a bug.  It sometimes gives me records like:

      0 @F19@ FAM

      1 WIFE @I40@
      1 CHIL @I29@
      1 CHIL @I9999@
      1 CHIL @I54@
      1 NOTE Details about this person are private. Person
      al details will not be included.

      It inserts a blank line after the 0 line.  My parser is not very smart, so it sees F19 as a 1-line record, and sees the blank line as the start of the next record, and it fails because it has no xref.

      So besides fixing the parser, we should track down why PGV inserts blank lines.  There is another blank line after the 1 NOTE.

      To see what was removed, the actual record is:

      0 @F19@ FAM
      1 WIFE @I40@
      1 CHIL @I29@
      1 CHIL @I9999@
      1 CHAN
      2 DATE 02 Aug 2004
      3 TIME 20:24:59
      2 _PGVU gdbitest
      1 MARR
      2 PLAC xxxxx
      1 CHIL @I54@

       
    • John Finlay
      John Finlay
      2004-10-07

      This bug was in the privatize_gedcom() function in functions_privacy.php.  The privatize_gedcom function removes all private data from a gedcom record that the user does not have access too.  In this case the empty line was added because it was looking for a HUSB record, but this FAM doesn't have one.  I forgot to check for an empty case.

      I have committed a new functions_privacy.php file that will not have this bug.

      --John

       
    • Daniel Kionka
      Daniel Kionka
      2004-10-09

      The blank line in the middle is gone, but the blank line after the generated NOTE is still there.  I fixed the parser to ignore blank lines, but PGV should not generate any.