33include_once 
'./webservice/soap/classes/class.ilSoapAdministration.php';
 
   39        return ignore_user_abort(
true);
 
   44        $this->soap_check = 
false;
 
   58        if (!$this->__checkSession($sid)) {
 
   62        include_once 
'Services/Mail/classes/class.ilMail.php';
 
   63        include_once 
'webservice/soap/classes/class.ilSoapMailXmlParser.php';
 
   68            libxml_use_internal_errors(
true);
 
   69            $ok = simplexml_load_string($a_mail_xml);
 
   71                foreach (libxml_get_errors() as $err) {
 
   72                    $error .= ($err->message . 
' ');
 
   77        } 
catch (InvalidArgumentException 
$e) {
 
   78            $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
' ' . 
$e->getMessage());
 
   81            $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
' ' . 
$e->getMessage());
 
   91        foreach ($mails as $mail) {
 
   93            include_once 
'./Services/Mail/classes/class.ilFileDataMail.php';
 
   95            foreach ((array) $mail[
'attachments'] as $attachment) {
 
   97                $file->storeAsAttachment($attachment[
'name'], $attachment[
'content']);
 
  102            $mail_obj->setSaveInSentbox(
true);
 
  103            $mail_obj->saveAttachments((array) $attachments);
 
  105                implode(
',', (array) $mail[
'to']),
 
  106                implode(
',', (array) $mail[
'cc']),
 
  107                implode(
',', (array) $mail[
'bcc']),
 
  109                implode(
"\n", (array) $mail[
'body']),
 
  110                (array) $attachments,
 
  111                array($mail[
'type']),
 
  112                (
bool) $mail[
'usePlaceholders']
 
  116            foreach ((array) $attachments as $att) {
 
  117                $file->unlinkFile($att);
 
  119            $mail_obj->savePostData(
 
  140        if (!$this->__checkSession($sid)) {
 
  144        include_once 
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
 
  153        if (!$this->__checkSession($sid)) {
 
  157        include_once 
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
 
  170        if(!$is_initialized) {
 
  175            if (!$this->__checkSession($sid)) {
 
  185        include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
 
  189        if (!$cp_options->checkOwner(
$ilUser->getId())) {
 
  195        if (($node = $cp_options->fetchFirstDependenciesNode()) === 
false) {
 
  196            $cp_options->deleteAll();
 
  202        $options = $cp_options->getOptions($node[
'child']);
 
  204        switch ($options[
'type']) {
 
  206                ilLoggerFactory::getLogger(
'obj')->debug(
': Omitting node: ' . $node[
'obj_id'] . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  211                ilLoggerFactory::getLogger(
'obj')->debug(
': Start cloning dependencies for node: ' . $node[
'obj_id'] . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  217                ilLoggerFactory::getLogger(
'obj')->debug(
': Start cloning dependencies: ' . $node[
'obj_id'] . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  223                ilLoggerFactory::getLogger(
'obj')->warning(
'No valid action type given for node: ' . $node[
'obj_id'] . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  238    public function ilClone($sid, $copy_identifier)
 
  243        if (!$this->__checkSession($sid)) {
 
  251        include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
 
  255        if (!$cp_options->checkOwner(
$ilUser->getId())) {
 
  262        if (($node = $cp_options->fetchFirstNode()) === 
false) {
 
  268        $options = $cp_options->getOptions($node[
'child']);
 
  275                ilLoggerFactory::getLogger(
'obj')->debug(
': Omitting node: ' . $node[
'obj_id'] . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  277                $cp_options->appendMapping($node[
'child'], 0);
 
  283                ilLoggerFactory::getLogger(
'obj')->debug(
'Start cloning node: ' . $node[
'obj_id'] . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  284                $new_ref_id = $this->
cloneNode($node, $cp_options);
 
  289                ilLoggerFactory::getLogger(
'obj')->debug(
'Start linking node: ' . $node[
'obj_id'] . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  290                $new_ref_id = $this->
linkNode($node, $cp_options);
 
  294            case \ilCopyWizardOptions::COPY_WIZARD_LINK_TO_TARGET:
 
  295                ilLoggerFactory::getLogger(
'obj')->debug(
'Start creating internal link for: ' . $node[
'obj_id'] . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  301                ilLoggerFactory::getLogger(
'obj')->warning(
'No valid action type given for: ' . $node[
'obj_id'] . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  316        if (array_key_exists(
'type', $options)) {
 
  317            $default_mode = $options[
'type'];
 
  320            array_key_exists(
'child', $node) &&
 
  323            return $default_mode;
 
  329                return \ilCopyWizardOptions::COPY_WIZARD_LINK_TO_TARGET;
 
  332        return $default_mode;
 
  344        $logger = 
$DIC->logger()->obj();
 
  345        $tree = 
$DIC->repositoryTree();
 
  347        $obj_id = $node[
'obj_id'];
 
  352            $logger->debug(
'Validating node: ' . $ref_id . 
' and root ' . $root );
 
  353            $logger->dump(
$DIC->repositoryTree()->getRelation($ref_id , $root));
 
  356                $logger->debug(
'Ignoring non child relation');
 
  360            $logger->dump($mappings);
 
  361            if (array_key_exists($ref_id, $mappings)) {
 
  362                $logger->debug(
'Found existing mapping for linked node.');
 
  363                return $mappings[$ref_id];
 
  366        $logger->info(
'Nothing found');
 
  384        $cp_options->dropFirstNode();
 
  386        if ($cp_options->isSOAPEnabled()) {
 
  388            include_once 
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
 
  390            $soap_client->setResponseTimeout(1);
 
  391            $soap_client->enableWSDL(
true);
 
  392            $soap_client->init();
 
  393            $soap_client->call(
'ilClone', array($sid,$cp_options->getCopyId()));
 
  397            include_once(
'./webservice/soap/include/inc.soap_functions.php');
 
  409        $cp_options->dropFirstDependenciesNode();
 
  411        if ($cp_options->isSOAPEnabled()) {
 
  413            include_once 
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
 
  415            $soap_client->setResponseTimeout(1);
 
  416            $soap_client->enableWSDL(
true);
 
  417            $soap_client->init();
 
  418            $soap_client->call(
'ilCloneDependencies', array($sid,$cp_options->getCopyId()));
 
  422            include_once(
'./webservice/soap/include/inc.soap_functions.php');
 
  440        $tree = 
$DIC[
'tree'];
 
  441        $ilAccess = 
$DIC[
'ilAccess'];
 
  442        $rbacreview = 
$DIC[
'rbacreview'];
 
  446        $source_id = $node[
'child'];
 
  447        $parent_id = $node[
'parent'];
 
  448        $options = $cp_options->getOptions($node[
'child']);
 
  449        $mappings = $cp_options->getMappings();
 
  451        if (!$ilAccess->checkAccess(
'copy', 
'', $node[
'child'])) {
 
  452            ilLoggerFactory::getLogger(
'obj')->error(
'No copy permission granted: ' . $source_id . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  455        if (!isset($mappings[$parent_id])) {
 
  456            ilLoggerFactory::getLogger(
'obj')->info(
'Omitting node ' . $source_id . 
', ' . $node[
'title'] . 
', ' . $node[
'type'] . 
'. No target found.');
 
  462            ilLoggerFactory::getLogger(
'obj')->notice(
'Omitting node ' . $source_id . 
', ' . $node[
'title'] . 
', ' . $node[
'type'] . 
'. Object has been deleted.');
 
  467        $new_obj = $orig->cloneObject((
int) 
$target_id, $cp_options->getCopyId());
 
  469        if (!is_object($new_obj)) {
 
  470            ilLoggerFactory::getLogger(
'obj')->error(
'Error copying ' . $source_id . 
', ' . $node[
'title'] . 
', ' . $node[
'type'] . 
'. No target found.');
 
  475        include_once 
"Services/AccessControl/classes/class.ilRbacLog.php";
 
  476        $rbac_log_roles = $rbacreview->getParentRoleIds($new_obj->getRefId(), 
false);
 
  481        $cp_options->appendMapping($source_id, $new_obj->getRefId());
 
  482        return $new_obj->getRefId();
 
  498        $source_id = $node[
'child'];
 
  499        $mappings = $cp_options->getMappings();
 
  501        if (!isset($mappings[$source_id])) {
 
  502            ilLoggerFactory::getLogger(
'obj')->debug(
'Omitting node ' . $source_id . 
', ' . $node[
'title'] . 
', ' . $node[
'type'] . 
'. No mapping found.');
 
  508        $orig->cloneDependencies(
$target_id, $cp_options->getCopyId());
 
  524        $ilAccess = 
$DIC->access();
 
  525        $logger = 
$DIC->logger()->obj();
 
  526        $rbacreview = 
$DIC->rbac()->review();
 
  527        $tree = 
$DIC->repositoryTree();
 
  528        $mappings = $cp_options->getMappings();
 
  534                $logger->error(
'Cannot create object instance.');
 
  539            $logger->error(
'Cannot create object instance for ref_id: ' . $source_id);
 
  540            $logger->error(
$e->getMessage());
 
  545        $node_parent = $node[
'parent'];
 
  546        if (!array_key_exists($node_parent, $mappings)) {
 
  547            $logger->error(
'Cannot new parent id for node: ' . $node[
'parent']);
 
  550        $parent_id = $mappings[$node_parent];
 
  552        $new_ref_id = $orig->createReference();
 
  553        $orig->putInTree($parent_id);
 
  554        $orig->setPermissions($parent_id);
 
  556        if (!($new_ref_id)) {
 
  557            $logger->warning(
'Creating internal link failed.');
 
  562        $rbac_log_roles = $rbacreview->getParentRoleIds($new_ref_id, 
false);
 
  567        $cp_options->appendMapping($node[
'child'], $new_ref_id);
 
  569        $logger->notice(
'Added mapping for ' . $node[
'child'] . 
' ' . $new_ref_id);
 
  587        $ilAccess = 
$DIC[
'ilAccess'];
 
  588        $rbacreview = 
$DIC[
'rbacreview'];
 
  590        $source_id = $node[
'child'];
 
  591        $parent_id = $node[
'parent'];
 
  592        $options = $cp_options->getOptions($node[
'child']);
 
  593        $mappings = $cp_options->getMappings();
 
  595        if (!$ilAccess->checkAccess(
'delete', 
'', $node[
'child'])) {
 
  596            ilLoggerFactory::getLogger(
'obj')->warning(
'No delete permission granted: ' . $source_id . 
', ' . $node[
'title'] . 
', ' . $node[
'type']);
 
  599        if (!isset($mappings[$parent_id])) {
 
  600            ilLoggerFactory::getLogger(
'obj')->warning(
'Omitting node ' . $source_id . 
', ' . $node[
'title'] . 
', ' . $node[
'type'] . 
'. No target found.');
 
  606        $new_ref_id = $orig->createReference();
 
  610        if (!($new_ref_id)) {
 
  611            ilLoggerFactory::getLogger(
'obj')->error(
'Error linking ' . $source_id . 
', ' . $node[
'title'] . 
', ' . $node[
'type'] . 
'. No target found.');
 
  616        include_once 
"Services/AccessControl/classes/class.ilRbacLog.php";
 
  617        $rbac_log_roles = $rbacreview->getParentRoleIds($new_ref_id, 
false);
 
  622        $cp_options->appendMapping($source_id, $new_ref_id);
 
  638            if (is_array($error)) {
 
  639                foreach ($error as $err) {
 
  640                    $msg []= 
"(" . $err[
"line"] . 
"," . $err[
"col"] . 
"): " . $err[
"errormessage"];
 
  645            $msg = join(
"\n", $msg);
 
  656        if (!$this->__checkSession($sid)) {
 
  660        include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
 
  666        $ilLog->write(__METHOD__ . 
': Starting task execution...');
 
  668        $scheduler->startTaskExecution();
 
  697        $ilLog->write(__METHOD__ . 
': Started deletion of inactive user objects with expired confirmation hash values (dual opt in) ...');
 
  699        require_once 
'Services/Registration/classes/class.ilRegistrationSettings.php';
 
  709        if ((
int) $usr_id > 0) {
 
  710            $query .= 
'SELECT usr_id, create_date, reg_hash FROM usr_data ' 
  711                    . 
'WHERE active = 0 ' 
  712                    . 
'AND reg_hash IS NOT NULL ' 
  713                    . 
'AND usr_id = ' . 
$ilDB->quote($usr_id, 
'integer') . 
' ';
 
  717        $query .= 
'SELECT usr_id, create_date, reg_hash FROM usr_data ' 
  718                . 
'WHERE active = 0 ' 
  719                . 
'AND reg_hash IS NOT NULL ' 
  720                . 
'AND usr_id != ' . 
$ilDB->quote($usr_id, 
'integer') . 
' ';
 
  724        $ilLog->write(__METHOD__ . 
': ' . 
$ilDB->numRows(
$res) . 
' inactive user objects with confirmation hash values (dual opt in) found ...');
 
  732        $num_deleted_users = 0;
 
  734            if ($row[
'usr_id'] == ANONYMOUS_USER_ID || $row[
'usr_id'] == SYSTEM_USER_ID) {
 
  737            if (!strlen($row[
'reg_hash'])) {
 
  741            if ((
int) $oRegSettigs->getRegistrationHashLifetime() > 0 &&
 
  742               $row[
'create_date'] != 
'' &&
 
  743               time() - $oRegSettigs->getRegistrationHashLifetime() > strtotime($row[
'create_date'])) {
 
  746                    $ilLog->write(__METHOD__ . 
': User ' . $user->getLogin() . 
' (obj_id: ' . $user->getId() . 
') will be deleted due to an expired registration hash ...');
 
  748                    ++$num_deleted_users;
 
  753        $ilLog->write(__METHOD__ . 
': ' . $num_deleted_users . 
' inactive user objects with expired confirmation hash values (dual opt in) deleted ...');
 
  755        $ilLog->write(__METHOD__ . 
': Finished deletion of inactive user objects with expired confirmation hash values (dual opt in) ...');
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
getMappings()
Get Mappings.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
isRootNode($a_root)
Is root node.
const COPY_WIZARD_UNDEFINED
static _getInstanceByServerId($a_server_id)
get singleton instance Private access use ilECSTaskScheduler::start() or ilECSTaskScheduler::startTas...
static getLogger($a_component_id)
Get component logger.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Object not found exception.
Class ilObject Basic functions for all objects.
static _getAllReferences($a_id)
get all reference ids of object
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
Class ilObjAuthSettingsGUI.
SaxParserException thrown by ilSaxParser if property throwException is set.
initAuth($sid)
Init authentication.
__raiseError($a_message, $a_code)
static ilCloneDependencies($sid, $copy_identifier)
static ilClone($sid, $copy_identifier)
XML parser for soap mails.
callNextNode($sid, $cp_options)
Call next node using soap.
linkNode($node, $cp_options)
Link node.
ilCloneDependencies($sid, $copy_identifier, $is_initialized=false)
clone object dependencies (e.g.
internalLinkNode($node, $cp_options)
Link node @access private.
deleteExpiredDualOptInUserObjects($sid, $usr_id)
Method for soap webservice: deleteExpiredDualOptInUserObjects.
handleECSTasks($sid, $a_server_id)
saveTempFileAsMediaObject($sid, $name, $tmp_name)
rewriteActionForNode(ilCopyWizardOptions $cpo, array $node, array $options)
findMappedReferenceForNode(\ilCopyWizardOptions $cpo, array $node)
distributeMails($sid, $a_mail_xml)
mail via soap
getMobsOfObject($sid, $a_type, $a_id)
static validateXML($xml)
validates an xml file, if dtd is attached
ilClone($sid, $copy_identifier)
Clone object.
cloneDependencies($node, $cp_options)
cloneDependencies
cloneNode($node, $cp_options)
Clone node.
callNextDependency($sid, $cp_options)
static _sanitizeFilemame($a_filename)
domxml_open_mem($str, $mode=0, &$error=null)
foreach($_POST as $key=> $value) $res