phpBMS

Changeset 515 for trunk/phpbms/include

Show
Ignore:
Timestamp:
05/05/09 12:26:06 (3 years ago)
Author:
nate
Message:
  • removed widget's default import
  • For new tabledefs, the import command is disabled by default
  • Products should now use the general import page.
Location:
trunk/phpbms/include
Files:
3 modified

Legend:

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

    r485 r515  
    1616                var $pageType = "main"; 
    1717 
     18 
    1819                function phpbmsImport($table, $importType = "csv"){ 
    1920 
     
    3132                        //Won't display db errors, just log them. 
    3233                        $this->table->db->showError = false; 
    33                         if(isset($_POST["pageType"])) 
    34                                 $this->pageType = $_POST["pageType"]; 
    35  
    36                         if(isset($_POST["tempFileID"])) 
    37                                 $this->tempFileID = ((int)$_POST["tempFileID"]); 
    3834 
    3935                }//end method --imports-- 
     
    258254                                                        $verify = $this->table->verifyVariables($trimmedRowData); 
    259255                                                        if(!count($verify)) 
    260                                                                 $theid = $this->table->insertRecord($trimmedRowData); 
     256                                                                $theid = $this->table->insertRecord($trimmedRowData, NULL, true); 
    261257                                                }else 
    262258                                                        $this->error .= '<li> incorrect amount of fields for line number '.$rowNum.'.</li>'; 
     
    332328                        $this->table->getTableInfo(); 
    333329 
     330                        if(isset($_POST["pageType"])) 
     331                                $this->pageType = $_POST["pageType"]; 
     332 
     333                        if(isset($_POST["tempFileID"])) 
     334                                $this->tempFileID = ((int)$_POST["tempFileID"]); 
     335 
    334336                        if(!isset($_POST["command"])){ 
    335337 
  • trunk/phpbms/include/session.php

    r485 r515  
    515515                        $error = new appError(-353,"You must remove the install directory and all modules' install directories before phpBMS can run.","Main Install Directory Present",true,true,true,$errorFormat); 
    516516 
    517                 $thedir= @ opendir("modules"); 
    518  
    519                 while($entry = readdir($thedir)){ 
    520  
    521                         if($entry != "." && $entry != ".." && $entry != "base" && $entry != "sample" && is_dir("modules/".$entry)){ 
    522  
    523                                 if(file_exists("modules/".$entry."/install") && is_dir("modules/".$entry."/install")){ 
    524  
    525                                         $error = new appError(-354,"You must remove the install directory and all modules' install directories before phpBMS can run.","Module '".$entry."' Install Directory Present",true,true,true,$errorFormat); 
     517                if(file_exists("modules") && is_dir("modules")){ 
     518 
     519                        $thedir = @ opendir("modules"); 
     520 
     521                        while($entry = readdir($thedir)){ 
     522 
     523                                if($entry != "." && $entry != ".." && $entry != "base" && $entry != "sample" && is_dir("modules/".$entry)){ 
     524 
     525                                        if(file_exists("modules/".$entry."/install") && is_dir("modules/".$entry."/install")){ 
     526 
     527                                                $error = new appError(-354,"You must remove the install directory and all modules' install directories before phpBMS can run.","Module '".$entry."' Install Directory Present",true,true,true,$errorFormat); 
     528 
     529                                        }//endif 
    526530 
    527531                                }//endif 
    528532 
    529                         }//endif 
     533                        }//end while 
    530534 
    531535                }//end if 
  • trunk/phpbms/include/tables.php

    r513 r515  
    345345 
    346346 
    347                 function insertRecord($variables,$createdby = NULL, $overrideID = false){ 
     347                function insertRecord($variables,$createdby = NULL, $overrideID = false, $replace = false){ 
    348348 
    349349                        if($createdby === NULL) 
     
    396396                        $insertvalues = substr($insertvalues, 0, strlen($insertvalues)-2); 
    397397 
    398                         $insertstatement = "INSERT INTO ".$this->maintable." (".$fieldlist.") VALUES (".$insertvalues.")"; 
     398                        if($replace) 
     399                                $insertstatement = "REPLACE"; 
     400                        else 
     401                                $insertstatement = "INSERT"; 
     402 
     403                        $insertstatement .= " INTO ".$this->maintable." (".$fieldlist.") VALUES (".$insertvalues.")"; 
    399404                        $insertresult = $this->db->query($insertstatement); 
    400405 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.