phpBMS

Show
Ignore:
Timestamp:
11/10/06 19:49:30 (6 years ago)
Author:
brieb
Message:

Implements #20. Needs heavy testing on install/update and trying different security options.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/loadsearch.php

    r155 r170  
    3838*/ 
    3939        require("include/session.php"); 
     40        require("include/common_functions.php"); 
    4041         
    4142        function deleteSearch($id){ 
     
    108109        }//end function 
    109110 
    110         function showLoad($tabledefid,$basepath,$userid,$accesslevel){ 
     111        function showLoad($tabledefid,$basepath,$userid,$securitywhere){ 
    111112                global $dblink; 
    112113                 
    113114                $querystatement="SELECT id,name,userid FROM usersearches  
    114                                                 WHERE tabledefid=".$tabledefid." AND type=\"SCH\" AND ((userid=0 and accesslevel<=".$accesslevel.") OR userid=\"".$userid."\") ORDER BY userid, name"; 
     115                                                WHERE tabledefid=".$tabledefid." AND type=\"SCH\" AND ((userid=0 ".$securitywhere.") OR userid=\"".$userid."\") ORDER BY userid, name"; 
    115116                $queryresult = mysql_query($querystatement,$dblink); 
    116117                if(!$queryresult) reportError(500,"Cannot retrieve saved search infromation"); 
    117118                 
     119 
     120                $querystatement="SELECT advsearchroleid FROM tabledefs WHERE id=".$tabledefid ; 
     121                $tabledefresult = mysql_query($querystatement,$dblink); 
     122                if(!$tabledefresult) reportError(500,"Cannot retrieve table definition information."); 
     123                $tableinfo=mysql_fetch_array($tabledefresult); 
    118124                 
    119125                ?> 
     
    132138                                        </p> 
    133139                                        <p> 
    134                                                 <textarea id="LSSQL" rows="8" cols="10" <?php if($_SESSION["userinfo"]["accesslevel"]<30) echo " readonly=\"readonly\""?>></textarea> 
     140                                                <textarea id="LSSQL" rows="8" cols="10" <?php if(!hasRights($tableinfo["advsearchroleid"])) echo " readonly=\"readonly\""?>></textarea> 
    135141                                        </p> 
    136142                                </td> 
     
    148154                switch($_GET["cmd"]){ 
    149155                        case "show": 
    150                                 showLoad($_GET["tid"],$_GET["base"],$_SESSION["userinfo"]["id"],$_SESSION["userinfo"]["accesslevel"]); 
     156                                $securitywhere=""; 
     157                                if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0) 
     158                                        $securitywhere=" AND roleid IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)";                     
     159                                showLoad($_GET["tid"],$_GET["base"],$_SESSION["userinfo"]["id"],$securitywhere); 
    151160                        break; 
    152161                        case "getsearch": 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.