/** * Delete all delivered files of user * * @param int $a_eph_id exercise id * @param int $a_user_id user id */ static function deleteAllDeliveredFilesOfUser($a_eph_id, $a_user_id) { global $ilDB; include_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/classes/class.ilFSStorageEphorus.php"; include_once './Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/include/class.EphorusApi.php'; $service = new EphorusService(); // get the files and... $set = $ilDB->query("SELECT * FROM rep_robj_xeph_subm " . " WHERE obj_id = " . $ilDB->quote($a_eph_id, "integer") . " AND user_id = " . $ilDB->quote($a_user_id, "integer")); while ($rec = $ilDB->fetchAssoc($set)) { if ($rec['guid']) { $service->visibilityService($rec['guid'], EphorusService::INVISIBLE); } $fs = new ilFSStorageEphorus($a_eph_id, $rec["ass_id"]); // ...delete files $filename = $fs->getAbsoluteSubmissionPath() . "/" . $a_user_id . "/" . basename($rec["filename"]); if (is_file($filename)) { unlink($filename); } } // delete rep_robj_xeph_subm records $ilDB->manipulate($d = "DELETE FROM rep_robj_xeph_subm WHERE " . " obj_id = " . $ilDB->quote($a_eph_id, "integer") . " AND user_id = " . $ilDB->quote($a_user_id, "integer")); }
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"); } }
* @package Ephoruscomms * @subpackage Reporting Service * @author Guido Bonnet * @copyright 2012 onwards Ephorus {@link http://ephorus.com} */ error_reporting(-1); ini_set("error_reporting", E_ALL); ini_set("display_errors", 1); include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'class.EphorusApi.php'; if (isset($_GET['ephorus_version'])) { echo '--------------- Ephorus Version ---------------' . "\n"; $status = new EphorusStatus(); $status->versions(); echo '-----------------------------------------------'; exit; } if (isset($_GET['wsdl'])) { header("Content-Type:text/xml"); echo file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ReportingService.wsdl'); exit; } $reporting_service = new EphorusService(); function report($report) { global $reporting_service; $reporting_service->reportingService($report); } $server = $reporting_service->initReportingService(); $server->addFunction('report'); $server->handle(); exit;
<?php /** * handinservice.php - File for sending documents to Ephorus * * @package Ephoruscomms * @subpackage Handin Service * @author Guido Bonnet * @copyright 2012 onwards Ephorus {@link http://ephorus.com} */ include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'class.EphorusApi.php'; $hand_in_service = new EphorusService(); $hand_in_service->handInService();
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; } }