当前位置: 首页>>代码示例>>PHP>>正文


PHP ilObjUser::checkTimeLimit方法代码示例

本文整理汇总了PHP中ilObjUser::checkTimeLimit方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::checkTimeLimit方法的具体用法?PHP ilObjUser::checkTimeLimit怎么用?PHP ilObjUser::checkTimeLimit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilObjUser的用法示例。


在下文中一共展示了ilObjUser::checkTimeLimit方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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();
         }
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:53,代码来源:class.ilMailSearchGroupsGUI.php

示例2: checkUserAgreement

 /**
  * Check user agreement for every request
  * 
  * @param ilObjUser $a_user
  */
 protected static function checkUserAgreement(ilObjUser $a_user)
 {
     // are we currently in user agreement acceptance?
     if (strtolower($_GET["cmdClass"]) == "ilstartupgui" && (strtolower($_GET["cmd"]) == "getacceptance" || is_array($_POST["cmd"]) && key($_POST["cmd"]) == "getAcceptance")) {
         return;
     }
     if (!$a_user->hasAcceptedUserAgreement() && $a_user->getId() != ANONYMOUS_USER_ID && $a_user->checkTimeLimit()) {
         if (!defined('IL_CERT_SSO')) {
             self::redirect('ilias.php?baseClass=ilStartUpGUI&cmdClass=ilstartupgui&target=' . $_GET['target'] . '&cmd=getAcceptance', 'User Agreement not accepted.');
         }
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:17,代码来源:class.ilInitialisation.php

示例3: 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();
         }
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:78,代码来源:class.ilMailSearchCoursesGUI.php

示例4: 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);
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:31,代码来源:class.ilPublicUserProfileGUI.php


注:本文中的ilObjUser::checkTimeLimit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。