phpBMS

Changeset 727 for trunk/phpbms

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
Location:
trunk/phpbms
Files:
15 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/include/createmodifiedby.php

    r285 r727  
     1<?php if(isset($db) && isset($therecord)){?> 
    12<div id="createmodifiedby" > 
    23        <div id="savecancel2"><?php showSaveCancel(2)?></div> 
     
    67                                <input name="createdby" type="hidden" value="<?php $therecord["createdby"] ?>" /> 
    78                                <input name="creationdate" type="hidden" value="<?php echo formatFromSQLDatetime($therecord["creationdate"]) ?>"/> 
    8                                 created                  
     9                                created 
    910                        </td> 
    1011                        <td><?php echo htmlQuotes($phpbms->getUserName($therecord["createdby"]))?></td> 
     
    2324        </table> 
    2425</div> 
     26<?php }//endif ?> 
  • trunk/phpbms/include/tables.php

    r703 r727  
    822822                    case "save": 
    823823 
     824                        if(!hasRights($this->editroleid)) 
     825                            goURL(APP_PATH."noaccess.php"); 
     826                             
    824827                        $variables = $this->prepareVariables($_POST); 
    825828                        $errorArray = $this->verifyVariables($variables); 
  • trunk/phpbms/install/generateuuids.php

    r721 r727  
    667667//============================================================================== 
    668668 
    669 if(!isset($noProcess)){ 
     669if(!isset($noOutput)){ 
    670670    $genUUIDS = new generateUUIDS(); 
    671671    echo $genUUIDS->process(); 
  • trunk/phpbms/modules/base/adminsettings_ajax.php

    r649 r727  
    9797 
    9898}//end class 
    99 /*--[Processing]-------------------------------------------------------------*/ 
    100 /*---------------------------------------------------------------------------*/ 
    101 if(!isset($_GET["m"])) 
    102     exit; 
    103 require_once("../../include/session.php"); 
    10499 
    105 $checkUpdate = new checkUpdate($db); 
    106 $response = array(); 
    107 if($checkUpdate->needUpdateCheck($_GET["m"])){ 
    108     $response = $checkUpdate->checkForUpdate(); 
    109 }else{ 
    110     $response["checked"] = false; 
    111     $response = json_encode($response); 
    112 }//end if 
    113100 
    114 echo $response; 
     101/** 
     102 * Processing ================================================================== 
     103 */ 
     104if(!isset($noOutput)){ 
     105 
     106    require_once("../../include/session.php"); 
     107 
     108    $db->errorFormat = "json"; 
     109 
     110    if(!isset($_GET["m"])) 
     111        $error = new appError(200, "invalid passed paramaters", "", true, true, "json"); 
     112 
     113    if(!$_SESSION["userinfo"]["admin"]) 
     114        $error = new appError(970, "no rights to function", "", true, true, "json"); 
     115 
     116    $checkUpdate = new checkUpdate($db); 
     117    $response = array(); 
     118 
     119    if($checkUpdate->needUpdateCheck($_GET["m"])) 
     120        $response = $checkUpdate->checkForUpdate(); 
     121    else{ 
     122        $response["checked"] = false; 
     123        $response = json_encode($response); 
     124    }//end if 
     125 
     126    echo $response; 
     127 
     128}//endif 
    115129?> 
  • trunk/phpbms/modules/base/files_addedit.php

    r703 r727  
    6060 
    6161        $therecord = $thetable->processAddEditPage(); 
     62 
     63        if(!hasRights($therecord["roleid"])) 
     64            goURL("../../noaccess.php"); 
    6265 
    6366        if(isset($therecord["phpbmsStatus"])) 
  • trunk/phpbms/modules/base/notes_addedit.php

    r703 r727  
    3737 +-------------------------------------------------------------------------+ 
    3838*/ 
    39 //var_dump($_POST); 
    40 //exit; 
     39 
    4140        require_once("../../include/session.php"); 
    4241        require_once("include/fields.php"); 
     
    5857        $thetable = new notes($db, "tbld:a4cdd991-cf0a-916f-1240-49428ea1bdd1", $backurl); 
    5958        $therecord = $thetable->processAddEditPage(); 
     59 
     60        if($therecord["private"] && $therecord["createdby"] != $_SESSION["userinfo"]["id"] && !$_SESSION["userinfo"]["admin"]) 
     61            goURL("../../noaccess.php"); 
    6062 
    6163        if(isset($therecord["phpbmsStatus"])) 
  • trunk/phpbms/modules/base/scheduler_delete_logs.php

    r485 r727  
    4848}//end class --cleanImports-- 
    4949 
    50 if(!isset($noProcess)){ 
    51         $clean = new cleanSysLog($db); 
    52         $clean->removeExcessLogs(); 
     50if(!isset($noOutput) && isset($db)){ 
     51 
     52    $clean = new cleanSysLog($db); 
     53    $clean->removeExcessLogs(); 
     54 
    5355}//end if 
    5456?> 
  • trunk/phpbms/modules/base/scheduler_delete_tempimport.php

    r485 r727  
    2929}//end class --cleanImports-- 
    3030 
    31 if(!isset($noProcess)){ 
    32         $clean = new cleanImports($db); 
    33         $clean->removeTempCSV(); 
     31if(!isset($noOutput) && isset($db)){ 
     32 
     33    $clean = new cleanImports($db); 
     34    $clean->removeTempCSV(); 
     35 
    3436}//end if 
    3537?> 
  • trunk/phpbms/modules/base/tabledefs_columns.php

    r704 r727  
    4747 
    4848        if(!isset($_GET["id"])) 
    49                 $error = new appError(-200, "Passed parameter missing", "Invalid request", true); 
     49                $error = new appError(200, "Passed parameter missing", "Invalid request", true); 
    5050 
    5151        $columns = new tableColumns($db, $_GET["id"]); 
  • trunk/phpbms/modules/base/tabledefs_custom.php

    r704 r727  
    4545        //Make sure table definition id is set 
    4646        if(!isset($_GET["id"])) 
    47             $error = new appError(300,"Passed variable not set (id)"); 
     47            $error = new appError(200,"Passed variable not set"); 
     48 
     49        if(!hasRights("Admin")) 
     50                goURL(APP_PATH."noaccess.php"); 
    4851 
    4952        $customFields = new customFields($db, ((int) $_GET["id"])); 
  • trunk/phpbms/modules/base/tabledefs_groupings.php

    r704 r727  
    4343        include("include/tablegroupings.php"); 
    4444 
     45        if(!hasRights("Admin")) 
     46                goURL(APP_PATH."noaccess.php"); 
     47 
     48        if(!isset($_GET["id"])) 
     49                $error = new appError(-200, "Passed parameter missing", "Invalid request", true); 
    4550 
    4651        //grab the table name 
  • trunk/phpbms/modules/base/tabledefs_options.php

    r704 r727  
    4444        if(!isset($_GET["id"])) 
    4545                $error = new appError(100, "Passed Parameter not present."); 
     46 
     47        if(!hasRights("Admin")) 
     48                goURL(APP_PATH."noaccess.php"); 
    4649 
    4750        $options = new tableOptions($db, $_GET["id"]); 
  • trunk/phpbms/modules/base/tabledefs_searchfields.php

    r704 r727  
    4242        include("include/tabledefs_searchfields_include.php"); 
    4343 
     44        if(!hasRights("Admin")) 
     45                goURL(APP_PATH."noaccess.php"); 
     46 
     47        if(!isset($_GET["id"])) 
     48                $error = new appError(-200, "Passed parameter missing", "Invalid request", true); 
    4449 
    4550        $searchfields = new tableSearchFields($db, $_GET["id"]); 
  • trunk/phpbms/modules/recurringinvoices/scheduler_recurr.php

    r722 r727  
    415415//PROCESSOR 
    416416//============================================================================================= 
    417 if(!isset($noProcess)){ 
     417if(!isset($noOutput)){ 
    418418        $recurr = new recurr($db); 
    419419        $invoiceArray = $recurr->getInvoicesToRepeat(); 
  • 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.