Ben,
Happy to share what I did. First of all as I've mentioned here in this forum in a previous thread, I've added code to use our centrally located CAS service for authentication in FormTools. This was actually quite simple because of the way you implement authentication in your FT code base.
To "CASify" FormTools, I have modified 3 files: /index.php, /global/session_start.php and /global/code/accounts.php.
The majority of the actual phpCAS code is inside the index.php page and session_start.php. But, even then there isn't much to it. I am still using the FT client accounts, just in this case everyone has a uNID (University Network ID) that is stored in our directory. So, to create a new client in FormTools all I need to know the person's name, email and uNID.
Their FT username is their uNID and everyone gets the same password, it's hard coded to "formtools".
My clients never see the FormTools login page, they get re-directed to CAS authentication if not already authenticated, if they are authenticated they get redirected to their default login page.
Now, to the point of this thread.
The way I've added single-click access to the edit_submission.php page is simple too. I added code in one file: /global/code/accounts.php inside the ft_login() function at the bottom. Here's what I added:
if (isset($_GET['submission_id']) && isset($_GET['view_id']) && isset($_GET['form_id'])){
$redirectURL = "".$g_root_url."/clients/forms/edit_submission.php?form_id=".$_GET["form_id"]."&view_id=".$_GET["view_id"]."&submission_id=".$_GET["submission_id"]."";
header("Location: $redirectURL");
exit;
}else{
header("Location: $login_url");
exit;
}
Seems to work whether the user is already logged in or if they have not authenticated yet, once they authenticate through CAS they get redirected to the edit_submission.php page in context for that user.
One other thing I have done is to slim down the index.php page from it's current form. Main reason is that we're not using much of the code in there anyway? It's basically just a redirect page since we're not using FT authentication.
If you want more specifics, I'll be happy to share them with you Ben. It's the least I can do, FormTools is AWESOME!
You have done a fantastic job!
Marc
Note: Here's a look at other CASified apps:
https://wiki.jasig.org/display/CAS/CASif...plications
(Apr 16th, 2012, 1:02 PM)Ben Wrote: Hey Marc,
I *am* interested! If the user's not logged in, they'll just get booted out when they link to the edit_submission.php page (with the various query params), and the system isn't yet smart enough to redirect them to the appropriate page after logging in. Did you add that in?
- Ben