phpBMS

Changeset 704

Show
Ignore:
Timestamp:
01/01/10 23:10:02 (2 years ago)
Author:
brieb
Message:
  • Fixed several SQL injection vulnerabilities
  • Fixed several XSS vulnerabilities due to PHP_SELF and REQUREST_URI
  • Fixed severa path disclosure errors
Location:
trunk/phpbms
Files:
44 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/advancedsearch.php

    r702 r704  
    1 <?php  
     1<?php 
    22/* 
    33 $Rev$ | $LastChangedBy$ 
     
    3737 +-------------------------------------------------------------------------+ 
    3838*/ 
    39         require("include/session.php"); 
    4039 
    41         function showSearch($tabledefid,$basepath,$db){ 
    42                 //First, grab table name from id         
    43                 $querystatement="SELECT querytable FROM tabledefs WHERE id=".$tabledefid; 
    44                 $queryresult = $db->query($querystatement); 
    45                 if(!$queryresult) $error = new appError(500,"Cannot retrieve Table Information"); 
    46                 $thetabledef=$db->fetchArray($queryresult); 
     40class advancedSearch{ 
    4741 
    48                 //Grab query for all columns 
    49                 $querystatement="SELECT * FROM ".$thetabledef["querytable"]." LIMIT 1"; 
    50                 $queryresult = $db->query($querystatement); 
    51                 if(!$queryresult) $error = new appError(500,"Cannot retrieve Table Information"); 
    52                 $numfields = $db->numFields($queryresult); 
    53                 for ($i=0;$i<$numfields;$i++) $fieldlist[]=$db->fieldTable($queryresult,$i).".".$db->fieldName($queryresult,$i); 
    54                 ?> 
    55                 <p align="right" style="float:right"> 
    56                         <input id="ASsearchbutton" type="button" onclick="performAdvancedSearch(this)" class="Buttons" disabled="disabled" value="search" />             
    57                 </p> 
     42    var $db; 
     43    var $tabledefid; 
    5844 
    59                 <p>match <select id="ASanyall" onchange="updateAS()"> 
    60                         <option value="and" selected="selected">all</option> 
    61                         <option value="or">any</option> 
    62                 </select> of the following rules:</p> 
    63                 <div id="theASCs"> 
    64                         <div id="ASC1"> 
    65                                 <select id="ASC1field" onchange="updateAS()"> 
    66                                         <?php  
    67                                                 foreach($fieldlist as $field){ 
    68                                                         echo "<option value=\"".$field."\" >".$field."</option>\n";}?> 
    69                                 </select> 
    70                                 <select id="ASC1operator" onchange="updateAS()"> 
    71                                          <option value="=" selected="selected">=</option> 
    72                                          <option value="!=">!=</option> 
    73                                          <option value=">">&gt;</option> 
    74                                          <option value="<">&lt;</option> 
    75                                          <option value=">=">&gt;=</option> 
    76                                          <option value="<=">&lt;=</option> 
    77                                          <option value="like">like</option> 
    78                                          <option value="not like">not like</option> 
    79                                 </select> 
    80                                 <input type="text" id="ASC1text" size="30" maxlength="255" onkeyup="updateAS()" value="" /> 
    81                                 <button type="button" id="ASC1minus" class="graphicButtons buttonMinusDisabled" onclick="removeLineAS(this)"><span>-</span></button> 
    82                                 <button type="button" id="ASC1plus" class="graphicButtons buttonPlus" onclick="addlineAS()"><span>+</span></button> 
    83                         </div> 
    84                 </div> 
    85                 <p> 
    86                         sql where clause<br/> 
    87                         <textarea id="ASSQL" style="width:99%" cols="90" rows="3" onkeyup="ASEnableSave(this)"></textarea>               
    88                 </p><?php                
    89         } 
     45    function advancedSearch($db, $tabledefid){ 
     46 
     47        $this->db = $db; 
     48        $this->tabledefid = (int) $tabledefid; 
     49 
     50    }//end function 
    9051 
    9152 
    92         if(isset($_GET["cmd"])){ 
    93                 switch($_GET["cmd"]){ 
    94                         case "show": 
    95                                 showSearch($_GET["tid"],$_GET["base"],$db); 
    96                         break; 
    97                 }//end switch 
    98         } 
     53    function display(){ 
     54 
     55        $querystatement = " 
     56            SELECT 
     57                `querytable` 
     58            FROM 
     59                `tabledefs` 
     60            WHERE 
     61                id=".$this->tabledefid; 
     62 
     63        $queryresult = $this->db->query($querystatement); 
     64 
     65        $thetabledef = $this->db->fetchArray($queryresult); 
     66 
     67        //Grab query for all columns 
     68        $querystatement = " 
     69            SELECT 
     70                * 
     71            FROM 
     72                ".$thetabledef["querytable"]." 
     73            LIMIT 1"; 
     74 
     75        $queryresult = $this->db->query($querystatement); 
     76 
     77        $numfields = $this->db->numFields($queryresult); 
     78 
     79        for ($i=0;$i<$numfields;$i++) 
     80            $fieldlist[]=$this->db->fieldTable($queryresult,$i).".".$this->db->fieldName($queryresult,$i); 
     81 
     82        ?> 
     83        <p align="right" style="float:right"> 
     84                <input id="ASsearchbutton" type="button" onclick="performAdvancedSearch(this)" class="Buttons" disabled="disabled" value="search" /> 
     85        </p> 
     86 
     87        <p>match <select id="ASanyall" onchange="updateAS()"> 
     88                <option value="and" selected="selected">all</option> 
     89                <option value="or">any</option> 
     90        </select> of the following rules:</p> 
     91        <div id="theASCs"> 
     92                <div id="ASC1"> 
     93                        <select id="ASC1field" onchange="updateAS()"> 
     94                                <?php 
     95                                        foreach($fieldlist as $field){ 
     96                                                echo "<option value=\"".$field."\" >".$field."</option>\n";}?> 
     97                        </select> 
     98                        <select id="ASC1operator" onchange="updateAS()"> 
     99                                 <option value="=" selected="selected">=</option> 
     100                                 <option value="!=">!=</option> 
     101                                 <option value=">">&gt;</option> 
     102                                 <option value="<">&lt;</option> 
     103                                 <option value=">=">&gt;=</option> 
     104                                 <option value="<=">&lt;=</option> 
     105                                 <option value="like">like</option> 
     106                                 <option value="not like">not like</option> 
     107                        </select> 
     108                        <input type="text" id="ASC1text" size="30" maxlength="255" onkeyup="updateAS()" value="" /> 
     109                        <button type="button" id="ASC1minus" class="graphicButtons buttonMinusDisabled" onclick="removeLineAS(this)"><span>-</span></button> 
     110                        <button type="button" id="ASC1plus" class="graphicButtons buttonPlus" onclick="addlineAS()"><span>+</span></button> 
     111                </div> 
     112        </div> 
     113        <p> 
     114                sql where clause<br/> 
     115                <textarea id="ASSQL" style="width:99%" cols="90" rows="3" onkeyup="ASEnableSave(this)"></textarea> 
     116        </p><?php 
     117 
     118    }//end function 
     119 
     120}//end class 
     121 
     122 
     123/** 
     124 * PROCESSING ================================================================== 
     125 */ 
     126require("include/session.php"); 
     127 
     128if(!isset($_GET["cmd"]) || !isset($_GET["tid"])) 
     129    $error = new appError(200, "passed parameters missing"); 
     130 
     131$as = new advancedSearch($db, $_GET["tid"]); 
     132$as->display(); 
    99133?> 
  • trunk/phpbms/choicelist.php

    r702 r704  
    3737 +-------------------------------------------------------------------------+ 
    3838*/ 
    39         require_once("include/session.php"); 
    40          
    41          
    42         class choiceList{ 
    43                 var $db; 
    44                  
    45                 function choiceList($db){ 
    46                         $this->db = $db; 
    47                 } 
    48          
    49          
    50                 function deleteList($listname){ 
    51                         $querystatement="DELETE FROM choices WHERE listname=\"".$listname."\" "; 
    52                         $queryresult=$this->db->query($querystatement); 
    53  
    54                         echo "ok"; 
    55                 } 
    56  
    57  
    58                 function addToList($listname,$value){ 
    59                         $querystatement="INSERT INTO choices (listname,thevalue) VALUES(\"".$listname."\",\"".$value."\") "; 
    60                         $queryresult=$this->db->query($querystatement); 
    61  
    62                         echo "ok"; 
    63                 } 
    64  
    65  
    66                 function displayList($queryresult,$blankvalue){ 
    67                         while($therecord=$this->db->fetchArray($queryresult)){ 
    68                                 $display=$therecord["thevalue"]; 
    69                                 $theclass=""; 
    70                                 if($therecord["thevalue"]==""){ 
    71                                         $display="&lt;".$blankvalue."&gt;"; 
    72                                         $theclass=" class=\"choiceListBlank\" "; 
    73                                 } 
    74                                 ?><option value="<?php echo $therecord["thevalue"]?>" <?php echo $theclass?>><?php echo $display?></option><?php 
    75                         }//end while 
    76                  
    77                 } 
    78                  
    79         function displayBox($listname,$blankvalue,$listid){ 
    80                 $blankvalue = str_replace("<","",$blankvalue); 
    81                 $blankvalue = str_replace(">","",$blankvalue); 
    82                  
    83                 $querystatement = "SELECT thevalue FROM choices WHERE listname=\"".$listname."\" ORDER BY thevalue;"; 
    84                 $queryresult = $this->db->query($querystatement); 
    85 ?> 
    86         <p id="MLListP"> 
    87                 <select id="MLlist" name="MLList" size="12" onchange="updateML(this)"> 
    88                         <?php $this->displayList($queryresult,$blankvalue)?> 
    89                 </select> 
    90         </p> 
    91         <p id="MLAddDelP"> 
    92                 <input type="button" id="MLDelete" name="MLDelete" value="delete" class="Buttons" disabled onclick="delML()" /><br/> 
    93                 <input type="button" id="MLInsert" name="MLInsert" value="insert" class="Buttons" onclick="insertML()"/> 
    94         </p> 
    95         <p id="MLAddTextP"> 
    96                 <input name="MLaddedit" id="MLaddedit" type="text"/> 
    97                 <input name="MLblankvalue" id="MLblankvalue" type="hidden" value="<?php echo $blankvalue?>"/> 
    98         </p> 
    99         <p id="MLAddP"> 
    100                 <input type="button" id="MLaddeditbutton" name="MLaddeditbutton" value="add" class="Buttons" onclick="addeditML('<?php echo $blankvalue?>')" /> 
    101         </p> 
    102         <p id="MLStatus" class="small">&nbsp;</p> 
    103         <div align="right"> 
    104                 <input type="button" id="MLok" name="MLok" value="ok" class="Buttons" style="width:75px;" onclick="clickOK('<?php echo APP_PATH?>','<?php echo $listid?>','<?php echo $listname?>')"/> 
    105                 <input type="button" id="MLcancel" name="MLcancel" value="cancel" class="Buttons" style="width:75px;" onclick="closeBox('<?php echo $listid?>');"/>&nbsp; 
    106         </div> 
    107 <?php   }//end function 
    108                  
    109         }//end class 
    110          
    111          
    112  
    113          
    114  
    115  
    116         if(!isset($_GET["cm"]))  
     39 
     40 
     41class choiceList{ 
     42 
     43    var $db; 
     44 
     45    function choiceList($db){ 
     46 
     47                $this->db = $db; 
     48 
     49    }//end function init 
     50 
     51 
     52    function deleteList($listname){ 
     53 
     54        $deletestatement = " 
     55            DELETE FROM 
     56                `choices` 
     57            WHERE 
     58                `listname` = '".mysql_real_escape_string($listname)."' "; 
     59            $queryresult=$this->db->query($querystatement); 
     60 
     61            echo "ok"; 
     62    }//end function deleteList 
     63 
     64 
     65    function addToList($listname, $value){ 
     66 
     67        $insertstatement = " 
     68            INSERT INTO 
     69                `choices`( 
     70                `listname`, 
     71                `choices` 
     72            ) VALUES ( 
     73                '".mysql_real_escape_string($listname)."', 
     74                '".mysql_real_escape_string($value)."' 
     75            )"; 
     76 
     77        $this->db->query($insertstatement); 
     78 
     79        echo "ok"; 
     80 
     81    }//end function addToList 
     82 
     83 
     84    function displayList($queryresult, $blankvalue){ 
     85 
     86        while($therecord = $this->db->fetchArray($queryresult)){ 
     87 
     88            $display = $therecord["thevalue"]; 
     89            $theclass = ""; 
     90 
     91            if($therecord["thevalue"]==""){ 
     92 
     93                $display = "&lt;".$blankvalue."&gt;"; 
     94                $theclass = ' class="choiceListBlank" '; 
     95 
     96            } 
     97 
     98            ?><option value="<?php echo $therecord["thevalue"]?>" <?php echo $theclass?>><?php echo $display?></option><?php 
     99 
     100        }//end while 
     101 
     102    }//end function displayList 
     103 
     104 
     105    function displayBox($listname, $blankvalue, $listid){ 
     106 
     107        $blankvalue = str_replace("<","",$blankvalue); 
     108        $blankvalue = str_replace(">","",$blankvalue); 
     109 
     110        $querystatement = " 
     111            SELECT 
     112                thevalue 
     113            FROM 
     114                choices 
     115            WHERE 
     116                listname='".mysql_real_escape_string($listname)."' 
     117            ORDER BY 
     118                thevalue"; 
     119 
     120        $queryresult = $this->db->query($querystatement); 
     121 
     122        ?> 
     123        <p id="MLListP"> 
     124                <select id="MLlist" name="MLList" size="12" onchange="updateML(this)"> 
     125                        <?php $this->displayList($queryresult, $blankvalue)?> 
     126                </select> 
     127        </p> 
     128        <p id="MLAddDelP"> 
     129                <input type="button" id="MLDelete" name="MLDelete" value="delete" class="Buttons" disabled onclick="delML()" /><br/> 
     130                <input type="button" id="MLInsert" name="MLInsert" value="insert" class="Buttons" onclick="insertML()"/> 
     131        </p> 
     132        <p id="MLAddTextP"> 
     133                <input name="MLaddedit" id="MLaddedit" type="text"/> 
     134                <input name="MLblankvalue" id="MLblankvalue" type="hidden" value="<?php echo $blankvalue?>"/> 
     135        </p> 
     136        <p id="MLAddP"> 
     137                <input type="button" id="MLaddeditbutton" name="MLaddeditbutton" value="add" class="Buttons" onclick="addeditML('<?php echo $blankvalue?>')" /> 
     138        </p> 
     139        <p id="MLStatus" class="small">&nbsp;</p> 
     140        <div align="right"> 
     141                <input type="button" id="MLok" name="MLok" value="ok" class="Buttons" style="width:75px;" onclick="clickOK('<?php echo APP_PATH?>','<?php echo $listid?>','<?php echo $listname?>')"/> 
     142                <input type="button" id="MLcancel" name="MLcancel" value="cancel" class="Buttons" style="width:75px;" onclick="closeBox('<?php echo $listid?>');"/>&nbsp; 
     143        </div> 
     144        <?php 
     145 
     146    }//end function 
     147 
     148}//end class 
     149 
     150 
     151 
     152 
     153 
     154if(!isset($noOutput)){ 
     155 
     156    require_once("include/session.php"); 
     157    $thelist = new choiceList($db); 
     158 
     159    if(!isset($_GET["cm"])) 
     160        $error = new appError(200, "passed parameters not set"); 
     161 
     162    switch($_GET["cm"]){ 
     163 
     164        case "shw": 
     165 
     166            if(!isset($_GET["ln"])) 
     167                    $_GET["ln"]="shippingmethod"; 
     168 
     169            if(!isset($_GET["bv"])) 
     170                $_GET["bv"]="none"; 
     171 
     172            if(!isset($_GET["lid"])) 
     173                $_GET["lid"]=NULL; 
     174 
     175            $thelist->displayBox($_GET["ln"],$_GET["bv"],$_GET["lid"]); 
     176            break; 
     177 
     178        case "del": 
     179 
     180            if(!isset($_GET["ln"])) 
     181                $error = new appError(200, "passed parameters not set"); 
     182 
     183            $thelist->deleteList($_GET["ln"]); 
     184            break; 
     185 
     186        case "add": 
     187 
     188            if(!isset($_GET["ln"]) || !isset($_GET["val"])) 
     189                $error = new appError(200, "passed parameters not set"); 
     190 
     191            $thelist->addToList($_GET["ln"], $_GET["val"]); 
     192            break; 
     193 
     194    }//endswitch 
     195 
     196}//endif 
     197 
     198        if(!isset($_GET["cm"])) 
    117199                $_GET["cm"]="shw"; 
    118          
    119         if(!isset($_GET["ln"])) 
    120                 $_GET["ln"]="shippingmethod"; 
    121  
    122         if(!isset($_GET["bv"])) 
    123                 $_GET["bv"]="none"; 
    124          
     200 
     201 
     202 
    125203        $theList = new choiceList($db); 
    126          
     204 
    127205        switch($_GET["cm"]){ 
    128206                case "shw": 
     
    136214                break; 
    137215        } 
    138          
     216 
    139217?> 
  • trunk/phpbms/dbgraphic.php

    r702 r704  
    3737 +-------------------------------------------------------------------------+ 
    3838*/ 
    39         session_cache_limiter('private'); 
    40         require_once("include/session.php"); 
     39session_cache_limiter('private'); 
     40require_once("include/session.php"); 
    4141 
    42         if(!isset($_GET["t"]) or !isset($_GET["r"]) or !isset($_GET["f"]) or !isset($_GET["mf"])) die("Invalid Parameters Set"); 
     42if(!isset($_GET["t"]) or !isset($_GET["r"])) 
     43    $error = new appError(200, "passed parameters not set"); 
    4344 
    44         $querystatement="SELECT ".$_GET["f"].",".$_GET["mf"]." FROM ".$_GET["t"]." WHERE id=".$_GET["r"]; 
    45         $queryresult=$db->query($querystatement); 
    46         if(!$queryresult) die("bad query".$querystatement); 
    47         if($db->numRows($queryresult)){ 
    48                 $therecord=$db->fetchArray($queryresult); 
    49                 header('Content-type: '.$therecord[$_GET["mf"]]); 
     45switch($_GET["t"]){ 
    5046 
    51                 echo $therecord[$_GET["f"]]; 
    52         } 
     47    case "productThumb": 
     48        $table = "products"; 
     49        $fileField = "thumbnail"; 
     50        $mimeField = "thumbnailmime"; 
     51 
     52    case "productPic": 
     53        $table = "products"; 
     54        $fileField = "picture"; 
     55        $mimeField = "picturemime"; 
     56 
     57        break; 
     58 
     59    case "file": 
     60        $table = "files"; 
     61        $fileField = "file"; 
     62        $mimeField = "type"; 
     63        break; 
     64 
     65}//endswitch 
     66 
     67$id = (int) $_GET["r"]; 
     68 
     69$querystatement = " 
     70    SELECT 
     71        `".$fileField."` AS theFile, 
     72        `".$mimeField."` AS theMime 
     73    FROM 
     74        ".$table." 
     75    WHERE 
     76        id = ".$_GET["r"]; 
     77 
     78$queryresult = $db->query($querystatement); 
     79 
     80if($db->numRows($queryresult)){ 
     81 
     82    $therecord = $db->fetchArray($queryresult); 
     83 
     84    header('Content-type: '.$therecord["theMime"]); 
     85 
     86    echo $therecord["theFile"]; 
     87 
     88}//end if 
    5389?> 
  • trunk/phpbms/footer.php

    r285 r704  
    1 <?php if($phpbms->showFooter) {?> 
     1<?php 
     2    if(!isset($phpbms)) 
     3        exit(); 
     4 
     5    if($phpbms->showFooter) 
     6{?> 
    27<div id="footer"> 
    38        <p id="footerAbout"><a href="http://www.phpbms.org" target="_blank">phpBMS</a> By <a href="http://www.kreotek.com" target="_blank">Kreotek, LLC</a></p> 
  • trunk/phpbms/header.php

    r384 r704  
    1 <?php  
    2         if(!isset($pageTitle)) $pageTitle = APPLICATION_NAME; 
     1<?php 
     2        if(!isset($pageTitle)) 
     3            $pageTitle = APPLICATION_NAME; 
     4 
     5        if(!isset($phpbms)) 
     6            exit(); 
     7 
    38?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    49<html xmlns="http://www.w3.org/1999/xhtml"> 
     
    914        $phpbms->cssIncludes = array_merge(array("base.css"),$phpbms->cssIncludes); 
    1015        $phpbms->showCssIncludes(); 
    11          
     16 
    1217        $tempjsarray[] = "common/javascript/common.js"; 
    1318        $tempjsarray[] = "common/javascript/menu.js"; 
     
    1621        $tempjsarray[] = "common/javascript/moo/moo.fx.js"; 
    1722        $tempjsarray[] = "common/javascript/moo/moo.fx.pack.js"; 
    18          
     23 
    1924        $phpbms->jsIncludes = array_merge($tempjsarray,$phpbms->jsIncludes); 
    2025        $phpbms->showJsIncludes(); 
    21          
     26 
    2227        if(PERSISTENT_LOGIN && isset($_SESSION["userinfo"]["id"])) 
    2328                $phpbms->topJS[]="setLoginRefresh();"; 
    24                  
     29 
    2530        $phpbms->showExtraJs($phpbms->topJS); 
    26          
     31 
    2732        if($phpbms->onload) { 
    2833                ?><script language="JavaScript" type="text/javascript"> 
    29                         connect(window,"onload",function() {             
     34                        connect(window,"onload",function() { 
    3035                        <?php 
    3136                                        foreach($phpbms->onload as $theextra) 
     
    3843</head> 
    3944<body> 
    40 <?php  
     45<?php 
    4146 
    4247if($phpbms->showMenu){ 
    4348        include("include/menu_class.php"); 
    44          
     49 
    4550        $topMenu = new topMenu($db); 
    4651        $topMenu->display(); 
     
    5459                        </div> 
    5560                </div> 
    56         </div><?php  
     61        </div><?php 
    5762                $phpbms->bottomJS[]='var statusM=getObjectFromID("statusmessage"); 
    5863        var SMAni=new fx.Combo(statusM,{opacity:false,duration:500}); 
     
    6065        statusM.style.display="block"; 
    6166        SMAni.toggle();'; 
    62         } // end if  
    63          
     67        } // end if 
     68 
    6469        ?> 
    6570        <noscript> 
     
    6873                        <p>phpBMS requires JavaScript to be enabled.</p> 
    6974                </div> 
    70         </noscript><?php         
    71          
     75        </noscript><?php 
     76 
    7277}//end if showMenu 
    7378?> 
  • trunk/phpbms/include/fields.php

    r703 r704  
    8282    function startForm($pageTitle){ 
    8383 
    84         ?><form action="<?php echo str_replace("&","&amp;",$this->action) ?>" method="<?php echo $this->method?>" name="<?php echo $this->name?>" <?php 
     84        ?><form action="<?php echo htmlentities($this->action) ?>" method="<?php echo $this->method?>" name="<?php echo $this->name?>" <?php 
    8585                if($this->onsubmit !== NULL) { ?>onsubmit="<?php echo $this->onsubmit?>" <?php } 
    8686                if(isset($this->enctype)) echo ' enctype="'.$this->enctype.'" '; 
  • trunk/phpbms/include/imports.php

    r515 r704  
    457457                        function startForm($pageTitle, $pageType, $numberOfRecords = 0){ 
    458458 
    459                                 ?><form action="<?php echo str_replace("&","&amp;",$this->action) ?>" method="<?php echo $this->method?>" name="<?php echo $this->name?>" onsubmit="<?php echo $this->onsubmit?>" <?php 
     459                                ?><form action="<?php echo htmlentities($this->action) ?>" method="<?php echo $this->method?>" name="<?php echo $this->name?>" onsubmit="<?php echo $this->onsubmit?>" <?php 
    460460                                        if(isset($this->enctype)) echo ' enctype="'.$this->enctype.'" '; 
    461461                                        if(isset($this->id)) echo ' id="'.$this->id.'" '; 
  • trunk/phpbms/include/search_class.php

    r703 r704  
    304304                                 if($this->numrows==RECORD_LIMIT or $this->recordoffset!=0){ 
    305305                                    //if you max the record limit or are already offsetiing get the true count 
    306                                          
     306 
    307307                                        $truecountstatement = " 
    308308                                                SELECT 
     
    587587 
    588588                ?> 
    589 <form name="search" id="search" method="post" action="<?php echo $_SERVER["PHP_SELF"]?>?id=<?php echo $this->thetabledef["uuid"]?>" onsubmit="setSelIDs(this);return true;"> 
     589<form name="search" id="search" method="post" action="<?php echo htmlentities($_SERVER["PHP_SELF"])?>?id=<?php echo $this->thetabledef["uuid"]?>" onsubmit="setSelIDs(this);return true;"> 
    590590<input id="tabledefid" name="tabledefid" type="hidden" value="<?php echo $this->thetabledef["id"]?>" /> 
    591591<input id="theids" name="theids" type="hidden" value="" /> 
  • trunk/phpbms/index.php

    r702 r704  
    3838*/ 
    3939        require_once("include/session.php"); 
     40 
     41 
    4042        require_once("include/login_include.php"); 
    4143 
     
    5254 
    5355        }//endif 
     56 
     57 
     58        if(isset($_SESSION["userinfo"])) 
     59            goURL(DEFAULT_LOAD_PAGE); 
    5460 
    5561        $pageTitle = formatVariable(APPLICATION_NAME)." Log in"; 
     
    7480                </noscript> 
    7581 
    76                 <form name="form1" method="post" action="<?php echo $_SERVER["PHP_SELF"]?>"> 
     82                <form name="form1" method="post" action="<?php echo htmlentities($_SERVER["PHP_SELF"])?>"> 
    7783 
    7884                        <p> 
  • trunk/phpbms/modules/base/adminsettings.php

    r703 r704  
    145145?> 
    146146<div class="bodyline"> 
    147     <form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" enctype="multipart/form-data" id="record" name="record" onsubmit="return false;"> 
     147    <form action="<?php echo htmlentities($_SERVER["PHP_SELF"]); ?>" method="post" enctype="multipart/form-data" id="record" name="record" onsubmit="return false;"> 
    148148    <input type="hidden" id="command" name="command" value="save"/> 
    149149 
     
    270270                    <div class="fauxP"> 
    271271                        print logo 
    272                         <div id="graphicHolder"><img alt="logo" src="<?php echo APP_PATH?>dbgraphic.php?t=files&amp;f=file&amp;mf=type&amp;r=1" /></div> 
     272                        <div id="graphicHolder"><img alt="logo" src="<?php echo APP_PATH?>dbgraphic.php?t=file&amp;r=1" /></div> 
    273273                    </div> 
    274274 
  • trunk/phpbms/modules/base/attachments_records.php

    r703 r704  
    8080                $_POST["startnum"]=1; 
    8181        } elseif($_POST["desc"]!="")  $displayTable->querysortorder.=" DESC"; 
    82          
     82 
    8383        //record offset? 
    8484        if(isset($_POST["offset"])) if($_POST["offset"]!="") $displayTable->recordoffset=$_POST["offset"]; 
     
    9494        <h1><?php echo $pageTitle ?></h1> 
    9595        <div> 
    96                 <form name="search" id="search" action="<?php echo $_SERVER["REQUEST_URI"]?>" method="post" onsubmit="setSelIDs(this);return true;"> 
     96                <form name="search" id="search" action="<?php echo htmlentities($_SERVER["REQUEST_URI"])?>" method="post" onsubmit="setSelIDs(this);return true;"> 
    9797                <input name="theids" type="hidden" value="" /> 
    9898                <?php 
  • trunk/phpbms/modules/base/include/myaccount.php

    r646 r704  
    11<?php 
    22 
    3 function displayRoles($db){ 
    43 
    5         $uuid = $_SESSION["userinfo"]["uuid"]; 
     4class myAccount{ 
     5 
     6    var $db; 
     7    var $userUUID; 
     8 
     9    function myAccount($db, $userUUID){ 
     10 
     11        $this->db = $db; 
     12 
     13        $this->userUUID = $userUUID; 
     14 
     15    }//end function init 
     16 
     17 
     18    function displayRoles(){ 
    619 
    720        $querystatement = " 
     
    1225                        `roles` INNER JOIN `rolestousers` ON `rolestousers`.`roleid`=`roles`.`uuid` 
    1326                WHERE 
    14                         `rolestousers`.`userid` = '".mysql_real_escape_string($uuid)."' 
     27                        `rolestousers`.`userid` = '".$this->userUUID."' 
    1528                "; 
    16         $assignedquery = $db->query($querystatement); 
    17         while($therecord = $db->fetchArray($assignedquery)) 
     29 
     30        $queryresult = $this->db->query($querystatement); 
     31 
     32        while($therecord = $this->db->fetchArray($queryresult)) 
    1833                echo "<li>".$therecord["name"]."</li>"; 
    19 } 
    2034 
    21 function changePassword($variables,$id,$db){ 
    22         if(DEMO_ENABLED=="false"){ 
    23                 $querystatement="SELECT id FROM users WHERE id=".$id." AND password=ENCODE(\"".$variables["curPass"]."\",\"".mysql_real_escape_string(ENCRYPTION_SEED)."\")"; 
    24                 $queryresult=$db->query($querystatement); 
    25                 if($queryresult) 
    26                         if ($db->numRows($queryresult)){ 
    27                                 $querystatement="UPDATE users SET password=ENCODE(\"".$variables["newPass"]."\",\"".ENCRYPTION_SEED."\") WHERE id=".$id; 
    28                                 $queryresult=$db->query($querystatement); 
    29                                 return "Password Updated"; 
    30                         } else 
    31                                 return "Current Password Incorrect"; 
    32         } else 
    33                 return "Changing password is disabled in demonstration mode."; 
    34 } 
    35  
    36 function updateContact($variables,$id,$db){ 
    37         $querystatement="UPDATE users SET email=\"".$variables["email"]."\", phone=\"".$variables["phone"]."\" WHERE id=".$id; 
    38         $queryresult=$db->query($querystatement); 
    39         $_SESSION["userinfo"]["email"]=$variables["email"]; 
    40         $_SESSION["userinfo"]["phone"]=$variables["phone"]; 
    41         return "Contact Information Updated"; 
    42 } 
     35    }//end function displayRoles 
    4336 
    4437 
    45 if(isset($_POST["command"])) 
    46         switch($_POST["command"]){ 
    47                 case "Change Password": 
    48                         $statusmessage=changePassword(addSlashesToArray($_POST),$_SESSION["userinfo"]["id"],$db); 
    49                 break; 
    50                 case "Update Contact": 
    51                         $statusmessage=updateContact(addSlashesToArray($_POST),$_SESSION["userinfo"]["id"],$db); 
    52                 break; 
    53                 default: 
    54                         $statusmessage="\"".$_POST["command"]."\""; 
    55                 break; 
    56         } 
     38    function changePassword($oldPassword, $newPassword){ 
     39 
     40        if(DEMO_ENABLED !== "false") 
     41            return "Cannot change password when in demonstration mode."; 
     42 
     43        $querystatement = " 
     44            SELECT 
     45                `id` 
     46            FROM 
     47                `users` 
     48            WHERE 
     49                `uuid` = '".$this->userUUID."' 
     50                AND password = ENCODE('".mysql_real_escape_string($oldPassword)."', '".mysql_real_escape_string(ENCRYPTION_SEED)."')"; 
     51 
     52        $queryresult = $this->db->query($querystatement); 
     53 
     54        if($this->db->numRows($queryresult)){ 
     55 
     56            $updatestatement = " 
     57                UPDATE 
     58                    `users` 
     59                SET 
     60                    `password` = ENCODE('".mysql_real_escape_string($newPassword)."', '".mysql_real_escape_string(ENCRYPTION_SEED)."') 
     61                WHERE 
     62                    `uuid` = '".$this->userUUID."'"; 
     63 
     64            $this->db->query($updatestatement); 
     65 
     66            return "password changed"; 
     67 
     68        }else 
     69            return "Current password incorrect"; 
     70 
     71    }//end function changePassword 
     72 
     73 
     74    function update($variables){ 
     75 
     76        $updatestatement = " 
     77            UPDATE 
     78                `users` 
     79            SET 
     80                `email` = '".mysql_real_escape_string($variables["email"])."', 
     81                `phone` = '".mysql_real_escape_string($variables["phone"])."' 
     82            WHERE 
     83                `uuid` = '".$this->userUUID."'"; 
     84 
     85        $this->db->query($updatestatement); 
     86 
     87        $_SESSION["userinfo"]["email"] = $variables["email"]; 
     88        $_SESSION["userinfo"]["phone"] = $variables["phone"]; 
     89 
     90        return "Record Updated"; 
     91 
     92    }//end function update 
     93 
     94}//end class 
     95 
    5796?> 
  • trunk/phpbms/modules/base/modules_view.php

    r703 r704  
    6565 
    6666<div class="bodyline"> 
    67 <form action="<?php echo $_SERVER["PHP_SELF"] ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
     67<form action="<?php echo htmlentities($_SERVER["PHP_SELF"]) ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
    6868        <h1 id="topTitle"><span><?php echo $pageTitle ?></span></h1> 
    6969 
  • trunk/phpbms/modules/base/myaccount.php

    r703 r704  
    1 <?php  
     1<?php 
    22/* 
    33 $Rev: 186 $ | $LastChangedBy: brieb $ 
     
    4343require_once("include/myaccount.php"); 
    4444 
     45$user = new myAccount($db, $_SESSION["userinfo"]["uuid"]); 
     46 
     47if(isset($_POST["command"])){ 
     48 
     49    switch($_POST["command"]){ 
     50 
     51        case "Change Password": 
     52 
     53            if($_POST["newPass"] === $_POST["confirmPass"]) 
     54                $statusmessage = $user->changePassword($_POST["curPass"], $_POST["newPass"]); 
     55            else 
     56                $statusmessage = "New password not confirmed"; 
     57            break; 
     58 
     59        case "Update Contact": 
     60 
     61            $statusmessage = $user->update($_POST); 
     62            break; 
     63 
     64    }//endswitch 
     65 
     66}//endif 
     67 
    4568$pageTitle="My Account"; 
    4669 
     
    5780                $theinput = new inputField("phone",$_SESSION["userinfo"]["phone"],"phone/extension",false,"phone",32,64); 
    5881                $theform->addField($theinput); 
    59                                  
     82 
    6083                $theform->jsMerge(); 
    6184                //============================================================== 
    62                 //End Form Elements      
    63          
     85                //End Form Elements 
     86 
    6487        include("header.php"); 
    6588?><div class="bodyline"> 
    66         <form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" name="record" id="record" onsubmit="return false"> 
     89        <form action="<?php echo htmlentities($_SERVER["PHP_SELF"])?>" method="post" name="record" id="record" onsubmit="return false"> 
    6790        <input type="hidden" id="command" name="command" value=""/> 
    68          
     91 
    6992        <h1><span><?php echo $pageTitle ?></span></h1> 
    7093 
     
    7396                <p id="nameP"><?php echo htmlQuotes($_SESSION["userinfo"]["firstname"]." ".$_SESSION["userinfo"]["lastname"])?></p> 
    7497        </fieldset> 
    75          
     98 
    7699        <fieldset> 
    77100                <legend>Change Password</legend> 
     
    80103                        <input type="password" id="curPass" name="curPass" maxlength="32"/> 
    81104                </p> 
    82                  
     105 
    83106                <p> 
    84107                        <label for="newPass">new password</label><br /> 
     
    93116                <button type="button" class="Buttons" onclick="changePass()">Change Password</button> 
    94117        </p> 
    95          
     118 
    96119        <fieldset> 
    97120                <legend>Contact Information</legend> 
    98121 
    99122                        <p><?php $theform->showField("email")?></p> 
    100                          
     123 
    101124                        <p><?php $theform->showField("phone")?></p> 
    102125 
    103126        </fieldset> 
    104127        <p><button type="button" class="Buttons" onclick="changeContact()">Update Contact Information</button></p> 
    105          
     128 
    106129        <fieldset> 
    107130                <legend>Access / Assigned Roles</legend> 
    108131                <ul> 
    109                 <?php  
     132                <?php 
    110133                        if($_SESSION["userinfo"]["admin"]) {?><li><strong>Administrator</strong></li><?php } 
    111                         displayRoles($db) 
     134                        $user->displayRoles(); 
    112135                ?></ul> 
    113136        </fieldset> 
  • trunk/phpbms/modules/base/notes_records.php

    r703 r704  
    7070        if(!isset($_POST["newsort"])) $_POST["newsort"]=""; 
    7171        if(!isset($_POST["desc"])) $_POST["desc"]=""; 
    72          
     72 
    7373 
    7474        if($_POST["newsort"]!="") { 
     
    8181 
    8282        if($displayTable->querytype!="new" and $displayTable->querytype!="edit") { 
    83                  
     83 
    8484        //record offset? 
    8585        if(isset($_POST["offset"])) if($_POST["offset"]!="") $displayTable->recordoffset=$_POST["offset"]; 
     
    9696        <h1><?php echo $pageTitle ?></h1> 
    9797        <div> 
    98                 <form name="search" id="search" action="<?php echo $_SERVER["REQUEST_URI"]?>" method="post" onsubmit="setSelIDs(this);return true;"> 
     98                <form name="search" id="search" action="<?php echo htmlentities($_SERVER["REQUEST_URI"])?>" method="post" onsubmit="setSelIDs(this);return true;"> 
    9999                <input name="theids" type="hidden" value="" /> 
    100100                <?php 
  • trunk/phpbms/modules/base/tabledefs_columns.php

    r703 r704  
    203203        </table></div> 
    204204 
    205         <form action="<?php echo $_SERVER["PHP_SELF"]."?id=".$_GET["id"] ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
     205        <form action="<?php echo htmlentities($_SERVER["PHP_SELF"])."?id=".$_GET["id"] ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
    206206        <fieldset> 
    207207                <legend><?php echo $action?></legend> 
  • trunk/phpbms/modules/base/tabledefs_custom.php

    r703 r704  
    7575            </form> 
    7676        <?php } else { ?> 
    77             <form action="<?php echo str_replace("&", "&amp;", $_SERVER["REQUEST_URI"]) ?>" method="post" name="record" id="record"> 
     77            <form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" name="record" id="record"> 
    7878 
    7979                <p id="topSaveP"><button type="button" class="Buttons saveButtons" accesskey="s">save</button></p> 
  • trunk/phpbms/modules/base/tabledefs_groupings.php

    r703 r704  
    9494        <?php $groupings->showRecords($allRecords) ?> 
    9595 
    96         <form action="<?php echo $_SERVER["PHP_SELF"]."?id=".$_GET["id"] ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
     96        <form action="<?php echo htmlentities($_SERVER["PHP_SELF"])."?id=".$_GET["id"] ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
    9797        <fieldset> 
    9898                <legend><?php echo $action?></legend> 
  • trunk/phpbms/modules/base/tabledefs_options.php

    r703 r704  
    143143        ?> 
    144144 
    145         <form action="<?php echo $_SERVER["PHP_SELF"]."?id=".$_GET["id"] ?>" method="post" id="record" name="record"> 
     145        <form action="<?php echo htmlentities($_SERVER["PHP_SELF"])."?id=".$_GET["id"] ?>" method="post" id="record" name="record"> 
    146146 
    147147                <fieldset> 
  • trunk/phpbms/modules/base/tabledefs_quicksearch.php

    r703 r704  
    158158        </table> 
    159159        </div> 
    160         <form action="<?php echo $_SERVER["PHP_SELF"]."?id=".$_GET["id"] ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
     160        <form action="<?php echo htmlentities($_SERVER["PHP_SELF"])."?id=".$_GET["id"] ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
    161161        <fieldset> 
    162162                <legend><?php echo $action?></legend> 
  • trunk/phpbms/modules/base/tabledefs_searchfields.php

    r703 r704  
    154154        </table></div> 
    155155 
    156         <form action="<?php echo $_SERVER["PHP_SELF"]."?id=".$_GET["id"] ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
     156        <form action="<?php echo htmlentities($_SERVER["PHP_SELF"])."?id=".$_GET["id"] ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
    157157        <fieldset> 
    158158                <legend><?php echo $action?></legend> 
  • trunk/phpbms/modules/bms/aritems_aging.php

    r702 r704  
    156156                $phpbms->showMenu = false; 
    157157 
    158                 $formSubmit = str_replace("&","&amp;",$_SERVER['REQUEST_URI']); 
     158                $formSubmit = htmlentities($_SERVER['REQUEST_URI']); 
    159159 
    160160                include("header.php"); 
  • trunk/phpbms/modules/bms/clients_addresses.php

    r702 r704  
    157157                //record offset? 
    158158                if(isset($_POST["offset"])) if($_POST["offset"]!="") $displayTable->recordoffset=$_POST["offset"]; 
    159                  
     159 
    160160                $displayTable->issueQuery(); 
    161161 
     
    171171                        <h1 id="h1Title"><?php echo $pageTitle?></h1> 
    172172 
    173                         <form name="search" id="search" action="<?php echo str_replace("&", "&amp;" ,$_SERVER["REQUEST_URI"])?>" method="post" onsubmit="setSelIDs(this);return true;"> 
     173                        <form name="search" id="search" action="<?php echo htmlentities($_SERVER["REQUEST_URI"])?>" method="post" onsubmit="setSelIDs(this);return true;"> 
    174174                        <input name="command" id="reset" type="submit"/> 
    175175                        <input name="theids" id="theids" type="hidden"  /> 
  • trunk/phpbms/modules/bms/clients_credit.php

    r702 r704  
    8989 
    9090        $phpbms->showTabs("clients entry", "tab:5a6ef814-2689-4e3b-2609-db43fb3cc001", ((int) $_GET["id"]));?><div class="bodyline"> 
    91         <form action="<?php echo str_replace("&","&amp;",$_SERVER["REQUEST_URI"]) ?>" 
     91        <form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" 
    9292        method="post" name="record" id="record"> 
    9393                <div id="topButtons"> 
  • trunk/phpbms/modules/bms/clients_email.php

    r702 r704  
    1 <?php  
     1<?php 
    22/* 
    33 $Rev$ | $LastChangedBy$ 
     
    4141 
    4242        include("./include/clients_email_include.php"); 
    43          
    44          
     43 
     44 
    4545        $thecommand="showoptions"; 
    4646        if(isset($_POST["command"])) $thecommand=$_POST["command"]; 
    47          
     47 
    4848        switch($thecommand){ 
    4949                case "send email": 
     
    5454                                        foreach($_SESSION["emailids"] as $id) 
    5555                                                $whereclause.="clients.id=".$id." or "; 
    56                                         $whereclause=substr($whereclause,0,strlen($whereclause)-3);                                      
     56                                        $whereclause=substr($whereclause,0,strlen($whereclause)-3); 
    5757                                break; 
    5858                                case "savedsearch": 
     
    6464                                case "all": 
    6565                                        $whereclause=""; 
    66                                 break;                                           
     66                                break; 
    6767                        }//end switch 
    6868                        //next the from: 
    69                         $_SESSION["massemail"]["from"]=str_replace("]",">",str_replace("[","<",$_POST["ds-email"]));                     
     69                        $_SESSION["massemail"]["from"]=str_replace("]",">",str_replace("[","<",$_POST["ds-email"])); 
    7070                        $_SESSION["massemail"]["whereclause"]=$whereclause; 
    7171                        $_SESSION["massemail"]["subject"]=$_POST["subject"]; 
    7272                        $_SESSION["massemail"]["body"]=$_POST["body"]; 
    7373                        $_SESSION["massemail"]["savedproject"]=$_POST["pid"]; 
    74                          
     74 
    7575                        $querystatement="SELECT id,email, if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company) AS name FROM clients ".$whereclause; 
    7676                        $sendqueryresult=$db->query($querystatement); 
    7777                        if(!$sendqueryresult) $error = new appError(300,"Error with: ".$querystatement); 
    78                          
     78 
    7979                break; 
    8080                case "delete project": 
     
    100100                        $thecommand="showoptions"; 
    101101                break; 
    102                  
     102 
    103103                case "done": 
    104104                case "cancel": 
    105105                        goURL(APP_PATH."search.php?id=2"); 
    106                          
     106 
    107107                break; 
    108108        } 
    109          
    110          
     109 
     110 
    111111        $pageTitle="Client/Prospect E-Mail"; 
    112   
     112 
    113113        $phpbms->cssIncludes[] = "pages/clientemail.css"; 
    114114        $phpbms->jsIncludes[] = "modules/bms/javascript/clientemail.js"; 
     
    117117                //============================================================== 
    118118                $theform = new phpbmsForm(); 
    119                  
     119 
    120120                if(is_numeric($therecord["emailfrom"])) 
    121121                        $theid=$therecord["emailfrom"]; 
    122122                else 
    123123                        $theid=0; 
    124                  
     124 
    125125                $theinput = new inputSmartSearch($db, "email", "Pick Active User Email", $theid, "from"); 
    126126                $theform->addField($theinput); 
    127                  
     127 
    128128                $theform->jsMerge(); 
    129129                //============================================================== 
    130130                //End Form Elements 
    131                  
     131 
    132132                if($therecord["emailto"]!="selected" AND $therecord["emailto"]!="all") 
    133133                        $phpbms->bottomJS[] ='thediv=getObjectFromID("showsavedsearches");thediv.style.display="block"'; 
     
    135135                if(!is_numeric($therecord["emailfrom"])) 
    136136                        $phpbms->bottomJS[] ='thefield=getObjectFromID("ds-email");thefield.value="'.$therecord["emailfrom"].'"'; 
    137                  
     137 
    138138                if($thecommand=="send email"){ 
    139                  
    140                         $phpbms->topJS[]='               
    141                         ids=new Array();                         
     139 
     140                        $phpbms->topJS[]=' 
     141                        ids=new Array(); 
    142142                        emails=new Array(); 
    143143                        names= new Array();'; 
    144                          
     144 
    145145                        while($therecord = $db->fetchArray($sendqueryresult)){ 
    146146                                $phpbms->topJS[]="ids[ids.length]=".$therecord["id"].";"; 
    147147                                $phpbms->topJS[]="names[names.length]=\"".$therecord["name"]."\";"; 
    148148                                $phpbms->topJS[]="emails[emails.length]=\"".$therecord["email"]."\";"; 
    149                         }                        
     149                        } 
    150150                }//end if 
    151   
     151 
    152152        include("header.php") 
    153153 
     
    156156        <div class="bodyline" id="mainBG"> 
    157157                <h1 id="topTitle"><span><?php echo $pageTitle?></span></h1> 
    158                  
    159                 <form action="<?php echo $_SERVER["PHP_SELF"] ?>" method="post" name="theform" id="theform"> 
     158 
     159                <form action="<?php echo htmlentities($_SERVER["PHP_SELF"]) ?>" method="post" name="theform" id="theform"> 
    160160        <?php if($thecommand=="showoptions") { ?> 
    161          
     161 
    162162                <input type="hidden" name="pid" id="pid" value="<?php echo $therecord["id"]?>" /> 
    163163                <div class="box"> 
    164                          
     164 
    165165                        <p id="toP"> 
    166                                 <label for="therecords">to</label><br />                         
     166                                <label for="therecords">to</label><br /> 
    167167                                <select id="therecords" name="therecords" onchange="showSavedSearches(this);"> 
    168168                                        <option value="selected" <?php if ($therecord["emailto"]=="selected") echo "selected=\"selected\""?>>e-mail addresses from selected records (<?php echo count($_SESSION["emailids"]) ?> record<?php if(count($_SESSION["emailids"])>1) echo "s"?>)</option> 
    169169                                        <option value="savedsearch" <?php if ($therecord["emailto"]!="selected" AND $therecord["emailto"]!="all") echo "selected=\"selected\""?>>e-mail addresses from saved search...</option> 
    170                                 </select>                                
     170                                </select> 
    171171                        </p> 
    172172                        <p id="showsavedsearches" > 
    173173                                <label for="savedsearches">load e-mail addresses from saved search...</label><br /> 
    174                                 <?php showSavedSearches($db,$therecord["emailto"]); ?>                   
    175                         </p> 
    176                          
     174                                <?php showSavedSearches($db,$therecord["emailto"]); ?> 
     175                        </p> 
     176 
    177177                        <div class="fauxP" id="fromDiv"><?php  $theform->showField("email")?></div> 
    178                          
     178 
    179179                        <p> 
    180180                                <label for="subject">subject</label><br /> 
    181                                 <input type="text" name="subject" id="subject" maxlength="128" value="<?php echo htmlQuotes($therecord["subject"])?>"/>                  
    182                         </p> 
    183                 </div> 
    184                  
     181                                <input type="text" name="subject" id="subject" maxlength="128" value="<?php echo htmlQuotes($therecord["subject"])?>"/> 
     182                        </p> 
     183                </div> 
     184 
    185185                <div class="box"> 
    186186                        <p> 
     
    194194                        </p> 
    195195                </div> 
    196                  
     196 
    197197                <div class="box"> 
    198198                        <div id="projectButtons"> 
     
    205205                                <input type="submit" name="command"     id="sendemail" value="send email" class="Buttons" /> 
    206206                                <input type="submit" name="command"     id="cancel" value="cancel" class="Buttons" /> 
    207                                 <input type="submit" name="command"     id="othercommand" value="" class="Buttons" />                            
    208                         </div> 
    209                 </div> 
    210                  
     207                                <input type="submit" name="command"     id="othercommand" value="" class="Buttons" /> 
     208                        </div> 
     209                </div> 
     210 
    211211                <div id="loadedprojects"> 
    212212                        <p><?php showSavedProjects($db)?></p> 
     
    218218                </div> 
    219219<?php } elseif($thecommand=="send email"){?> 
    220                  
     220 
    221221                <div id="processingWrap"> 
    222222                        <div class="box"> 
  • trunk/phpbms/modules/bms/clients_purchasehistory.php

    r702 r704  
    137137        <h1><?php echo $pageTitle ?></h1> 
    138138 
    139         <form action="<?php echo $_SERVER["REQUEST_URI"] ?>" method="post" name="record"> 
     139        <form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" name="record"> 
    140140                <div class="box"> 
    141141                        <p class="timelineP"> 
  • trunk/phpbms/modules/bms/invoices_addedit.php

    r703 r704  
    242242 
    243243 
    244 ?><form action="<?php echo str_replace("&","&amp;",$_SERVER["REQUEST_URI"]) ?>" 
     244?><form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" 
    245245        method="post" name="record" id="record"><div id="dontSubmit"><input type="submit" value=" " onclick="return false;" /></div> 
    246246<?php $phpbms->showTabs("invoices entry","tab:20276b44-9cfa-403e-4c2a-ac6f0987ae20",$therecord["id"]);?><div class="bodyline"> 
  • trunk/phpbms/modules/bms/invoices_discount_ajax.php

    r702 r704  
    4040        require("../../include/session.php"); 
    4141 
    42         if(!isset($_GET["id"])) $error = new appError(300,"Passed variable not set (id)"); 
     42        if(!isset($_GET["id"])) 
     43            $error = new appError(300,"Passed variable not set (id)"); 
     44 
     45        $uuid = mysql_real_escape_string($_GET["id"]); 
    4346 
    4447        $querystatement = " 
     
    4851            `discounts` 
    4952        WHERE 
    50             `uuid`='".mysql_real_escape_string($_GET["id"])."' 
     53            `uuid`='".$uuid."' 
    5154    "; 
    5255 
  • trunk/phpbms/modules/bms/invoices_statushistory.php

    r702 r704  
    127127        $phpbms->showTabs("invoices entry","tab:809d644e-fa40-5ad3-0426-3d84cf15b32e",$_GET["id"]);?><div class="bodyline"> 
    128128        <h1><span><?php echo $pageTitle ?></span></h1> 
    129         <form action="<?PHP echo $_SERVER["REQUEST_URI"] ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
     129        <form action="<?PHP echo htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" name="record" onsubmit="return validateForm(this);"> 
    130130                <p> 
    131131                        <input accesskey="s" title="(access key+s)" name="command" type="submit" value="update statuses" class="Buttons" <?php if($refrecord["type"]=="Invoice") echo "disabled=\"disabled\""?>/> 
  • trunk/phpbms/modules/bms/post.php

    r702 r704  
    7777 
    7878?><div class="bodyline" id="mainline"> 
    79         <form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" name="record" id="record" onsubmit="return false"> 
     79        <form action="<?php echo htmlentities($_SERVER["PHP_SELF"])?>" method="post" name="record" id="record" onsubmit="return false"> 
    8080        <input type="hidden" id="cmd" name="cmd" value=""/> 
    8181 
  • trunk/phpbms/modules/bms/products_addedit.php

    r702 r704  
    145145        include("header.php"); 
    146146?> 
    147 <form action="<?php echo str_replace("&","&amp;",$_SERVER["REQUEST_URI"]) ?>" method="post" enctype="multipart/form-data" name="record" id="record" onsubmit="return false;"> 
     147<form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" enctype="multipart/form-data" name="record" id="record" onsubmit="return false;"> 
    148148<?php $phpbms->showTabs("products entry","tab:17346362-261b-4d1d-fa77-99e84cfd9b8a",$therecord["id"]);?><div class="bodyline"> 
    149149        <input type="hidden" value="" name="command" id="hiddenCommand"/> 
     
    273273                                        thumbnail graphic<br /> 
    274274                                        <?php if($therecord["thumbnailmime"]) {?> 
    275                                                 <img id="thumbpic" src="<?php echo APP_PATH ?>dbgraphic.php?t=products&f=thumbnail&mf=thumbnailmime&r=<?php echo $therecord["id"]?>" style="border: 1px solid black; display: block; margin: 3px;;" /> 
     275                                                <img id="thumbpic" src="<?php echo APP_PATH ?>dbgraphic.php?t=productThumb&r=<?php echo $therecord["id"]?>" style="border: 1px solid black; display: block; margin: 3px;;" /> 
    276276                                        <?php } else {?> 
    277277                                                <div id="noThumb" class="tiny" align="center">no thumbnail</div> 
     
    286286                                        main picture<br /> 
    287287                                        <?php if($therecord["picturemime"]) {?> 
    288                                                 <img id="picturepic" src="<?php echo APP_PATH ?>dbgraphic.php?t=products&f=picture&mf=picturemime&r=<?php echo $therecord["id"]?>" style="border: 1px solid black; display: block; margin: 3px;;" /> 
     288                                                <img id="picturepic" src="<?php echo APP_PATH ?>dbgraphic.php?t=productPic&r=<?php echo $therecord["id"]?>" style="border: 1px solid black; display: block; margin: 3px;;" /> 
    289289                                        <?php } else {?> 
    290290                                                <div id="noPicture" class="tiny" align="center">no picture</div> 
  • trunk/phpbms/modules/bms/products_prereq.php

    r702 r704  
    132132<?php $phpbms->showTabs("products entry","tab:9bfc7eea-5abb-f5d8-763f-f78fe499464d",$_GET["id"]);?><div class="bodyline"> 
    133133        <h1><span><?php echo $pageTitle ?></span></h1> 
    134         <form action="<?php echo $_SERVER["REQUEST_URI"] ?>" method="post" name="record"> 
     134        <form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" name="record"> 
    135135        <input id="deleteid" name="deleteid" type="hidden" value="0" /> 
    136136        <input id="command" name="command" type="hidden" value="" /> 
  • trunk/phpbms/modules/bms/products_saleshistory.php

    r702 r704  
    144144        $phpbms->showTabs("products entry","tab:cd09d4a1-7d32-e08a-bd6e-5850bc9af88e",$_GET["id"]);?><div class="bodyline"> 
    145145        <h1><span><?php echo $pageTitle ?></span></h1> 
    146         <form action="<?php echo $_SERVER["REQUEST_URI"] ?>" method="post" name="record"> 
     146        <form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" name="record"> 
    147147        <div class="box"> 
    148148                <p class="timelineP"> 
  • trunk/phpbms/modules/bms/receipts_addedit.php

    r702 r704  
    4747                        $backurl .= "?refid=".$_GET["refid"]; 
    4848        } 
    49          
     49 
    5050        if(!isset($_GET["id"])) 
    5151                $_GET["id"] = 0; 
     
    140140 
    141141?><div class="bodyline"> 
    142 <form action="<?php echo str_replace("&", "&amp;", $_SERVER["REQUEST_URI"]) ?>" method="post" name="record" id="record"> 
     142<form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" name="record" id="record"> 
    143143 
    144144        <div id="topButtons"><?php showSaveCancel(1); ?></div> 
  • trunk/phpbms/modules/bms/report/aritems_clientstatement.php

    r703 r704  
    499499                $phpbms->showMenu = false; 
    500500 
    501                 $formSubmit = str_replace("&","&amp;",$_SERVER['REQUEST_URI']); 
     501                $formSubmit = htmlentities($_SERVER['REQUEST_URI']); 
    502502 
    503503                $theform = new phpbmsForm(); 
  • trunk/phpbms/modules/bms/report/aritems_summary.php

    r703 r704  
    434434                $phpbms->showMenu = false; 
    435435 
    436                 $formSubmit = str_replace("&","&amp;",$_SERVER['REQUEST_URI']); 
     436                $formSubmit = htmlentities($_SERVER['REQUEST_URI']); 
    437437 
    438438                $theform = new phpbmsForm(); 
  • trunk/phpbms/modules/bms/report/clients_purchasehistory.php

    r703 r704  
    300300        include("header.php"); 
    301301        ?> 
    302         <form action="<?php echo str_replace("&", "&amp;", $_SERVER["REQUEST_URI"]); ?>" method="post" name="totals" onsubmit="return validateForm(this)"> 
     302        <form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]); ?>" method="post" name="totals" onsubmit="return validateForm(this)"> 
    303303 
    304304            <div class="bodyline" id="reportOptions"> 
  • trunk/phpbms/modules/bms/report/incoming_cashflow.php

    r703 r704  
    536536                $phpbms->showMenu = false; 
    537537 
    538                 $formSubmit = str_replace("&","&amp;",$_SERVER['REQUEST_URI']); 
     538                $formSubmit = htmlentities($_SERVER['REQUEST_URI']); 
    539539 
    540540                $theform = new phpbmsForm(); 
  • trunk/phpbms/modules/bms/report/invoices_totals.php

    r703 r704  
    493493        <div class="bodyline"> 
    494494            <h1>Invoice Total Options</h1> 
    495             <form id="GroupForm" action="<?php echo str_replace("&", "&amp;", $_SERVER["REQUEST_URI"]) ?>" method="post" name="GroupForm"> 
     495            <form id="GroupForm" action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" name="GroupForm"> 
    496496 
    497497                <fieldset> 
  • trunk/phpbms/modules/bms/report/lineitems_totals.php

    r703 r704  
    462462        <div class="bodyline"> 
    463463            <h1>Line Items Total Options</h1> 
    464             <form id="GroupForm" action="<?php echo str_replace("&", "&amp;", $_SERVER["REQUEST_URI"]) ?>" method="post" name="GroupForm"> 
     464            <form id="GroupForm" action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" name="GroupForm"> 
    465465 
    466466                <fieldset> 
  • trunk/phpbms/modules/bms/report/products_saleshistory.php

    r703 r704  
    313313        include("header.php"); 
    314314        ?> 
    315         <form action="<?php echo str_replace("&", "&amp;", $_SERVER["REQUEST_URI"]); ?>" method="post" name="totals" onsubmit="return validateForm(this)"> 
     315        <form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]); ?>" method="post" name="totals" onsubmit="return validateForm(this)"> 
    316316 
    317317            <div class="bodyline" id="reportOptions"> 
  • trunk/phpbms/modules/mailchimp/report/client_mailchimp_export.php

    r703 r704  
    4949        function MCReport($db,$variables = NULL){ 
    5050                $this->db = $db; 
    51          
     51 
    5252                //next we do the columns 
    5353                $this->addColumn("Email","`email`");//0 
     
    5656                $this->addColumn("Company","`company`");//3 
    5757                $this->addColumn("Uuid","`uuid`");//4 
    58                  
     58 
    5959                $this->addColumn("Type","`type`");//5 
    6060                $this->addColumn("Id","`id`");//6 
    61                  
     61 
    6262 
    6363                if($variables){ 
     
    6868                                $this->selectcolumns[] = $this->columns[$id]; 
    6969                        $this->selectcolumns = array_reverse($this->selectcolumns); 
    70                          
     70 
    7171                        $this->selecttable = "`clients`"; 
    7272 
     
    7676                        if($this->whereclause!="") $this->whereclause=" WHERE (".substr($this->whereclause,6).") "; 
    7777                }// endif 
    78                  
     78 
    7979        }//end method 
    8080 
     
    8888                $this->columns[] = $temp; 
    8989        }//end method 
    90          
    91          
     90 
     91 
    9292        function generate(){ 
    93                  
     93 
    9494                $querystatement = "SELECT "; 
    9595                foreach($this->selectcolumns as $thecolumn) 
     
    9797                $querystatement = substr($querystatement, 0, -1); 
    9898                $querystatement .= " FROM ".$this->selecttable.$this->whereclause; 
    99                  
     99 
    100100                $queryresult = $this->db->query($querystatement); 
    101101 
    102102                $num_fields = $this->db->numFields($queryresult); 
    103                  
     103 
    104104                for($i=0;$i<$num_fields;$i++) 
    105105                        $this->reportOutput .= ",".$this->db->fieldName($queryresult, $i); 
     
    123123                $this->reportOutput = substr($this->reportOutput, 0, strlen($this->reportOutput)-1); 
    124124        } 
    125          
    126          
     125 
     126 
    127127        function output(){ 
    128                  
     128 
    129129                header("Content-type: text/plain"); 
    130130                header('Content-Disposition: attachment; filename="clients_mailchimp_export.csv"'); 
    131131 
    132132                echo $this->reportOutput; 
    133                  
     133 
    134134        }//end function --output-- 
    135          
     135 
    136136 
    137137        function showOptions($what){ 
     
    164164        <div class="bodyline"> 
    165165            <h1>Invoice Total Options</h1> 
    166             <form id="GroupForm" action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" name="GroupForm"> 
     166            <form id="GroupForm" action="<?php echo htmlentities($_SERVER["PHP_SELF"])?>" method="post" name="GroupForm"> 
    167167 
    168168                <fieldset> 
  • trunk/phpbms/modules/recurringinvoices/invoices_recurrence.php

    r702 r704  
    150150        $phpbms->showTabs("invoices entry","tab:d303321e-7ff5-fe4b-29ec-fe3eb0305576",$_GET["id"]); 
    151151?><div class="bodyline"> 
    152 <form action="<?php echo $_SERVER["REQUEST_URI"] ?>" 
     152<form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" 
    153153        method="post" name="record" id="record" 
    154154        onsubmit="return false;"> 
  • trunk/phpbms/report/general_labels.php

    r703 r704  
    144144 
    145145        ?> 
    146         <form action="<?php echo str_replace("&", "&amp;", $_SERVER["REQUEST_URI"])?>" method="post" name="print_form"> 
     146        <form action="<?php echo htmlentities($_SERVER["REQUEST_URI"])?>" method="post" name="print_form"> 
    147147            <div class="bodyline" id="reportOptions"> 
    148148 
     
    475475 
    476476    $report = new pdfLabels($db, $_GET["rid"], $_GET["tid"]); 
    477      
     477 
    478478    if(!isset($_POST["skipLabels"])) 
    479479        $report->displaySkipLabels(); 
Scanned by Orvant Copyright © 2010 Kreotek, LLC. All Rights reserved.