function reset() { global $ilUser; include_once './Modules/Course/classes/class.ilCourseObjectiveResult.php'; // Debug ilObjUser::_writePref($ilUser->getId(), 'crs_objectives_force_details_' . $this->course_obj->getId(), 0); $tmp_obj_res =& new ilCourseObjectiveResult($ilUser->getId()); $tmp_obj_res->reset($this->course_obj->getId()); ilUtil::sendSuccess($this->lng->txt('crs_objectives_reseted')); $this->view(); }
/** * init details * * @access protected * @param * @return */ protected function initDetails() { global $ilUser; if (isset($_GET['details_level'])) { $this->details_level = (int) $_GET['details_level']; ilObjUser::_writePref($ilUser->getId(), 'crs_objectives_details', $this->details_level); } else { $this->details_level = $ilUser->getPref('crs_objectives_details') ? $ilUser->getPref('crs_objectives_details') : self::DETAILS_TITLE; } if (isset($_GET['objective_details'])) { $this->force_details = (int) $_GET['objective_details']; ilObjUser::_writePref($ilUser->getId(), 'crs_objectives_force_details_' . $this->getContainerObject()->getId(), $this->force_details); } elseif ($details_id = $ilUser->getPref('crs_objectives_force_details_' . $this->getContainerObject()->getId())) { $this->force_details = $details_id; } else { include_once './Modules/Course/classes/class.ilCourseObjective.php'; include_once './Modules/Course/classes/class.ilCourseObjectiveResultCache.php'; foreach (ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId()) as $objective_id) { if (ilCourseObjectiveResultCache::isSuggested($ilUser->getId(), $this->getContainerObject()->getId(), $objective_id)) { $this->force_details = $objective_id; break; } } } return true; }
/** */ protected function getMessages() { /** * @var $ilAccess ilAccessHandler * @var $ilUser ilObjUser * @var $lng ilLanguage */ global $ilAccess, $ilUser, $lng; $result = new stdClass(); $result->ok = false; if (!(int) $_REQUEST['ref_id']) { echo ilJsonUtil::encode($result); exit; } /** * @var $object ilObjChatroom */ $object = ilObjectFactory::getInstanceByRefId((int) $_REQUEST['ref_id'], false); if (!$object || !$ilAccess->checkAccess('read', '', $_REQUEST['ref_id'])) { ilObjUser::_writePref($ilUser->getId(), 'chatviewer_last_selected_room', 0); $result->errormsg = $lng->txt('msg_no_perm_read'); echo ilJsonUtil::encode($result); exit; } require_once 'Modules/Chatroom/classes/class.ilChatroom.php'; $room = ilChatroom::byObjectId($object->getId()); $block = new ilChatroomBlock(); $msg = $block->getMessages($room); $ilUser->setPref('chatviewer_last_selected_room', $object->getRefId()); ilObjUser::_writePref($ilUser->getId(), 'chatviewer_last_selected_room', $object->getRefId()); $result->messages = array_reverse($msg); $result->ok = true; include_once 'Services/JSON/classes/class.ilJsonUtil.php'; echo ilJsonUtil::encode($result); exit; }
/** * Create new ILIAS account * * @access public * * @param string external username */ public function create($a_username, $a_userdata = array()) { $a_userdata = $this->parseFullname($a_userdata); $this->writer->xmlStartTag('Users'); // Single users // Required fields // Create user $this->writer->xmlStartTag('User', array('Action' => 'Insert')); $this->writer->xmlElement('Login', array(), $new_name = ilAuthUtils::_generateLogin($a_username)); // Assign to role only for new users $this->writer->xmlElement('Role', array('Id' => $this->settings->getDefaultRole(), 'Type' => 'Global', 'Action' => 'Assign'), ''); if (isset($a_userdata['email'])) { $this->writer->xmlElement('Email', array(), $a_userdata['email']); } if (isset($a_userdata['postcode'])) { $this->writer->xmlElement('PostalCode', array(), $a_userdata['postcode']); } if (isset($a_userdata['dob']) and $a_userdata['dob']) { $this->writer->xmlElement('Birthday', array(), $a_userdata['dob']); } if (isset($a_userdata['gender'])) { $this->writer->xmlElement('Gender', array(), strtolower($a_userdata['gender'])); } if (isset($a_userdata['title'])) { $this->writer->xmlElement('Title', array(), $a_userdata['title']); } if (isset($a_userdata['firstname'])) { $this->writer->xmlElement('Firstname', array(), $a_userdata['firstname']); } if (isset($a_userdata['lastname'])) { $this->writer->xmlElement('Lastname', array(), $a_userdata['lastname']); } $this->writer->xmlElement('Active', array(), "true"); $this->writer->xmlElement('TimeLimitOwner', array(), 7); $this->writer->xmlElement('TimeLimitUnlimited', array(), 1); $this->writer->xmlElement('TimeLimitFrom', array(), time()); $this->writer->xmlElement('TimeLimitUntil', array(), time()); $this->writer->xmlElement('AuthMode', array('type' => 'openid'), 'openid'); $this->writer->xmlElement('ExternalAccount', array(), $a_username); $this->writer->xmlEndTag('User'); $this->writer->xmlEndTag('Users'); $this->log->write('OpenId: Started creation of user: '******'./Services/User/classes/class.ilUserImportParser.php'; $importParser = new ilUserImportParser(); $importParser->setXMLContent($this->writer->xmlDumpMem(false)); $importParser->setRoleAssignment(array($this->settings->getDefaultRole() => $this->settings->getDefaultRole())); $importParser->setFolderId(7); $importParser->startParsing(); // Assign timezone if (isset($a_userdata['timezone'])) { include_once './Services/Calendar/classes/class.ilCalendarUtil.php'; $tzs = ilCalendarUtil::_getShortTimeZoneList(); if (isset($tzs[$a_userdata['timezone']])) { $usr_id = ilObjUser::_lookupId($new_name); ilObjUser::_writePref($usr_id, 'user_tz', $a_userdata['timezone']); } } return $new_name; }