本文整理汇总了PHP中ilObjUser::_getUserData方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::_getUserData方法的具体用法?PHP ilObjUser::_getUserData怎么用?PHP ilObjUser::_getUserData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjUser
的用法示例。
在下文中一共展示了ilObjUser::_getUserData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserXML
/**
* return user xmls for given user ids (csv separated ids) as xml based on usr dtd.
* @param string sid session id
* @param string a_userids array of user ids, may be numeric or ilias ids
* @param boolean attachRoles if true, role assignments will be attached, nothing will be done otherwise
* @return string xml string based on usr dtd
*/
function getUserXML($sid, $a_user_ids, $attach_roles)
{
$this->initAuth($sid);
$this->initIlias();
if (!$this->__checkSession($sid)) {
return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
}
global $rbacsystem, $ilUser, $ilDB;
// check if own account
$is_self = false;
if (is_array($a_user_ids) and count($a_user_ids) == 1) {
if (end($a_user_ids) == $ilUser->getId()) {
$is_self = true;
}
} elseif (is_numeric($a_user_ids)) {
if ($a_user_ids == $ilUser->getId()) {
$is_self = true;
}
}
if (!$rbacsystem->checkAccess('read', USER_FOLDER_ID) and !$is_self) {
return $this->__raiseError('Check access failed.', 'Server');
}
// begin-patch filemanager
$data = ilObjUser::_getUserData((array) $a_user_ids);
// end-patch filemanager
include_once './Services/User/classes/class.ilUserXMLWriter.php';
$xmlWriter = new ilUserXMLWriter();
$xmlWriter->setAttachRoles($attach_roles);
$xmlWriter->setObjects($data);
if ($xmlWriter->start()) {
return $xmlWriter->getXML();
}
return $this->__raiseError('User does not exist', 'Client');
}
示例2: sendNotificationMail
function sendNotificationMail($user_id, $anonymize_id, $appr_id)
{
include_once "./Services/User/classes/class.ilObjUser.php";
include_once "./Services/User/classes/class.ilUserUtil.php";
$recipients = preg_split('/,/', $this->mailaddresses);
foreach ($recipients as $recipient) {
// #11298
include_once "./Services/Notification/classes/class.ilSystemNotification.php";
$ntf = new ilSystemNotification();
$ntf->setLangModules(array("survey"));
$ntf->setRefId($this->getRefId());
$ntf->setSubjectLangId('finished_mail_subject');
$messagetext = $this->mailparticipantdata;
if (trim($messagetext)) {
$data = ilObjUser::_getUserData(array($user_id));
foreach ($data[0] as $key => $value) {
if ($this->getAnonymize()) {
$messagetext = str_replace('[' . $key . ']', '', $messagetext);
} else {
$messagetext = str_replace('[' . $key . ']', $value, $messagetext);
}
}
$ntf->setIntroductionDirect($messagetext);
} else {
$ntf->setIntroductionLangId('survey_notification_finished_introduction');
}
// 360°? add appraisee data
if ($appr_id) {
$ntf->addAdditionalInfo('survey_360_appraisee', ilUserUtil::getNamePresentation($appr_id));
}
$active_id = $this->getActiveID($user_id, $anonymize_id, $appr_id);
$ntf->addAdditionalInfo('results', $this->getParticipantTextResults($active_id), true);
$ntf->setGotoLangId('survey_notification_tutor_link');
$ntf->setReasonLangId('survey_notification_finished_reason');
$ntf->sendMail(array($recipient), null, null);
}
}
示例3: sendNotificationMail
function sendNotificationMail($user_id, $anonymize_id)
{
include_once "./Services/User/classes/class.ilObjUser.php";
include_once "./Services/Mail/classes/class.ilMail.php";
$mail = new ilMail(ANONYMOUS_USER_ID);
$recipients = preg_split('/,/', $this->mailaddresses);
foreach ($recipients as $recipient) {
$messagetext = $this->mailparticipantdata;
$data = ilObjUser::_getUserData(array($user_id));
foreach ($data[0] as $key => $value) {
if ($this->getAnonymize()) {
$messagetext = str_replace('[' . $key . ']', '', $messagetext);
} else {
$messagetext = str_replace('[' . $key . ']', $value, $messagetext);
}
}
$active_id = $this->getActiveID($user_id, $anonymize_id);
$messagetext .= (strlen($messagetext) ? "\n\n\n" : '') . $this->lng->txt('results') . "\n\n" . $this->getParticipantTextResults($active_id);
// #11298
include_once "./Services/Link/classes/class.ilLink.php";
$link = ilLink::_getStaticLink($this->getRefId(), "svy");
$messagetext .= "\n\n" . $this->lng->txt('obj_svy') . ": " . $this->getTitle() . "\n";
$messagetext .= "\n" . $this->lng->txt('survey_notification_tutor_link') . ": " . $link;
$mail->appendInstallationSignature(true);
$mail->sendMail($recipient, "", "", $this->lng->txt('finished_mail_subject') . ': ' . $this->getTitle(), $messagetext, array(), array('normal'));
}
}