Integrate OsTicket into Drupal 7

Our main web page is Drupal and we would like to use Osticket as our issue tracking system, but there is a problem with Osticket: anybody can create new tickets.

We can protect this by .htaccess, but we don't want do that; we would like to make this protect by Drupal: only authenticated users should access the Osticket page.

Is there a way to achieve this?

Answers


Found a solution here: http://osticket.com/forum/discussion/9910/integrate-with-drupal-7

Here is the relevant part:

Preamble

It just so happens I was doing some off-again on-again work with integrating this into Drupal.

If you're just interested in ensuring a user is logged you're right, you need bootstrap.inc and you're right you end up with useless blank pages.

Solution

I've yet to get to properly documenting, so try this and let me know if I missed something and I'll have another look, however the following should sort the issue:

Duplicate Function Names

osTicket uses db_query() and (I think) db_close() rename the functions to something like db_ost_query() and you'll be fine. (Note I put the 'ost' in the middle to help future find/replace) I can't remember whether all occurrences of the function needed renaming for it to work, but its probably a good idea to do it.

Location of the bootstrap

The bootstrap has all manner of issues if called from outside the root Drupal directory, I gave up finding an answer to this and just kept an file in the root that osticket would include.

Headers, Headers everywhere

Bootstrap seems to like sending additional headers out so you'd want to include your file in an appropriate location (i.e. one of the .inc files). I think this solved everything.

Disclaimer

Of course, remember this will break on any updates and any mods you add you'd have to take this into account. If I've remembered rightly this will get bootstrap up and running and you can run is_user_logged_in() and show or redirect the page.

Further Concerns

I actually had a greater goal in mind in my meddling and so I don't remember whether everything was perfectly cosy after this addition.

I do remember having further issues with headers being sent and when fully bootstrapping the system session usage interfering with ostickets sessions - I think this occurred later though and shouldn't be an issue for you.

An Alternative Solution

When googling, many people suggested simply creating a module and having it iframe the contents inside it, this might be a good enough solution for what you want and would require a whole lot less messing around with ostickets code.


Need Your Help

Compass ellipsis syntax

css twitter-bootstrap compass-sass sass

I feel like an idiot but I really cannot figure this out.

WebView slow loading url

android html ios webview

To test a url in WebView realize that it takes about 6 ~ 8 seconds to load. Compared to iOS, the WebView takes only 2 seconds. Both devices are on the same wifi network. I am using the following se...