June 18, 201213 yr I have a script on my server that sends bulk emails using the ScriptMaster Plug-in. I currently have a schedule that runs this script every 10 minutes (checked for messages to be sent, and then sends them). The script is set to run with full access privileges. In the interest of cleaner log files and to give the user more control, I wanted to give them button that would simply open URL to a php page that would run the script, but it doesn't seem to be working. <?php include("FileMaker.php"); include("../includes/functions.php"); $fm = db_connect(); //note: it doesn't matter which layout is used $layout = "phpEmailBulk"; $script = "SERVER - send bulk emails"; $parameter = ""; $request = $fm->newPerformScriptCommand($layout, $script, $parameter); $result = $request->execute(); $error = error_check($result); if(!$error) { echo "success!"; } ?> The browser displays "Success". The FMS log reports the usual 101 error on "Go to Record[next]" after the last record in the loop" ... but the line with the plug-in isn't executing? Is the use of the plug-in not allowed when a script is executed from the web? Note: The ScriptMaster function is registered with a subscript, which also runs with full access privileges.
June 18, 201213 yr What are the privileges of the username that is specified in the db_connect() function? (It most likely is NOT the user who is calling the php URL.)
June 18, 201213 yr Author it is a user that has execute privileges for the script and subscript, and view only access to a basic layout (because you have to specify a layout). similar privileges to the user that the server schedule uses (except that one has no access to any layouts). "Run with full access privileges" should give it the additional privileges it needs... the script is definitely running. through my own error trapping it is writing an error to each of the bulk email requests. It is not returning an error from the plug-in itself. it is a user that has execute privileges for the script and subscript, and view only access to a basic layout (because you have to specify a layout). similar privileges to the user that the server schedule uses (except that one has no access to any layouts). "Run with full access privileges" should give it the additional privileges it needs... the script is definitely running. through my own error trapping it is writing an error to each of the bulk email requests. It is not returning an error from the plug-in itself.
Create an account or sign in to comment