The first solution I tried was to change the behavior of MY_Model so
that it could be told to ignore the tenant_id flag in certain cases.
This worked sometimes but it required a lot of patching in certain
places and it made the TwiML interface a little messy because the
callback URLs given to Twilio didn't have a tenant in them... so I
scrapped that plan.
The next solution was a really good one that Nathan came up with and
that was just to put a catch in the bottom of the MY_Controller
constructor to compare the URLs tenant id to the users tenant id and
redirect them if necessary. Nathan and I also modified MY_Model so
that it would use the tenant ID of the user in the object lookup
instead of the tenant ID from the URL (this made login possible from /
for tenants for example). I also added the tenant ID to the session
store for easier referral later.
This worked pretty well but I still ran into issues in some places
like the REST API because that doesn't go through the Auth/login
controller and so the tenant session store change I made wasn't being
applied. (Nathan might have had better luck with it than I did,
though).
So last night I came up with a variant on that solution and now I just
redirect them to the proper /<tenant>/messages/inbox URL on login
instead of in the MY_Controller constructor method. I also made the
user tenant id mapping in the Model class smarter about detecting that
there was no tenant id set in some cases and that fixed my issue of
the "call to record a greeting" function being broken.
Current State: SFWUpload is still broken. I'm sure the fix for that
is closely related, though. In its current form tenants in our system
can log in by going to voicecloudvcx.com and everything but upload
works as expected.
Andrew Watson
http://tumblr.gleep.org/
http://about.me/andrewwatson/bio
Sounds like a great plan. Lets review the patch for this support once
swfupload is fixed.
Best,
Adam
Actually I fixed that too. It was only broken because I had taken the tenant id out of the cookie name. Thinking of putting that back though...