Menu

4.1.6 Reports Menu

Help
Booma
2008-11-26
2013-05-30
  • Booma

    Booma - 2008-11-26

    I'm trying to make some of the reports in the Reports Menu only visible to registered users. I've gone to the Reports directory and opened the .xml files and changed <PGVReport access="PRIV_PUBLIC" to <PGVReport access="PRIV_USER" but the files I've changed can still be seen by the public.

    Is there something else I have to change to make this work?

    booma

     
    • Anonymous

      Anonymous - 2008-11-26

      I think the other thing you will need to do is delete the file phpgedview/index/reports.dat

      Its where PGV stores the list of reports available on your system. After you delete it PGV will recreate it automatically, and it should then include your restrictions.

       
    • Booma

      Booma - 2008-11-26

      Thank you kiwi that solves the problem.

      I've now moved all Reports to the USER status (none are visible to the public). I've edited the top links to hide the reports icon in the public view with

                        $uname = getUserName();
                                      if (! empty($uname)) {
              $menu = $menubar->getReportsMenu();
              if($menu->link != "") {
                  print "\t<td width=\"7%\" valign=\"top\">\n";
                  $menu->printMenu();
                  print "\t</td>\n";
                      }                 
             

      Is there a way to hide the Reports Icon in Options for Individuals on the Individuals page when viewed by the public?

       
      • Greg Roach

        Greg Roach - 2008-11-26

        I *think* you should be able to fix both issues together by editing class_menubar.php.

        At the top of the function getReportsMenu(), there is some code to return a null menu when
        reports aren't available or the visitor is a search-engine.

        You could change this to similarly reject non-logged-in users.

        Instead of getUserName(), it is simpler to use the constant PGV_USER_ID.
        This is zero for visitors and non-zero for users.

        So change

        if ((!file_exists("reportengine.php")) || (!empty($SEARCH_SPIDER))) {

        to something like

        if ((!file_exists("reportengine.php")) || !PGV_USER_ID) {

         
    • Greg Roach

      Greg Roach - 2008-11-26

      Oh, and this should do reports on the family page too.

       
    • Booma

      Booma - 2008-11-27

      Thanks fisharebest, seems to work okay. And it also hides the icon in the top link.

       
  • Eugene Fedorov

    Eugene Fedorov - 2010-01-11

    Thank you fisharebest, it was very useful for me too.

     

Log in to post a comment.