Make compatible with ownCloud 7

The code is ugly and not very nice but works (TM) which is what @stp-ip wanted ;-)
OC_Request is private, you can actually use $this->request->server['SERVER_NAME'] etc