phpBMS

root/trunk/phpbms/modules/base/notes_records.php

Revision 704, 5.1 KB (checked in by brieb, 2 years ago)
  • Fixed several SQL injection vulnerabilities
  • Fixed several XSS vulnerabilities due to PHP_SELF and REQUREST_URI
  • Fixed severa path disclosure errors
  • Property svn:keywords set to LastChangedBy LastChangedDate LastChangedRevision
Line 
1<?php
2/*
3 $Rev$ | $LastChangedBy$
4 $LastChangedDate$
5 +-------------------------------------------------------------------------+
6 | Copyright (c) 2004 - 2010, Kreotek LLC                                  |
7 | All rights reserved.                                                    |
8 +-------------------------------------------------------------------------+
9 |                                                                         |
10 | Redistribution and use in source and binary forms, with or without      |
11 | modification, are permitted provided that the following conditions are  |
12 | met:                                                                    |
13 |                                                                         |
14 | - Redistributions of source code must retain the above copyright        |
15 |   notice, this list of conditions and the following disclaimer.         |
16 |                                                                         |
17 | - Redistributions in binary form must reproduce the above copyright     |
18 |   notice, this list of conditions and the following disclaimer in the   |
19 |   documentation and/or other materials provided with the distribution.  |
20 |                                                                         |
21 | - Neither the name of Kreotek LLC nor the names of its contributore may |
22 |   be used to endorse or promote products derived from this software     |
23 |   without specific prior written permission.                            |
24 |                                                                         |
25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS     |
26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT       |
27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
28 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT      |
29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   |
30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT        |
31 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,   |
32 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY   |
33 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT     |
34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE   |
35 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.    |
36 |                                                                         |
37 +-------------------------------------------------------------------------+
38*/
39
40        $displayTable= new displaySearchTable($db);
41        $displayTable->base = $base;
42        $displayTable->initialize("tbld:a4cdd991-cf0a-916f-1240-49428ea1bdd1");
43        $displayTable->querywhereclause=$whereclause;
44        $displayTable->tableoptions["printex"]=0;
45        $displayTable->tableoptions["othercommands"]=false;
46        $displayTable->tableoptions["select"]=0;
47
48        if(isset($_POST["deleteCommand"]))
49                if($_POST["deleteCommand"]) $_POST["command"]=$_POST["deleteCommand"];
50
51        if(isset($_POST["command"])){
52                switch($_POST["command"]){
53                        case $displayTable->thetabledef["deletebutton"]:
54                        //=====================================================================================================
55
56                        include_once("modules/base/include/notes.php");
57
58                        $theids=explode(",",$_POST["theids"]);
59
60                        $searchFunctions = new notesSearchFunctions($db,$displayTable->thetabledef["uuid"],$theids);
61
62                        $tempmessage = $searchFunctions->delete_record();
63                        if($tempmessage) $statusmessage=$tempmessage;
64
65                        break;
66                }//end switch
67        }
68
69        //on the fly sorting... this needs to be done after command processing or the querystatement will not work.
70        if(!isset($_POST["newsort"])) $_POST["newsort"]="";
71        if(!isset($_POST["desc"])) $_POST["desc"]="";
72
73
74        if($_POST["newsort"]!="") {
75                //$displayTable->setSort($_POST["newsort"]);
76                foreach ($displayTable->thecolumns as $therow){
77                        if ($_POST["newsort"]==$therow["name"]) $therow["sortorder"]? $displayTable->querysortorder=$therow["sortorder"] : $displayTable->querysortorder=$therow["column"];
78                }
79                $_POST["startnum"]=1;
80        } elseif($_POST["desc"]!="")  $displayTable->querysortorder.=" DESC";
81
82        if($displayTable->querytype!="new" and $displayTable->querytype!="edit") {
83
84        //record offset?
85        if(isset($_POST["offset"])) if($_POST["offset"]!="") $displayTable->recordoffset=$_POST["offset"];
86
87        $displayTable->issueQuery();
88
89        $phpbms->cssIncludes[] = "pages/search.css";
90        $phpbms->jsIncludes[] = "common/javascript/queryfunctions.js";
91        $phpbms->topJS[] = 'xtraParamaters="backurl="+encodeURIComponent("'.$backurl.'")+String.fromCharCode(38)+"tabledefid='.urlencode($reftableid).'"+String.fromCharCode(38)+"refid='.urlencode($refuuid).'";';
92
93        include("header.php");
94
95        $phpbms->showTabs($tabgroup,$selectedtabid,$_GET["id"]);?><div class="bodyline">
96        <h1><?php echo $pageTitle ?></h1>
97        <div>
98                <form name="search" id="search" action="<?php echo htmlentities($_SERVER["REQUEST_URI"])?>" method="post" onsubmit="setSelIDs(this);return true;">
99                <input name="theids" type="hidden" value="" />
100                <?php
101                        $displayTable->displayQueryButtons();
102
103                        $displayTable->displayResultTable();
104                ?>
105                </form>
106        </div>
107</div>
108<?php include("../../footer.php"); }//endif?>
Note: See TracBrowser for help on using the browser.
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.