Changeset 525 for trunk/phpbms/include
- Timestamp:
- 05/13/09 20:00:01 (3 years ago)
- Location:
- trunk/phpbms/include
- Files:
-
- 3 modified
-
db.php (modified) (1 diff)
-
session.php (modified) (5 diffs)
-
tables.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/include/db.php
r512 r525 120 120 121 121 122 /** 123 * Establishes a connection to the database 124 * 125 * Establishes a connection to the database. If the {@link $pconnect} setting 126 * is set, it uses the mysql_pconnect (for persistennt connections). We pass 127 * connection flags of 65536 so that calling simple stored procedures will 128 * successfully return results 129 */ 122 130 function connect(){ 123 // This functions connects to the server.124 // It uses pconnect if the constant is set (via the settings.php file)125 131 126 132 if($this->pconnect) 127 $ this->db_link = @ mysql_pconnect($this->hostname,$this->dbuser,$this->dbpass);133 $function = "mysql_pconnect"; 128 134 else 129 $this->db_link = @ mysql_connect($this->hostname,$this->dbuser,$this->dbpass); 135 $function = "mysql_connect"; 136 137 $this->db_link = @ $function($this->hostname, $this->dbuser, $this->dbpass, 65536); 130 138 131 139 if(!$this->db_link){ -
trunk/phpbms/include/session.php
r517 r525 446 446 447 447 448 function verifyAPIlogin($user, $pass ){448 function verifyAPIlogin($user, $pass, $format = "json"){ 449 449 450 450 $thereturn = false; … … 474 474 if(!$queryresult) { 475 475 476 $error = new appError(-720,"","Error retrieving user record",true,true,true, "json");476 $error = new appError(-720,"","Error retrieving user record",true,true,true,$format); 477 477 return false; 478 478 … … 497 497 498 498 if(!$queryresult) 499 $error = new appError(-730,"","Error Updating User Login Time",true,true,true, "json");499 $error = new appError(-730,"","Error Updating User Login Time",true,true,true,$format); 500 500 else 501 501 $thereturn = true; … … 553 553 //Testing for API login 554 554 if(strpos($scriptname,"api_")!==false){ 555 556 if(!isset($_POST["phpbmsformat"])) 557 $_POST["phpbmsformat"] = "json"; 558 555 559 if(isset($_POST["phpbmsusername"]) && isset($_POST["phpbmspassword"])){ 556 560 … … 569 573 570 574 571 if(!$phpbmsSession->verifyAPILogin($_POST["phpbmsusername"],$_POST["phpbmspassword"] ))575 if(!$phpbmsSession->verifyAPILogin($_POST["phpbmsusername"],$_POST["phpbmspassword"], $_POST["phpbmsformat"])) 572 576 $error = new appError(-700,"","Login credentials incorrect",true,true,true,"json"); 573 577 574 578 } else 575 $error= new appError(-710,"","No login credentials passed",true,true,true,"json");579 $error= new appError(-710, "", "No login credentials passed", true, true, true, $_POST["phpbmsformat"]); 576 580 577 581 } else { -
trunk/phpbms/include/tables.php
r519 r525 322 322 return $therecord; 323 323 324 }//edn function getDefaults 324 }//end function getDefaults 325 325 326 326 327 // Gets a specific individual record from the table