コード例 #1
0
 private function __buildHeader()
 {
     // we have to build the http path here since this request is client independent!
     $httpPath = ilSoapFunctions::buildHTTPPath();
     $this->xmlSetDtdDef("<!DOCTYPE Installation PUBLIC \"-//ILIAS//DTD Group//EN\" \"" . $httpPath . "/xml/ilias_client_3_10.dtd\">");
     $this->xmlSetGenCmt("Export of ILIAS clients.");
     $this->xmlHeader();
     $this->xmlStartTag("Installation", array("version" => ILIAS_VERSION, "path" => $httpPath));
     return true;
 }
コード例 #2
0
<?php

/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
chdir("../..");
require_once "./include/inc.header.php";
include_once "./webservice/soap/include/inc.soap_functions.php";
$results = array();
foreach ($_POST as $key => $value) {
    if (preg_match("/value_(\\d+)_1/", $key, $matches)) {
        array_push($results, $_POST["value_" . $matches[1] . "_1"]);
        array_push($results, $_POST["value_" . $matches[1] . "_2"]);
        array_push($results, $_POST["points_" . $matches[1]]);
    }
}
$res = ilSoapFunctions::saveQuestion($_POST["session_id"] . "::" . $_POST["client"], $_POST["active_id"], $_POST["question_id"], $_POST["pass"], $results);
if ($res === true) {
    global $lng;
    $lng->loadLanguageModule("assessment");
    echo $lng->txt("result_successful_saved");
} else {
    global $lng;
    $lng->loadLanguageModule("assessment");
    echo $lng->txt("result_unsuccessful_saved");
}
コード例 #3
0
ファイル: imagemanager.php プロジェクト: arlendotcn/ilias
}
// allowed extentions for uploaded image files
$tinyMCE_valid_imgs = array('gif', 'jpg', 'jpeg', 'png');
// allow upload in image library
$tinyMCE_upload_allowed = true;
include_once 'webservice/soap/include/inc.soap_functions.php';
$mobs = ilSoapFunctions::getMobsOfObject(session_id() . '::' . CLIENT_ID, $_GET['obj_type'] . ':html', (int) $_GET['obj_id']);
$preview = '';
$img = isset($_POST['imglist']) ? $_POST['imglist'] : '';
$_root = $installpath;
$errors = array();
// upload images
if (isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) {
    include_once 'webservice/soap/include/inc.soap_functions.php';
    $safefilename = preg_replace('/[^a-zA-z0-9_\\.]/', '', $_FILES['img_file']['name']);
    $media_object = ilSoapFunctions::saveTempFileAsMediaObject(session_id() . '::' . CLIENT_ID, $safefilename, $_FILES['img_file']['tmp_name']);
    if (file_exists($iliasAbsolutePath . $iliasMobPath . 'mm_' . $media_object->getId() . '/' . $media_object->getTitle())) {
        // only save usage if the file was uploaded
        $media_object->_saveUsage($media_object->getId(), $_GET['obj_type'] . ':html', (int) $_GET['obj_id']);
    }
    $preview = $iliasHttpPath . $iliasMobPath . 'mm_' . $media_object->getId() . '/' . $media_object->getTitle();
    $mobs[$media_object->getId()] = $media_object->getId();
}
$tpl = new ilTemplate(dirname(__FILE__) . '/tpl.imagemanager.html', true, true);
// delete image
if ($tinyMCE_img_delete_allowed && isset($_POST['lib_action']) && $_POST['lib_action'] == 'delete' && !empty($img)) {
    deleteImg();
}
if ($tinyMCE_img_delete_allowed) {
    $tpl->touchBlock("delete_allowed");
}
コード例 #4
0
ファイル: server.php プロジェクト: JKN-INC/SHELBY-ILIAS
* @package ilias
*/
chdir("../..");
define("ILIAS_MODULE", "webservice/soap");
define("IL_SOAPMODE_NUSOAP", 0);
define("IL_SOAPMODE_INTERNAL", 0);
require_once "./Services/Init/classes/class.ilIniFile.php";
$ilIliasIniFile = new ilIniFile("./ilias.ini.php");
if (!$ilIliasIniFile) {
    define("IL_SOAPMODE", IL_SOAPMODE_NUSOAP);
} else {
    $ilIliasIniFile->read();
    $serverSettings = $ilIliasIniFile->readGroup("server");
    if (!array_key_exists("soap", $serverSettings) || $serverSettings["soap"] == "nusoap" || !class_exists("SoapServer")) {
        define("IL_SOAPMODE", IL_SOAPMODE_NUSOAP);
    } else {
        define("IL_SOAPMODE", IL_SOAPMODE_INTERNAL);
    }
}
include_once "Services/Context/classes/class.ilContext.php";
ilContext::init(ilContext::CONTEXT_SOAP);
if (IL_SOAPMODE == IL_SOAPMODE_INTERNAL && strcasecmp($_SERVER["REQUEST_METHOD"], "post") == 0) {
    // called by webservice
    //ini_set("soap.wsdl_cache_enabled", "1");
    include_once 'webservice/soap/include/inc.soap_functions.php';
    $soapServer = new SoapServer(ilSoapFunctions::buildHTTPPath() . "/webservice/soap/nusoapserver.php?wsdl");
    $soapServer->setClass("ilSoapFunctions");
    $soapServer->handle();
} else {
    include 'webservice/soap/nusoapserver.php';
}
コード例 #5
0
 /**
  * Call next task scheduler run
  */
 protected function initNextExecution()
 {
     global $ilLog;
     // Start task execution as backend process
     include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
     $soap_client = new ilSoapClient();
     $soap_client->setResponseTimeout(1);
     $soap_client->enableWSDL(true);
     $ilLog->write(__METHOD__ . ': Trying to call Soap client...');
     $new_session_id = ilSession::_duplicate($_COOKIE['PHPSESSID']);
     $client_id = $_COOKIE['ilClientId'];
     if ($soap_client->init() and 0) {
         $ilLog->write(__METHOD__ . ': Calling soap handleECSTasks method...');
         $res = $soap_client->call('handleECSTasks', array($new_session_id . '::' . $client_id, $this->settings->getServerId()));
     } else {
         $ilLog->write(__METHOD__ . ': SOAP call failed. Calling clone method manually. ');
         include_once './webservice/soap/include/inc.soap_functions.php';
         $res = ilSoapFunctions::handleECSTasks($new_session_id . '::' . $client_id, $this->settings->getServerId());
     }
 }
コード例 #6
0
ファイル: class.ilContainer.php プロジェクト: bheyser/qplskl
 /**
  * clone all objects according to this container
  *
  * @param string $session_id
  * @param string $client_id
  * @param string $new_type
  * @param int $ref_id
  * @param int $clone_source
  * @param array $options
  * @return new refid if clone has finished or parameter ref id if cloning is still in progress
  */
 public function cloneAllObject($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call = false)
 {
     global $ilLog;
     include_once './Services/Link/classes/class.ilLink.php';
     include_once 'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
     global $ilAccess, $ilErr, $rbacsystem, $tree, $ilUser;
     // Save wizard options
     $copy_id = ilCopyWizardOptions::_allocateCopyId();
     $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
     $wizard_options->saveOwner($ilUser->getId());
     $wizard_options->saveRoot($clone_source);
     // add entry for source container
     $wizard_options->initContainer($clone_source, $ref_id);
     foreach ($options as $source_id => $option) {
         $wizard_options->addEntry($source_id, $option);
     }
     $wizard_options->read();
     $wizard_options->storeTree($clone_source);
     // Special handling for course in existing courses
     if ($new_type == 'crs' and ilObject::_lookupType(ilObject::_lookupObjId($ref_id)) == 'crs') {
         $ilLog->write(__METHOD__ . ': Copy course in course...');
         $ilLog->write(__METHOD__ . ': Added mapping, source ID: ' . $clone_source . ', target ID: ' . $ref_id);
         $wizard_options->read();
         $wizard_options->dropFirstNode();
         $wizard_options->appendMapping($clone_source, $ref_id);
     }
     #print_r($options);
     // Duplicate session to avoid logout problems with backgrounded SOAP calls
     $new_session_id = ilSession::_duplicate($session_id);
     // Start cloning process using soap call
     include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
     $soap_client = new ilSoapClient();
     $soap_client->setResponseTimeout(30);
     $soap_client->enableWSDL(true);
     $ilLog->write(__METHOD__ . ': Trying to call Soap client...');
     if ($soap_client->init()) {
         $ilLog->write(__METHOD__ . ': Calling soap clone method...');
         $res = $soap_client->call('ilClone', array($new_session_id . '::' . $client_id, $copy_id));
     } else {
         $ilLog->write(__METHOD__ . ': SOAP call failed. Calling clone method manually. ');
         $wizard_options->disableSOAP();
         $wizard_options->read();
         include_once './webservice/soap/include/inc.soap_functions.php';
         $res = ilSoapFunctions::ilClone($new_session_id . '::' . $client_id, $copy_id);
     }
     // Check if copy is in progress or if this has been called by soap (don't wait for finishing)
     if ($soap_call || ilCopyWizardOptions::_isFinished($copy_id)) {
         return $res;
     } else {
         return $ref_id;
     }
 }
コード例 #7
0
 private function callNextDependency($sid, $cp_options)
 {
     global $ilLog;
     $cp_options->dropFirstDependenciesNode();
     if ($cp_options->isSOAPEnabled()) {
         // Start next soap call
         include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
         $soap_client = new ilSoapClient();
         $soap_client->setResponseTimeout(1);
         $soap_client->enableWSDL(true);
         $soap_client->init();
         $soap_client->call('ilCloneDependencies', array($sid, $cp_options->getCopyId()));
     } else {
         $ilLog->write(__METHOD__ . ': Cannot call SOAP server');
         $cp_options->read();
         include_once './webservice/soap/include/inc.soap_functions.php';
         $res = ilSoapFunctions::ilCloneDependencies($sid, $cp_options->getCopyId());
     }
     return true;
 }