phpBMS

Changeset 727 for trunk/phpbms/report

Show
Ignore:
Timestamp:
01/07/10 11:16:05 (2 years ago)
Author:
brieb
Message:
  • Added more rights look ups to certain pages
  • Fixed several path disclosure errors
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/report/report_class.php

    r703 r727  
    115115        $this->tabledefUUID = mysql_real_escape_string($tabledefUUID); 
    116116 
    117         if($reportUUID) 
    118             $this->retrieveReportSettings(); 
     117        $this->checkRights(); 
     118 
     119        $this->retrieveReportSettings(); 
    119120 
    120121    }//end function init 
    121122 
     123 
     124    /** 
     125     * function checkRight 
     126     * 
     127     * Checks report record and current user to make sure they have rights to run this report 
     128     */ 
     129     function checkRights(){ 
     130 
     131        $querystatement = " 
     132            SELECT 
     133                `roleid` 
     134            FROM 
     135                `reports` 
     136            WHERE 
     137                `uuid` = '".$this->reportUUID."' 
     138        "; 
     139 
     140        $queryresult = $this->db->query($querystatement); 
     141 
     142        if($this->db->numRows($queryresult)){ 
     143 
     144            $therecord = $this->db->fetchArray($queryresult); 
     145 
     146            if(!hasRights($therecord["roleid"])) 
     147                goURL(APP_PATH."noaccess.php"); 
     148 
     149        } else 
     150            $error = new appError(500, "Bad report uuid"); 
     151 
     152     }//end function checkRights 
    122153 
    123154    /** 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.