| | 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 |