February 13, 200916 yr Hello, I have read that external authentication can be used in conjunction with the PHP API. When testing this out, however, I get some unexpected results - if I enter the wrong credentials in the HTML form that sends the UN/PW to my login script, I would expect to get a FileMaker_Error object back when trying to instantiate my FileMaker connection object. However, my call to FileMaker::isError($fm) does not evaluate to TRUE, so it would seem that the bogus credentials allowed me into the file. Anybody know what's going on here? How can I tell if the authentication is/isn't working? Thanks, Jeff
February 13, 200916 yr Author Sorry, I thought it was generic enough to not need a code example. $fm = new FileMaker('dbName', NULL, $un, $pw); //Open file 'dbName' from localhost with UN/PW values extracted from $_POST if (FileMaker::isError($fm)) { echo "ERROR!!!" } else . . . I have since discovered (posting this for anyone else who encounters this behavior and is confused by it) that the FileMaker PHP API will not return an error object if the credentials are incorrect. It doesn't let you know that until you try doing something with the database. Ie., the result assigned to $fm will not be an error object. If you then continued on and did something such as: $list = $fm->listLayouts(); ... THEN you get a FileMaker_Error object as a return.
February 14, 200916 yr Hmmm, yeh that slipped my mind.. now i remember why i put a false command into my connection files : Anyway it's expected operation: you only get a result or error object once you execute a command.
February 17, 200916 yr //Open file 'dbName' from localhost with UN/PW values extracted from $_POST This isn't correct, the constructor for the Filemaker object just sets the variables it receives. It doesn't send a request to the XML feed so it won't know if the values are correct, hence it doesn't throw an error. Edited to add: The Filemaker PHP API library does not create a connection handle along the lines of the PEAR Database libraries. It simply sends requests via cURL to the XML feed and parses the results. Edited February 17, 200916 yr by Guest
Create an account or sign in to comment