Remote Content & Posting FORM DATA back into matrix

Hi


For a number of reasons (mainly the requirement to recompile PHP to enable MS SQL data connections within Matrix) im using a remote content page to select data from an external MS DB.

I have setup the remote file[s] and the remote content asset works fine, it is also succesully passing through the POST values from matrix --> my remote page.



What I am trying to do now, is submit data back to matrix whether it be POST, SESSION or a cookie - to confirm the results of the actions within my remote page.



The remote content is a basic authentication page (doing a lookup on an external MS DB) and if verified, I want to push them back to matrix and then use the resultant data to allow them acces to certain pages.



I guess I have 2 questions:


  1. Does anyone have any suggestions on how I can pass data back into Matrix from a Remote Content Page.



    and;


  2. Is there any method of restricting access to an asset (usng a paint layour perhaps?) using session/form/cookie data (that I would hopefully have obtained from the step above)!.



    Any assistance or advice appreciated.



    Regards,

    Joel

[quote]
Hi



For a number of reasons (mainly the requirement to recompile PHP to enable MS SQL data connections within Matrix) im using a remote content page to select data from an external MS DB.

I have setup the remote file[s] and the remote content asset works fine, it is also succesully passing through the POST values from matrix --> my remote page.



What I am trying to do now, is submit data back to matrix whether it be POST, SESSION or a cookie - to confirm the results of the actions within my remote page.



The remote content is a basic authentication page (doing a lookup on an external MS DB) and if verified, I want to push them back to matrix and then use the resultant data to allow them acces to certain pages.



I guess I have 2 questions:


  1. Does anyone have any suggestions on how I can pass data back into Matrix from a Remote Content Page.



    and;


  2. Is there any method of restricting access to an asset (usng a paint layour perhaps?) using session/form/cookie data (that I would hopefully have obtained from the step above)!.



    Any assistance or advice appreciated.



    Regards,

    Joel

    [/quote]



    I think you will have a hard job doing that as the authentication model is working against you! The easiest ways to pass data back to Matrix are to eg do a POST request on Matrix and use that to fire a trigger. You can do conditions based on session/form/cookie data in paint layouts.



    A cookie is not going to be secure, so best is to set a session variable based on an inbound POST variable I think. It might be easier to use the REST remote content to do that, not the normal remote content, but it should be workable.



    Then in the paint layout set a condition based on the value of %globals_session_XXX% or similar.



    A completely different approach is that Matrix can accept Apache authentication variables, so you can do everything there - may be more difficult though.

There might be some useful information on the matrix SOAP interface in the web services manual that may help you (Documentation).


As for restricting the content, you could potentially use a paint layout to place a condition around the %asset_contents% keyword that could be based on a session variable, or perhaps even IP address if you want to restrict it to this particular server.

[quote]
I think you will have a hard job doing that as the authentication model is working against you! The easiest ways to pass data back to Matrix are to eg do a POST request on Matrix and use that to fire a trigger. You can do conditions based on session/form/cookie data in paint layouts.



A cookie is not going to be secure, so best is to set asession variablebased on an inbound POST variable I think. It might beeasier to use theREST remote content to do that, not the normal remotecontent, but itshould be workable.

[/quote]



Hi Justin,



Thanks for your reply.



The data itself isn't particularly sensitive, we just need to restrict it from being easily accessed so we can;





[font="Verdana"][size="2"]a] Crudely track who/how often people are accessingthe data (we need more than just IP/Server info).[/size][/font]



[font="Verdana"][size="2"]b] Make it at least a little bit difficult toshare/publish a link to the data (to keep the information we are trying tocollect above accurate).[/size][/font]






[quote]





Then in the paint layout set a condition based on the value of %globals_session_XXX% or similar.



Acompletely different approach is that Matrix can accept Apacheauthentication variables, so you can do everything there - may be moredifficult though.

[/quote]



Im rather new to Paint Layouts, remote content and some of these concept (have mainly used pages, and assets in sites that have already been created with designs etc) - but I think ive got it working.

I now have my external authentication session working and that then displays an message accordining to whether they are authenticated or not.



I am then able to succesfully push a POST variable into Matrix. Im currently just displaying this on the screen with %globals_post_testPOSTvariable% and it seems to be working.



Now I just have to work out how to trigger the setting of a session variable (so Matrix rembers that the session is authenticated) and I think I will have achieved what I need.

Looks like you are nearly there then! I think the last part should be straightforward…

[quote]
Looks like you are nearly there then! I think the last part should be straightforward…

[/quote]



Still having problems alas.



I cant seem to get the paint layout working with conditional keywords (POST variable). Should I be able to do a direct string comparison as per the example below?

I think ive got the regex/check wrong, but the paint layout doco is rather vague and I cant see any more specific information or instruction.



http://imagesocket.com/view/15_01_2010_6_04_19_PM1db.png



As i mentioned, I can get the POST variable outputted to the screen but the rules (example above) arent being validated as I would expect.



-Joel

Are you sure that you are using one of the php server variables? Not your own post var name.

[quote]
Are you sure that you are using one of the php server variables? Not your own post var name.

[/quote]





Im using %globals_post_VARIABLENAME% which works if I output this to the browser, but my conditional rules (based on it) dont seem to work.

Server variables are not POST variables!


server variables are $_SERVER or %globals_server_XXX% vs $_POST which is %globals_post_XXX%

[quote]
Server variables are not POST variables!



server variables are $_SERVER or %globals_server_XXX% vs $POST which is %globals_post_XXX%

[/quote]



Thanks! You are indeed correct and I was going slowly mad confusing global with server variables.



Ive now got it working (the conditional rule) with a keyword pattern match. Then choosing "globals_post
" as the keyword (once commiting the change you can set the actual POST variable) and running the pattern match on that.



Thanks for your assistance. Only one more part to go!