[fx.php_list] Re: A PHP question

  • From: Bob Patin <bob@xxxxxxxxx>
  • To: "FX.php Discussion List" <fx.php_list@xxxxxxxxxxxxx>
  • Date: Wed, 24 May 2017 15:56:07 -0500


On May 24, 2017, at 2:50 PM, Chris Moyer <cmoyer@xxxxxxxxxxxxxx> wrote:

Not structured as you have it, but what if you only have the queries running 
from your file? You could pass query arguments to your page, which would know 
the password and run the queries and then send the query result array back to 
the calling page. He would never know the password that way, but queries 
would still work.

Well, here’s the thing: I’m executing a shell script, so it needs to execute on 
the server.

In essence here’s my situation: I lease this server to a client, who wants to 
be able to start, stop, restart FM Server; he has an admin group for FM Server, 
but it doesn’t allow him to start/stop/restart.

So I’ve written a page that will do these 3 functions by executing the same 
commands you would use in Terminal (this is OS X).

Because the script needs to execute on the server, I have to embed my username 
& password (for FM Server) in the script command.

Even if I were to move those 2 variables off the page, he could look at my PHP 
page and do an include and pull them.

I got to thinking about whether i could execute the shell script from a 
different web server, but I don’t see how that would be possible. 

Here’s the simple script to stop FM Server using a shell script & PHP:

$cmd = '/Library/FileMaker\ Server/Database\ Server/bin/fmsadmin stop server -y 
-p '.$password.' -u '.$username.' 2>&1 1> /dev/null';

As you can see, I need to pass the username and password in there.

Now, if I could somehow run this from a different web server, that would be 
great, but this machine isn’t running OS X Server, so the only domain name I 
can hit is the one that my client uses—and he has full access to that folder 
using FTP.

Any thoughts would be most welcome; I’ve run out of ideas.


Bob Patin
Longterm Solutions
bob@xxxxxxxxxxxxxxxxxxxxx
615-333-6858
FileMaker 9, 10, 11, 12 & 13 Certified Developer
http://www.longtermsolutions.com
-
iChat: bobpatin@xxxxxx
Twitter: bobpatin

FileMaker Consulting 
FileMaker Hosting for all versions of FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting

Other related posts: