function validateUser ($userName, $pass) //verified { $dcdb = new Dcdb; $passHash = sha1($pass); $return = false; $q = "SELECT * FROM `dcdb_users` WHERE `username` = '".$userName."' AND `pass` = '".$passHash."'"; $rslt = $dcdb->query($q); if (mysql_num_rows($rslt) > 0) { $return = true; } return $return; }
function validateUser ($xmlrpcmsg) //verified { $dcdb = new Dcdb; $p1 = $xmlrpcmsg->getParam(0); $p2 = $xmlrpcmsg->getParam(1); $userName = $p1->scalarval(); $pass = $p2->scalarval(); $passHash = sha1($pass); $return = false; $q = "SELECT * FROM `dcdb_users` WHERE `username` = '".$userName."' AND `pass` = '".$passHash."'"; $rslt = $dcdb->query($q); if (mysql_num_rows($rslt) > 0) { $return = true; } return new xmlrpcresp(new xmlrpcval($return, "boolean")); }