Thanks Ray - to be honest all of that can probably go from that page - it's only still there for my reference.
All I really know is that the http request back in the app needs some response from the web server to let it know whether the login was successful or not. Will have a look in that other helpergroupsrulesrulesphp.php file, but I might come back to you.