phpBMS

Show
Ignore:
Timestamp:
01/03/10 21:33:53 (2 years ago)
Author:
brieb
Message:
  • Tweaked some UI sizing and border issues
  • Fixed client purchase history type updating (mispelling)
  • Added ability to consolidate client records (for duplicates)
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/bms/include/clients.php

    r703 r706  
    434434 
    435435                }//end method - insertRecord 
    436                  
     436 
    437437                /* 
    438438                 * function api_searchByEmail 
     
    446446                 * were encountered, or the original $requestData if there was an error 
    447447                 */ 
    448                  
     448 
    449449                function api_searchByEmail($requestData, $returnUuid = true) { 
    450                          
     450 
    451451                        /** 
    452452                          *  Check for required fields and return error if not there. 
     
    458458                                return $response; 
    459459                        }//end if 
    460                          
     460 
    461461                        /** 
    462                           *  Do sql search  
     462                          *  Do sql search 
    463463                          */ 
    464464                        $querystatement = " 
     
    471471                                        `email` = '".mysql_real_escape_string($requestData["email"])."' 
    472472                        "; 
    473                          
     473 
    474474                        $queryresult = $this->db->query($querystatement); 
    475                          
     475 
    476476                        /** 
    477                           *  Construct return array  
     477                          *  Construct return array 
    478478                          */ 
    479479                        $thereturn["type"] = "result"; 
     
    481481                        $thereturn["details"] = array(); 
    482482                        while($therecord = $this->db->fetchArray($queryresult)){ 
    483                                  
     483 
    484484                                if($returnUuid) 
    485485                                        $thereturn["details"][] = $therecord["uuid"]; 
    486486                                else 
    487487                                        $thereturn["details"][] = $therecord["id"]; 
    488                                  
     488 
    489489                        }//end while 
    490                          
     490 
    491491                        return $thereturn; 
    492                          
     492 
    493493                }//end function --api_serchByEmail-- 
    494                  
     494 
    495495                /* 
    496496                 * function api_searchByNameAndPostalcode 
     
    505505                 * were encountered, or the original $requestData if there was an error 
    506506                 */ 
    507                  
     507 
    508508                function api_searchByNameAndPostalcode($requestData, $returnUuid = true) { 
    509                          
     509 
    510510                        /** 
    511                           *  check for required fields  
     511                          *  check for required fields 
    512512                          */ 
    513513                        $requiredArray = array( 
     
    516516                                "lastname" 
    517517                        ); 
    518                          
     518 
    519519                        $missingArray = array(); 
    520                          
     520 
    521521                        foreach($requiredArray as $requiredField) 
    522522                                if(!isset($requestData[$requiredField])) 
    523523                                        $missingArray[] = $requiredField; 
    524                          
     524 
    525525                        $count = count($missingArray); 
    526526                        if($count){ 
    527                                  
     527 
    528528                                $response["type"] = "error"; 
    529529                                $response["details"] = $requestData; 
    530530                                $response["message"] = ""; 
    531                                  
     531 
    532532                                $i=0; 
    533533                                foreach($missingArray as $missingField){ 
    534                                          
     534 
    535535                                        if(++$i == $count){ 
    536536                                                if($response["message"]) 
     
    540540                                        }else 
    541541                                                $response["message"] .= "'".$missingField."', "; 
    542                                          
     542 
    543543                                }//end foreach 
    544                                  
     544 
    545545                                $response["messsage"] = "Data does not contain the key(s): ".$response["message"]; 
    546                                  
     546 
    547547                                return $response; 
    548                          
     548 
    549549                        }//end if 
    550                          
     550 
    551551                        /** 
    552                           *  do sql search  
     552                          *  do sql search 
    553553                          */ 
    554554                        $querystatement = " 
     
    568568                                        `addresses`.`postalcode` = '".mysql_real_escape_string($requestData["postalcode"])."' 
    569569                        "; 
    570                          
     570 
    571571                        $queryresult = $this->db->query($querystatement); 
    572                          
     572 
    573573                        /** 
    574                           *  report findings  
     574                          *  report findings 
    575575                          */ 
    576576                        $thereturn["details"] = array(); 
     
    578578                        $thereturn["message"] = "The function api_searchByNameAndPostalcode has been run successfully."; 
    579579                        while($therecord = $this->db->fetchArray($queryresult)){ 
    580                                  
     580 
    581581                                if($returnUuid) 
    582582                                        $thereturn["details"][] = $therecord["uuid"]; 
    583583                                else 
    584584                                        $thereturn["details"][] = $therecord["id"]; 
    585                                  
     585 
    586586                        }//end while 
    587                          
     587 
    588588                        return $thereturn; 
    589                          
     589 
    590590                }//end function --api_searchByNameAndPostalcode 
    591                  
     591 
    592592                /* 
    593593                 * function api_searchByUsernameAndPassword 
     
    602602                 * were encountered, or the original $requestData if there was an error 
    603603                 */ 
    604                  
     604 
    605605                function api_searchByUsernameAndPassword($requestData, $returnUuid = true) { 
    606                          
     606 
    607607                        /** 
    608                           *  check for required fields  
     608                          *  check for required fields 
    609609                          */ 
    610610                        $requiredArray = array( 
     
    612612                                "password" 
    613613                        ); 
    614                          
     614 
    615615                        $missingArray = array(); 
    616                          
     616 
    617617                        foreach($requiredArray as $requiredField) 
    618618                                if(!isset($requestData[$requiredField])) 
    619619                                        $missingArray[] = $requiredField; 
    620                          
     620 
    621621                        $count = count($missingArray); 
    622622                        if($count){ 
    623                                  
     623 
    624624                                $response["type"] = "error"; 
    625625                                $response["details"] = $requestData; 
    626626                                $response["message"] = ""; 
    627                                  
     627 
    628628                                $i=0; 
    629629                                foreach($missingArray as $missingField){ 
    630                                          
     630 
    631631                                        if(++$i == $count){ 
    632632                                                if($response["message"]) 
     
    636636                                        }else 
    637637                                                $response["message"] .= "'".$missingField."', "; 
    638                                          
     638 
    639639                                }//end foreach 
    640                                  
     640 
    641641                                $response["messsage"] = "Data does not contain the key(s): ".$response["message"]; 
    642                                  
     642 
    643643                                return $response; 
    644                          
     644 
    645645                        }//end if 
    646                          
     646 
    647647                        /** 
    648                           *  do sql search  
     648                          *  do sql search 
    649649                          */ 
    650650                        $querystatement = " 
     
    659659                                        `password` = '".mysql_real_escape_string($requestData["password"])."' 
    660660                        "; 
    661                          
     661 
    662662                        $queryresult = $this->db->query($querystatement); 
    663                          
     663 
    664664                        /** 
    665                           *  report findings  
     665                          *  report findings 
    666666                          */ 
    667667                        $thereturn["details"] = array(); 
     
    669669                        $thereturn["message"] = "The function api_searchByUsernameAndPassword has been run successfully."; 
    670670                        while($therecord = $this->db->fetchArray($queryresult)){ 
    671                                  
     671 
    672672                                if($returnUuid) 
    673673                                        $thereturn["details"][] = $therecord["uuid"]; 
    674674                                else 
    675675                                        $thereturn["details"][] = $threturn["id"]; 
    676                                  
     676 
    677677                        }//end while 
    678                          
     678 
    679679                        return $thereturn; 
    680                          
     680 
    681681                }//end function --api_searchByUsernameAndPassword-- 
    682682 
     
    688688if(class_exists("searchFunctions")){ 
    689689        class clientsSearchFunctions extends searchFunctions{ 
     690 
     691                function consolidate_clients($useUuid = false){ 
     692 
     693                    $noOutput = true; 
     694                    include("modules/bms/clients_consolidate.php"); 
     695 
     696                    $consolidator = new clientConsolidator($this->db); 
     697 
     698                    $consolidator->showPicker($this->idsArray, $useUuid); 
     699                    exit(); 
     700 
     701 
     702                }//end function consolidate_clients 
    690703 
    691704                function mark_asclient($useUuid = false){ 
     
    941954        }//end class 
    942955}//end if 
     956 
    943957if(class_exists("phpbmsImport")){ 
    944958        class clientsImport extends phpbmsImport{ 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.