Menu

Person Privacy

Help
Ron Burek
2003-12-04
2003-12-04
  • Ron Burek

    Ron Burek - 2003-12-04

    Using: 2.61 beta 6 (Index mode) with phpLaunch

    I have a couple of users that have individuals in their family branches who wish to not have their names displayed due to their professional affiliation.  They are aggreeable to be viewed by authorized users only.

    I have tried to set the "add new person_privacy setting " of these individuals in the privacy module to "show only to authenticated users" but it doesn't hide them from the public.  I would even be happy with "living" instead of their name displayed.

    Have I missed a setting somewhere ?? or perhaps I misinterpret the intent of that setting ??

    Ron...

     
    • Phantomas

      Phantomas - 2003-12-04

      As John said in his message you can read if you click the following link:

      https://sourceforge.net/forum/message.php?msg_id=2316647

      you can set USE_RELATIONSHIP_PRIVACY to true in the privacy file and don't give the user a gedcom id.

      But this has the effect that the names of living persons are show. Only their details are set to privat.

      To John:

      Maybe an addition to the user-array like:

      $user["show_living"] = 'no';

      could do this work. This setting would hide names and details of living persons from the eyes of this selected user.

      For the compatibility with older authenticate.php - files this variable should be set to yes by default, even if it is not inluded in an user-array.

      Or we could add this as an array like the

      $user_privacy = array();

      into the privacy.php because this is a privacy setting.

      We could call this

      $living_privacy = array();

      and would handle it like the $user_privacy array with the edit_privacy.php.

      $living_privacy["john"] = $PRIV_HIDE;

      would hide all names and details of living persons from the eyes of the authenticated user "john" from our authenticate.php ;-)

      What do you think about this?

      bye, Kurt

       
    • John Finlay

      John Finlay - 2003-12-04

      Have you set $SHOW_LIVING_NAMES = $PRIV_USER in your privacy.php file.

      This would only work if they are living though.  Are the people you want to hide alive or dead?

      If they are dead, I don't have a way currently to hide their names.  But you could easily modify the privacy module to do this.

      Follow these steps:
      1. Set $SHOW_LIVING_NAMES=$PRIV_USER;
      2. Add them to the person_privacy array as you did before. 
      3. Then replace the showLivingName() and showLivingNameByID() functions with the following functions:

      //----------------------------------- showLivingName
      //-- should the names of living person be shown
      //-- returns true to show the name, returns false
      //-- to hide the name.  The default is to show the
      //-- names of living people
      function showLivingName($indirec) {
          global $SHOW_LIVING_NAMES, $PRIV_PUBLIC, $PRIV_USER, $PRIV_NONE;
         
          if ($SHOW_LIVING_NAMES>=$PRIV_PUBLIC) return true;
         
          //-- get the id from the record
          $ct = preg_match("/0 @(.*)@ INDI/", $indirec, $match);
          if ($ct>0) $pid = $match[1];
          else $pid=0;
         
          return showLivingNameByID($pid);
      }

      //----------------------------------- showLivingNameByID
      //-- should the names of living person be shown
      //-- returns true to show the name, returns false
      //-- to hide the name.  The default is to show the
      //-- names of living people
      function showLivingNameByID($pid) {
          global $SHOW_LIVING_NAMES, $PRIV_PUBLIC, $PRIV_USER, $PRIV_NONE;
         
          if ($SHOW_LIVING_NAMES>=$PRIV_PUBLIC) return true;
          $username = getUserName();
          if ((!empty($username))&&($SHOW_LIVING_NAMES>=$PRIV_USER)) return true;
          //-- admin users can see everything
          if (userIsAdmin($username)) return true;
          //-- check the person privacy array for an exception
          if (isset($person_privacy[$pid])) {
              switch ($person_privacy[$pid]) {
                  case $PRIV_PUBLIC:
                      return true;
                      break;
                  default:
                      return false;
                      break;
              }
          }
          return false;
      }

       
    • John Finlay

      John Finlay - 2003-12-04

      Kurt,

      Regarding having authenticated users who cannot see living people:

      I would prefer to store the setting in the privacy.php file.  That way they could see data in one gedcom but not in another.

      I also think we should use the same $user_privacy array but just have an ["all"] setting.  Something like this:
      $user_privacy["john"]["all"] = $PRIV_NONE;

      Then where we check the $user_privacy array we just have to check if if has been set for all pids.

      This could also be used to overide relationship privacy settings for a particular user.  Show you could give you mom access to everybody without making her an admin user.

      --John

       
      • Phantomas

        Phantomas - 2003-12-04

        John,

        As I understood:

        $user_privacy["john"]["all"] = $PRIV_NONE;
        means "john" ->can't<- see the details and also the fullname is marked as private for him, if he is only a user without admin rights.

        $user_privacy["john"]["all"] = $PRIV_USER;
        means "john" ->can<- see the details and also the fullname of all persons / living or dead, if he is a verified user and even if $USE_RELATIONSHIP_PRIVACY is set to "true" and john is not related to all persons in the gedcom.

        Am I right???

        But what will happen, if there are the following settings inside the privacy file?

        $user_privacy["john"]["all"] = $PRIV_USER;
        $user_privacy["john"]["I1"] = $PRIV_NONE;
        $user_privacy["john"]["I2"] = $PRIV_NONE;

        Will this prevent john from seeing the details of I1 and I2 even if he is allowed to see the details of all people inside the gedcom?

        Or what is with the following setting?
        $user_privacy["john"]["all"] = $PRIV_NONE;
        $user_privacy["john"]["I1"] = $PRIV_USER;
        $user_privacy["john"]["I2"] = $PRIV_USER;

        I could try to prevent such a constellation inside the edit_privacy if you want but what if an admin adds this settings into the privacy.php by editing the file with an editor?

        Or you could try to add the possiblity of such constellations inside the functions displayDetails() and displayDetailsByID().

        bye, Kurt

         

Log in to post a comment.