DayBackOnline

PHPrelay File

DayBackOnline.PHPrelayFile History

Hide minor edits - Show changes to output

May 01, 2018, at 10:20 PM by KC Embrey - Fixed https to HTTP
Changed line 93 from:
-> � For Apache (OS X) through https: /Library/FileMaker Server/HTTPServer/htdocs
to:
-> � For Apache (OS X) through HTTP: /Library/FileMaker Server/HTTPServer/htdocs
April 04, 2018, at 06:25 PM by KC Embrey - Updated to new link for fmxjRelay.php file on seedcode.com
Changed lines 9-11 from:
You can download the %newwin% [[https://www.dayback.io/downloads/fmxjRelay.zip | PHP relay file here]], rename it, and edit your account information by changing a couple lines to reflect a FileMaker account name and password that have read/write access to your FileMaker file.

The technical reason for needing this file is that FileMaker server does not allow  http XMLRequests directly to the XML API from another domain, and changing this involves modifying the Web Server settings. Such a modification is actually pretty easy in Windows/IIS, but not so in Mac/FileMaker Server/Apache. In either case, dropping a single PHP relay file into the FileMaker Server's root directory is much easier AND gives you a private place to transform DayBack's usernames into your FileMaker account names.
to:
You can download the %newwin% [[https://www.seedcode.com/?smd_process_download=1&download_id=11208 | PHP relay file here]], rename it, and edit your account information by changing a couple lines to reflect a FileMaker account name and password that have read/write access to your FileMaker file.

The technical reason for needing this file is that FileMaker server does not allow http XMLRequests directly to the XML API from another domain, and changing this involves modifying the Web Server settings. Such a modification is actually pretty easy in Windows/IIS, but not so in Mac/FileMaker Server/Apache. In either case, dropping a single PHP relay file into the FileMaker Server's root directory is much easier AND gives you a private place to transform DayBack's usernames into your FileMaker account names.
November 17, 2017, at 05:58 PM by KC Embrey - added #TextEditor section
Added lines 16-22:

[[#TextEditor]]
'''Text Editor'''

The PHP relay file needs to be edited in a plain text format. The default text editor in Mac, TextEdit, is normally editing in rich text format. If you use TextEdit, make sure to change the settings when opening the PHP relay file by clicking the "Format" menu and then select "Make Plain Text".

In Windows, WordPad is a rich text editor, so you'll want to instead use the default plain text editor, notepad.
August 10, 2017, at 04:23 PM by Dan Wheelon - FM Server 13 "and higher"
Changed line 80 from:
In '''FileMaker Server 13 and 14''' the locations are:
to:
In '''FileMaker Server 13 and higher''' the locations are:
July 13, 2017, at 01:12 AM by KC Embrey - Added info on whitelisting DayBack's servers
Changed lines 96-108 from:
(:include MultipleServerMachines:)
to:
(:include MultipleServerMachines:)

[[#Whitelisting]]
!! Whitelisting DayBack
In the PHPRelay file, you can limit the connections that the PHP relay will respond to by changing the following line:

->header('Access-Control-Allow-Origin: *')

to:

->header('Access-Control-Allow-Origin: app.dayback.com')

This way, only traffic from DayBack's servers will be allowed to retrieve the data from your FileMaker server.
July 20, 2015, at 04:00 PM by 142.4.217.188 -
Changed lines 96-117 from:
!!Multi-Machine Server Configuration

If you have a multi-machine server configuration where your Web Server and Web Publishing Engine are on separate machines, then you'll need to make a few changes to the PHP relay file.

In this scenario, you want to put the PHP relay file in the Web Server root directory unless you're specifying a specific sub-folder in the directory for the PHP Relay location in DayBack, ''php/fmxjRelay.php'' for example.

'''SSL Not Required:''' if your FileMaker Server does not require SSL connections, and the Web Publishing Engine and Web Server are on separate machines then you want to change the '''$serverAddress''' variable to the IP address of the Web Publishing Engine. For example:

-->//FMS WPE address
-->$serverAddress="192.168.1.123";

'''SSL Required:''' if your FileMaker Server does require SSL connections, and the Web Publishing Engine and Web Server are on separate machines then you want to change the '''$serverAddress''' variable to the FQDN (Fully Qualified Domain Name) that is associated with the SSL Certificate. You will also need to change the '''$port''' variable to 443 and the '''$http''' variable to "https".
For Example:

-->//The FQDN for our FMS
-->$serverAddress="yourserver.yourdomain.com";

-->//https protocol required by FMS
-->$http="https";

-->//SSL required so go through SSL port 443
-->$port=443;
to:
(:include MultipleServerMachines:)
July 20, 2015, at 03:32 PM by 142.4.217.187 -
Changed line 96 from:
!!Multi-Machine Server Configuration'''
to:
!!Multi-Machine Server Configuration
July 20, 2015, at 03:32 PM by 142.4.217.187 -
Changed line 96 from:
'''Multi-Machine Server Configuration'''
to:
!!Multi-Machine Server Configuration'''
July 13, 2015, at 05:13 PM by 142.4.217.187 -
Changed lines 5-8 from:
You will need to use a php Relay whenever you web server (dayback.com) and your FileMaker server are located apart from each other.

DayBack comes with a simple PHP file (fmxjRelay.PHP) that you can use for this. This is the same file used in SeedCode's open source
[[https://www.seedcode.com/fmxj/fmxj.html | fmxj project]] and the file doesn't have any DayBack logic in it. It's real use is to let you keep your FileMaker account names and passwords on your FileMaker Server and our of DayBack. You can modify the file as you see fit.
to:
You will need to use a php Relay to connect (dayback.com) to your FileMaker Server.

DayBack comes with a simple PHP file (fmxjRelay.php) that you can use. This is the same file used in SeedCode's open source
[[https://www.seedcode.com/fmxj/fmxj.html | fmxj project]] and the file doesn't have any DayBack logic in it. It's real use is to let you keep your FileMaker account names and passwords on your FileMaker Server and out of DayBack. You can modify the file as you see fit.
Deleted lines 12-31:
!! Where does the file go?

You'll place the PHPrelay file on your FileMaker Sever in the Web Publishing root.

In '''FileMaker Server 13 and 14''' the locations are:

-> � For IIS (Windows) through HTTP or HTTPS: \
[drive]:\Program Files\FileMaker\FileMaker Server\HTTPServer\Conf \
where [drive] is the drive on which the Web Publishing Engine component of your FileMaker Server deployment resides.

-> � For Apache (OS X) through https: /Library/FileMaker Server/HTTPServer/htdocs

-> � For Apache (OS X) through HTTPS: /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot

For '''FileMaker Server 12''' the locations are:

-> �  For IIS (Windows): <drive>:\Inetpub\wwwroot where <drive> is the drive on which the Web Publishing Engine component of your FileMaker server deployment resides.

-> � For Apache (Mac OS): /Library/WebServer/Documents

Changed lines 21-36 from:
--> if ($u==="[email protected]") {
--->  $u==="FileMakerUser"
--->  $p = "FileMakerPassword";
--> }
--> else if ($u==="[email protected]") {
--->  $u==="AnotherFileMakerUser";
--->  $p==="AnotherFileMakerPassword";
-->}
-->else {
--->  //or hardcoded credentials
--->  $u="accountname";
--->  $p="password";
-->}

Be sure that any FileMaker privilege sets used for DayBack users have the fmxml Extended Privilege enabled (to permit xml web publishing). Once you've edited the file, install it in your FileMaker Server's Web Publishing Engine (WPE) root directory. This will need to be installed before DayBack can work with your FileMaker files.

to:
-->//Edit method for logging users into FMS
-->//Set to false if you plan on having all users logged into FMS with the same account
-->$loginByName = false;

-->//Define your FM credentials here
-->//FM credentials from posted user name($u). The user name will be the DayBack account / email address.
-->if ($loginByName){
--->//set credentials based on the user's DayBack account name / email address.
--->if ($u="[email protected]") {
---->$u="fmxj";
---->$p = "fmxj";
--->}
--->else if ($u==="<[email protected]>") {
---->$u="<AnotherFileMakerUser>";
---->$p="<AnotherFileMakerPassword>";
--->}
-->}
-->//hardcoded credentials for all users
-->else{
--->$u="fmxj";
--->$p="fmxj";
-->}

If you would like to use one FileMaker account for every DayBack user you can just find the hard-coded user name at the bottom of the code block and change the username and password to match your account (this is set to "fmxj" for username and password by default):

-->//hardcoded credentials for all users
-->else{
--->$u="fmxj";
--->$p="fmxj";
-->}

If you would like to log users in based on their specific DayBack username you will need to set the "$loginByName" variable to true at the top of the code block shown above:

-->//Set to false if you plan on having all users logged into FMS with the same account
-->$loginByName = true;

Then you can utilize the If else statements below that to look for a specific DayBack account name and pass their corresponding FileMaker username and password:

-->//FM credentials from posted user name($u). The user name will be the DayBack account / email address.
-->if ($loginByName){
--->//set credentials based on the user's DayBack account name / email address.
--->if ($u="[email protected]") {
---->$u="fmxj";
---->$p = "fmxj";
--->}
--->else if ($u==="<[email protected]>") {
---->$u="<AnotherFileMakerUser>";
---->$p="<AnotherFileMakerPassword>";
--->}
-->}

'''Tip:''' We recommend that you start with one account and verify that everything is working before moving on and adding all of your user accounts to the file.

Be sure that any FileMaker privilege sets used for DayBack users have the fmxml Extended Privilege enabled (to permit xml web publishing). Once you've edited the file, copy it to your FileMaker Server's Web Publishing Engine (WPE) root directory. This will need to be installed before DayBack can work with your FileMaker files.

!! Where does the file go?

You'll place the PHPrelay file on your FileMaker Sever in the Web Publishing root.

In '''FileMaker Server 13 and 14''' the locations are:

-> � For IIS (Windows) through HTTP or HTTPS: \
[drive]:\Program Files\FileMaker\FileMaker Server\HTTPServer\Conf \
where [drive] is the drive on which the Web Publishing Engine component of your FileMaker Server deployment resides.

-> � For Apache (OS X) through https: /Library/FileMaker Server/HTTPServer/htdocs

-> � For Apache (OS X) through HTTPS: /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot

For '''FileMaker Server 12''' the locations are:

-> �  For IIS (Windows): <drive>:\Inetpub\wwwroot where <drive> is the drive on which the Web Publishing Engine component of your FileMaker server deployment resides.

-> � For Apache (Mac OS): /Library/WebServer/Documents

Changed lines 100-101 from:
In this scenario, you want the to put the PHP relay file in the Web Server root directory unless you're specifying a specific sub-folder in the directory for the PHP Relay location in DayBack, ''php/fmxjRelay.php'' for example.
to:
In this scenario, you want to put the PHP relay file in the Web Server root directory unless you're specifying a specific sub-folder in the directory for the PHP Relay location in DayBack, ''php/fmxjRelay.php'' for example.
Changed lines 111-112 from:
-->$serverAddress="sc-fms13-fms.fmsdb.com";
to:
-->$serverAddress="yourserver.yourdomain.com";
Changed lines 117-119 from:
-->$port=443;

to:
-->$port=443;
July 13, 2015, at 03:55 PM by 142.4.217.188 -
Changed line 59 from:
If you have a multi-machine server configuration where your WebServer and Web Publishing Engine are on separate machines, then you'll need to make a few changes to the PHP relay file.
to:
If you have a multi-machine server configuration where your Web Server and Web Publishing Engine are on separate machines, then you'll need to make a few changes to the PHP relay file.
July 13, 2015, at 03:53 PM by 142.4.217.188 -
Added lines 61-78:
In this scenario, you want the to put the PHP relay file in the Web Server root directory unless you're specifying a specific sub-folder in the directory for the PHP Relay location in DayBack, ''php/fmxjRelay.php'' for example.

'''SSL Not Required:''' if your FileMaker Server does not require SSL connections, and the Web Publishing Engine and Web Server are on separate machines then you want to change the '''$serverAddress''' variable to the IP address of the Web Publishing Engine. For example:

-->//FMS WPE address
-->$serverAddress="192.168.1.123";

'''SSL Required:''' if your FileMaker Server does require SSL connections, and the Web Publishing Engine and Web Server are on separate machines then you want to change the '''$serverAddress''' variable to the FQDN (Fully Qualified Domain Name) that is associated with the SSL Certificate. You will also need to change the '''$port''' variable to 443 and the '''$http''' variable to "https".
For Example:

-->//The FQDN for our FMS
-->$serverAddress="sc-fms13-fms.fmsdb.com";

-->//https protocol required by FMS
-->$http="https";

-->//SSL required so go through SSL port 443
-->$port=443;
July 13, 2015, at 03:38 PM by 142.4.217.187 -
Changed lines 55-62 from:
Be sure that any FileMaker privilege sets used for DayBack users have the fmxml Extended Privilege enabled (to permit xml web publishing). Once you've edited the file, install it in your FileMaker Server's Web Publishing Engine (WPE) root directory. This will need to be installed before DayBack can work with your FileMaker files.
to:
Be sure that any FileMaker privilege sets used for DayBack users have the fmxml Extended Privilege enabled (to permit xml web publishing). Once you've edited the file, install it in your FileMaker Server's Web Publishing Engine (WPE) root directory. This will need to be installed before DayBack can work with your FileMaker files.

'''Multi-Machine Server Configuration'''

If you have a multi-machine server configuration where your WebServer and Web Publishing Engine are on separate machines, then you'll need to make a few changes to the PHP relay file.


July 13, 2015, at 03:36 PM by 142.4.217.187 -
Changed lines 35-37 from:
Yes. The PHP relay file lets you hard-code login information used by DayBack into a file on your server... so this account information isn't stored on DayBack's servers or shared with DayBack.
to:
Yes. The PHP relay file lets you hard-code login information used by DayBack into a file on your server... so this account information isn't stored on DayBack's servers or shared with DayBack.  You also may need to make a few changes if you are running a multi-machine configuration of FMS.

'''FileMaker Login'''
July 02, 2015, at 09:48 PM by 142.4.217.188 -
Changed line 11 from:
The technical reason for needing this file is that FileMaker server does not allow cross domain httpXMLRequests directly to the XML API, and changing this involves modifying the Web Server settings. This is actually pretty easy in Windows/IIS, but not so in Mac/FileMaker Server/Apache. In either case, dropping a single PHP relay file into the FileMaker Server's root directory is much easier.
to:
The technical reason for needing this file is that FileMaker server does not allow  http XMLRequests directly to the XML API from another domain, and changing this involves modifying the Web Server settings. Such a modification is actually pretty easy in Windows/IIS, but not so in Mac/FileMaker Server/Apache. In either case, dropping a single PHP relay file into the FileMaker Server's root directory is much easier AND gives you a private place to transform DayBack's usernames into your FileMaker account names.
July 02, 2015, at 09:45 PM by 142.4.217.188 -
Changed lines 7-9 from:
DayBack comes with a simple PHP file (fmxjRelay.PHP) that you can use for this. This is the same file used in SeedCode's open source [[https://www.seedcode.com/fmxj/fmxj.html | fmxj project]] and the file doesn't have any DayBack logic in it. It's real use is to let you keep your FileMaker account names and passwords on your FileMaker Server and our of DayBack.

You
can download the %newwin& [[https://www.dayback.io/downloads/fmxjRelay.zip | PHP relay file here]], rename it, and edit your account information by changing a couple lines to reflect a FileMaker account name and password that have read/write access to your FileMaker file.
to:
DayBack comes with a simple PHP file (fmxjRelay.PHP) that you can use for this. This is the same file used in SeedCode's open source [[https://www.seedcode.com/fmxj/fmxj.html | fmxj project]] and the file doesn't have any DayBack logic in it. It's real use is to let you keep your FileMaker account names and passwords on your FileMaker Server and our of DayBack. You can modify the file as you see fit.

You can download the %newwin%
[[https://www.dayback.io/downloads/fmxjRelay.zip | PHP relay file here]], rename it, and edit your account information by changing a couple lines to reflect a FileMaker account name and password that have read/write access to your FileMaker file.
June 30, 2015, at 08:22 PM by 142.4.217.187 -
Changed line 42 from:
-> }
to:
--> }
June 30, 2015, at 08:22 PM by 142.4.217.187 -
Changed lines 42-51 from:
} \
else if ($u==="[email protected]") { \
  $u==="AnotherFileMakerUser"; \
  $p==="AnotherFileMakerPassword"; \
} \
else { \
  //or hardcoded credentials \
  $u="accountname"; \
  $p="password"; \
} \
to:
-> }
--> else if ($u==="[email protected]") {
--->  $u==="AnotherFileMakerUser";
--->  $p==="AnotherFileMakerPassword";
-->}
-->else {
--->  //or hardcoded credentials
--->  $u="accountname";
--->  $p="password";
-->}
June 30, 2015, at 08:21 PM by 142.4.217.187 -
Changed lines 39-41 from:
--> if ($u==="[email protected]") { \
  $u==="FileMakerUser" \
  $p = "FileMakerPassword"; \
to:
--> if ($u==="[email protected]") {
--->  $u==="FileMakerUser"
--->  $p = "FileMakerPassword";
June 30, 2015, at 08:21 PM by 142.4.217.187 -
Changed lines 5-6 from:
sfbas
to:
You will need to use a php Relay whenever you web server (dayback.com) and your FileMaker server are located apart from each other.

DayBack comes with a simple PHP file (fmxjRelay.PHP) that you can use for this. This is the same file used in SeedCode's open source [[https://www.seedcode.com/fmxj/fmxj.html | fmxj project]] and the file doesn't have any DayBack logic in it. It's real use is to let you keep your FileMaker account names and passwords on your FileMaker Server and our of DayBack.

You can download the %newwin& [[https://www.dayback.io/downloads/fmxjRelay.zip | PHP relay file here]], rename it, and edit your account information by changing a couple lines to reflect a FileMaker account name and password that have read/write access to your FileMaker file.

The technical reason for needing this file is that FileMaker server does not allow cross domain httpXMLRequests directly to the XML API, and changing this involves modifying the Web Server settings. This is actually pretty easy in Windows/IIS, but not so in Mac/FileMaker Server/Apache. In either case, dropping a single PHP relay file into the FileMaker Server's root directory is much easier.

Changed lines 35-53 from:
advd
to:
Yes. The PHP relay file lets you hard-code login information used by DayBack into a file on your server... so this account information isn't stored on DayBack's servers or shared with DayBack.

DayBack will pass the logged in user's DayBack user name (often the user's email address) into the relay: you can edit the relay file to pass the FileMaker account name and password for that user into FileMaker. Here are the lines you'll find in the relay file to change:

--> if ($u==="[email protected]") { \
  $u==="FileMakerUser" \
  $p = "FileMakerPassword"; \
} \
else if ($u==="[email protected]") { \
  $u==="AnotherFileMakerUser"; \
  $p==="AnotherFileMakerPassword"; \
} \
else { \
  //or hardcoded credentials \
  $u="accountname"; \
  $p="password"; \
} \

Be sure that any FileMaker privilege sets used for DayBack users have the fmxml Extended Privilege enabled (to permit xml web publishing). Once you've edited the file, install it in your FileMaker Server's Web Publishing Engine (WPE) root directory. This will need to be installed before DayBack can work with your FileMaker files.
June 30, 2015, at 08:00 PM by 142.4.217.188 -
Changed lines 19-20 from:
-> � For Apache (OS X) through HTTPS:
/Library/FileMaker Server/HTTPServer/htdocs/httpsRoot
to:
-> � For Apache (OS X) through HTTPS: /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot
June 30, 2015, at 08:00 PM by 142.4.217.188 -
June 30, 2015, at 07:59 PM by 142.4.217.187 -
Added lines 6-26:

!! Where does the file go?

You'll place the PHPrelay file on your FileMaker Sever in the Web Publishing root.

In '''FileMaker Server 13 and 14''' the locations are:

-> � For IIS (Windows) through HTTP or HTTPS: \
[drive]:\Program Files\FileMaker\FileMaker Server\HTTPServer\Conf \
where [drive] is the drive on which the Web Publishing Engine component of your FileMaker Server deployment resides.

-> � For Apache (OS X) through https: /Library/FileMaker Server/HTTPServer/htdocs

-> � For Apache (OS X) through HTTPS:
/Library/FileMaker Server/HTTPServer/htdocs/httpsRoot

For '''FileMaker Server 12''' the locations are:

-> �  For IIS (Windows): <drive>:\Inetpub\wwwroot where <drive> is the drive on which the Web Publishing Engine component of your FileMaker server deployment resides.

-> � For Apache (Mac OS): /Library/WebServer/Documents
June 30, 2015, at 01:15 AM by 142.4.217.188 -
Added lines 1-2:
(:title PHPrelay File:)
June 30, 2015, at 01:15 AM by 142.4.217.188 -
Added lines 1-7:
!! What is the PHPrelay file and why do I need one?

sfbas

!! Do I need to make any changes to the PHPrelay file?

advd
(855) SEEDCODE
[email protected]
Follow us: