function changeVisibility() { global $ilCtrl, $lng; include_once dirname(dirname(__FILE__)) . '/include/class.EphorusApi.php'; $document = DLEApi::getDocument($_GET['doc_id']); $index = $document->visibility_index == 1 ? 2 : 1; $ephorus_service = new EphorusService(); if ($ephorus_service->visibilityService($_GET['doc_id'], $index)) { // The service worked well, getting the result. ilUtil::sendSuccess($lng->txt("rep_robj_xeph_msg_change_index"), true); $ilCtrl->redirect($this, "showSubmissions"); } else { ilUtil::sendFailure($lng->txt("rep_robj_xeph_msg_no_change_index"), true); $ilCtrl->redirect($this, "showSubmissions"); } }
public function testIndex() { /* Initiate the service class */ $service = new EphorusService(false); /* Get the index address */ $index_address = DLEApi::getSetting('index_address'); if ($index_address == '') { return false; } $curl = curl_init($index_address); curl_setopt($curl, CURLOPT_RETURNTRANSFER, false); curl_setopt($curl, CURLOPT_FAILONERROR, true); if (DLEApi::getProxySetting('host')) { curl_setopt($curl, CURLOPT_PROXY, DLEApi::getProxySetting('host') . ':' . DLEApi::getProxySetting('port')); } if (!curl_exec($curl) || !strpos($index_address, 'wsdl')) { return false; } /* Initiate soap */ $soap_client = $service->initSoapClient($index_address, 'visibility'); /* Try to change file's visibility index */ try { @$soap_client->IndexDocument(array('documentGuid' => '123456-123456-123456-123456', 'indexType' => 2)); return true; } catch (SoapFault $e) { return true; } }