phpBMS

Changeset 704 for trunk/phpbms/modules

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/modules
Files:
34 modified

Legend:

Unmodified
Added
Removed
  • 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;"> 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.