本文整理汇总了PHP中ilObjUser::getActive方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::getActive方法的具体用法?PHP ilObjUser::getActive怎么用?PHP ilObjUser::getActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjUser
的用法示例。
在下文中一共展示了ilObjUser::getActive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showMembers
/**
* Show course members
*/
public function showMembers()
{
global $lng, $ilUser, $ilObjDataCache;
include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
if ($_GET["search_crs"] != "") {
$_POST["search_crs"] = explode(",", $_GET["search_crs"]);
$_GET["search_crs"] = "";
} else {
if ($_SESSION["search_crs"] != "") {
$_POST["search_crs"] = explode(",", $_SESSION["search_crs"]);
$_SESSION["search_crs"] = "";
}
}
if (!is_array($_POST["search_crs"]) || count($_POST["search_crs"]) == 0) {
ilUtil::sendInfo($lng->txt("mail_select_course"));
$this->showMyCourses();
} else {
foreach ($_POST['search_crs'] as $crs_id) {
$oTmpCrs = ilObjectFactory::getInstanceByObjId($crs_id);
if ($oTmpCrs->getShowMembers() == $oTmpCrs->SHOW_MEMBERS_DISABLED) {
unset($_POST['search_crs']);
ilUtil::sendInfo($lng->txt('mail_crs_list_members_not_available_for_at_least_one_crs'));
return $this->showMyCourses();
}
unset($oTmpCrs);
}
$this->tpl->setTitle($this->lng->txt("mail_addressbook"));
$this->ctrl->setParameter($this, "view", "crs_members");
if ($_GET["ref"] != "") {
$this->ctrl->setParameter($this, "ref", $_GET["ref"]);
}
if (is_array($_POST["search_crs"])) {
$this->ctrl->setParameter($this, "search_crs", implode(",", $_POST["search_crs"]));
}
$this->tpl->setVariable("ACTION", $this->ctrl->getFormAction($this));
$this->ctrl->clearParameters($this);
$lng->loadLanguageModule('crs');
include_once 'Services/Contact/classes/class.ilMailSearchCoursesMembersTableGUI.php';
$context = $_GET["ref"] ? $_GET["ref"] : "mail";
$table = new ilMailSearchCoursesMembersTableGUI($this, 'crs', $context);
$table->setId('show_crs_mmbrs_tbl');
$tableData = array();
$searchTpl = new ilTemplate('tpl.mail_search_template.html', true, true, 'Services/Contact');
foreach ($_POST["search_crs"] as $crs_id) {
$members_obj = ilCourseParticipants::_getinstanceByObjId($crs_id);
$tmp_members = $members_obj->getParticipants();
$course_members = ilUtil::_sortIds($tmp_members, 'usr_data', 'lastname', 'usr_id');
foreach ($course_members as $member) {
$tmp_usr = new ilObjUser($member);
if ($tmp_usr->checkTimeLimit() == false || $tmp_usr->getActive() == false) {
unset($tmp_usr);
continue;
}
unset($tmp_usr);
$name = ilObjUser::_lookupName($member);
$login = ilObjUser::_lookupLogin($member);
$fullname = "";
if (in_array(ilObjUser::_lookupPref($member, 'public_profile'), array("g", 'y'))) {
$fullname = $name['lastname'] . ', ' . $name['firstname'];
}
$rowData = array('members_id' => $member, 'members_login' => $login, 'members_name' => $fullname, 'members_crs_grp' => $ilObjDataCache->lookupTitle($crs_id), 'members_in_addressbook' => $this->abook->checkEntryByLogin($login) ? $lng->txt("yes") : $lng->txt("no"), 'search_crs' => $crs_id);
$tableData[] = $rowData;
}
}
$table->setData($tableData);
if (count($tableData)) {
$searchTpl->setVariable("TXT_MARKED_ENTRIES", $lng->txt("marked_entries"));
}
$searchTpl->setVariable('TABLE', $table->getHtml());
$this->tpl->setContent($searchTpl->get());
if ($_GET["ref"] != "wsp") {
$this->tpl->show();
}
}
}
示例2: showMembers
/**
* Show course members
*/
public function showMembers()
{
global $lng;
if ($_GET["search_grp"] != "") {
$_POST["search_grp"] = explode(",", $_GET["search_grp"]);
}
if (!is_array($_POST["search_grp"]) || count($_POST["search_grp"]) == 0) {
ilUtil::sendInfo($lng->txt("mail_select_group"));
$this->showMyGroups();
} else {
$this->tpl->setTitle($this->lng->txt("mail_addressbook"));
include_once 'Services/Contact/classes/class.ilMailSearchCoursesMembersTableGUI.php';
$context = $_GET["ref"] ? $_GET["ref"] : "mail";
$table = new ilMailSearchCoursesMembersTableGUI($this, 'grp', $context);
$table->setId('show_grps_mmbrs_tbl');
$lng->loadLanguageModule('crs');
$tableData = array();
$searchTpl = new ilTemplate('tpl.mail_search_template.html', true, true, 'Services/Contact');
foreach ($_POST["search_grp"] as $grp_id) {
$ref_ids = ilObject::_getAllReferences($grp_id);
$ref_id = current($ref_ids);
if (is_object($group_obj = ilObjectFactory::getInstanceByRefId($ref_id, false))) {
$grp_members = $group_obj->getGroupMemberData($group_obj->getGroupMemberIds());
foreach ($grp_members as $member) {
$tmp_usr = new ilObjUser($member['id']);
if ($tmp_usr->checkTimeLimit() == false || $tmp_usr->getActive() == false) {
unset($tmp_usr);
continue;
}
unset($tmp_usr);
$fullname = "";
if (in_array(ilObjUser::_lookupPref($member['id'], 'public_profile'), array("g", 'y'))) {
$fullname = $member['lastname'] . ', ' . $member['firstname'];
}
$rowData = array('members_id' => $member["id"], 'members_login' => $member["login"], 'members_name' => $fullname, 'members_crs_grp' => $group_obj->getTitle(), 'members_in_addressbook' => $this->abook->checkEntryByLogin($member["login"]) ? $lng->txt("yes") : $lng->txt("no"), 'search_grp' => $grp_id);
$tableData[] = $rowData;
}
}
}
$table->setData($tableData);
if (count($tableData)) {
$searchTpl->setVariable("TXT_MARKED_ENTRIES", $lng->txt("marked_entries"));
}
$searchTpl->setVariable('TABLE', $table->getHtml());
$this->tpl->setContent($searchTpl->get());
if ($_GET["ref"] != "wsp") {
$this->tpl->show();
}
}
}
示例3: getHTML
/**
* Show user page
*/
function getHTML()
{
global $ilCtrl, $ilSetting;
if ($this->embedded) {
return $this->getEmbeddable();
}
// #15438 - (currently) inactive user?
$is_active = true;
$user = new ilObjUser($this->getUserId());
if (!$user->getActive() || !$user->checkTimeLimit()) {
$is_active = false;
}
if ($is_active && $this->getProfilePortfolio()) {
$ilCtrl->redirectByClass("ilobjportfoliogui", "preview");
} else {
if (!$is_active) {
return;
}
// Check from Database if value
// of public_profile = "y" show user infomation
$user = new ilObjUser($this->getUserId());
if ($user->getPref("public_profile") != "y" && ($user->getPref("public_profile") != "g" || !$ilSetting->get('enable_global_profiles')) && !$this->custom_prefs) {
return;
}
$this->renderTitle();
return $this->getEmbeddable(true);
}
}