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


PHP ilObjUser::getLastname方法代码示例

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


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

示例1: replaceBillingMailPlaceholders

 public static function replaceBillingMailPlaceholders($a_message, $a_user_id)
 {
     global $lng;
     $user = new ilObjUser($a_user_id);
     // determine salutation
     switch ($user->getGender()) {
         case 'f':
             $gender_salut = $lng->txt('salutation_f');
             break;
         case 'm':
             $gender_salut = $lng->txt('salutation_m');
             break;
     }
     $a_message = str_replace('[MAIL_SALUTATION]', $gender_salut, $a_message);
     $a_message = str_replace('[LOGIN]', $user->getLogin(), $a_message);
     $a_message = str_replace('[FIRST_NAME]', $user->getFirstname(), $a_message);
     $a_message = str_replace('[LAST_NAME]', $user->getLastname(), $a_message);
     $a_message = str_replace('[ILIAS_URL]', ILIAS_HTTP_PATH . '/login.php?client_id=' . CLIENT_ID, $a_message);
     $a_message = str_replace('[CLIENT_NAME]', CLIENT_NAME, $a_message);
     include_once './Services/Payment/classes/class.ilShopLinkBuilder.php';
     $shopLB = new ilShopLinkBuilder();
     $bought_objects_url = $shopLB->buildLink('ilShopBoughtObjectsGUI');
     $shop_url = $shopLB->buildLink('ilShopGUI');
     $a_message = str_replace('[SHOP_BOUGHT_OBJECTS_URL]', $bought_objects_url, $a_message);
     $a_message = str_replace('[SHOP_URL]', $shop_url, $a_message);
     unset($user);
     return $a_message;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:28,代码来源:class.ilBillingMailPlaceholdersPropertyGUI.php

示例2: userDataArrayForExport

 function userDataArrayForExport($user, $b_allowExportPrivacy = false)
 {
     $userArray = array();
     if ($b_allowExportPrivacy == false) {
         $userArray["user"] = $user;
     } else {
         global $ilUser;
         $userArray["login"] = "";
         $userArray["user"] = "";
         $userArray["email"] = "";
         $userArray["department"] = "";
         if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
             $e_user = new ilObjUser($user);
             $userArray["login"] = $e_user->getLogin();
             $userArray["user"] = $e_user->getLastname() . ', ' . $e_user->getFirstname();
             $userArray["email"] = "" . $e_user->getEmail();
             $userArray["department"] = "" . $e_user->getDepartment();
         }
     }
     return $userArray;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:21,代码来源:class.ilSCORMTrackingItems.php

示例3: parse

 public function parse($userSelected, $report, $reports)
 {
     global $ilCtrl, $lng;
     $lng->loadLanguageModule("scormtrac");
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($ilCtrl->getFormAction($this->parent_obj));
     $options = array("all" => $lng->txt("all"));
     include_once "Services/Tracking/classes/class.ilTrQuery.php";
     $users = ilTrQuery::getParticipantsForObject($this->parent_obj->object->ref_id);
     include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     $privacy = ilPrivacySettings::_getInstance();
     $allowExportPrivacy = $privacy->enabledExportSCORM();
     //$users = $this->parent_obj->object->getTrackedUsers("");
     foreach ($users as $user) {
         if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
             if ($allowExportPrivacy == true) {
                 $e_user = new ilObjUser($user);
                 $options[$user] = $e_user->getLastname() . ", " . $e_user->getFirstname();
             } else {
                 $options[$user] = 'User Id: ' . $user;
             }
         }
     }
     $si = new ilSelectInputGUI($lng->txt("user"), "userSelected");
     $si->setOptions($options);
     $si->setValue($userSelected);
     $this->form->addItem($si);
     $options = array("choose" => $lng->txt("please_choose"));
     for ($i = 0; $i < count($reports); $i++) {
         $options[$reports[$i]] = $lng->txt(strtolower($reports[$i]));
     }
     $si = new ilSelectInputGUI($lng->txt("report"), "report");
     $si->setOptions($options);
     $si->setValue($report);
     $this->form->addItem($si);
     $this->form->addCommandButton($this->parent_cmd, $lng->txt("apply_filter"));
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:37,代码来源:class.ilSCORM2004TrackingItemsPerUserFilterGUI.php

示例4: setRowForUser

 protected function setRowForUser(&$set, $user_id)
 {
     $user = new ilObjUser($user_id);
     $set["first_name"] = $user->getFirstname();
     $set["last_name"] = $user->getLastname();
     $set["user_object"] = $user;
     $set["user_id"] = $user_id;
     if ($this->recursive) {
         $set["org_units"] = ilObjOrgUnitTree::_getInstance()->getOrgUnitOfUser($user_id, (int) $_GET['ref_id']);
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:11,代码来源:class.ilOrgUnitStaffTableGUI.php

示例5: deleteTrackingForUser

 /**
  * display deletion confirmation screen
  */
 function deleteTrackingForUser()
 {
     if (!isset($_POST["user"])) {
         $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
     }
     // display confirmation message
     include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
     $cgui = new ilConfirmationGUI();
     $cgui->setFormAction($this->ctrl->getFormAction($this));
     $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
     $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteTracking");
     $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeleteTracking");
     foreach ($_POST["user"] as $id) {
         if (ilObject::_exists($id) && ilObject::_lookUpType($id) == "usr") {
             $user = new ilObjUser($id);
             $caption = ilUtil::getImageTagByType("sahs", $this->tpl->tplPath) . " " . $this->lng->txt("cont_tracking_data") . ": " . $user->getLastname() . ", " . $user->getFirstname();
             $cgui->addItem("user[]", $id, $caption);
         }
     }
     $this->tpl->setContent($cgui->getHTML());
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:24,代码来源:class.ilObjSCORM2004LearningModuleGUI.php

示例6: verifyEndTag

 /**
  * handler for end of element when in verify mode.
  */
 function verifyEndTag($a_xml_parser, $a_name)
 {
     global $lng, $ilAccess, $ilSetting, $ilObjDataCache;
     switch ($a_name) {
         case "Role":
             $this->roles[$this->current_role_id]["name"] = $this->cdata;
             $this->roles[$this->current_role_id]["type"] = $this->current_role_type;
             $this->roles[$this->current_role_id]["action"] = $this->current_role_action;
             break;
         case "User":
             $this->userObj->setFullname();
             if ($this->user_id != -1 && $this->action == "Update") {
                 $user_exists = !is_null(ilObjUser::_lookupLogin($this->user_id));
             } else {
                 $user_exists = ilObjUser::getUserIdByLogin($this->userObj->getLogin()) != 0;
             }
             if (is_null($this->userObj->getLogin())) {
                 $this->logFailure("---", sprintf($lng->txt("usrimport_xml_element_for_action_required"), "Login", "Insert"));
             }
             switch ($this->action) {
                 case "Insert":
                     if ($user_exists and $this->conflict_rule == IL_FAIL_ON_CONFLICT) {
                         $this->logWarning($this->userObj->getLogin(), $lng->txt("usrimport_cant_insert"));
                     }
                     if (is_null($this->userObj->getGender()) && $this->isFieldRequired("gender")) {
                         $this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_xml_element_for_action_required"), "Gender", "Insert"));
                     }
                     if (is_null($this->userObj->getFirstname())) {
                         $this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_xml_element_for_action_required"), "Firstname", "Insert"));
                     }
                     if (is_null($this->userObj->getLastname())) {
                         $this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_xml_element_for_action_required"), "Lastname", "Insert"));
                     }
                     if (count($this->roles) == 0) {
                         $this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_xml_element_for_action_required"), "Role", "Insert"));
                     } else {
                         $has_global_role = false;
                         foreach ($this->roles as $role) {
                             if ($role['type'] == 'Global') {
                                 $has_global_role = true;
                                 break;
                             }
                         }
                         if (!$has_global_role) {
                             $this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_global_role_for_action_required"), "Insert"));
                         }
                     }
                     break;
                 case "Update":
                     if (!$user_exists) {
                         $this->logWarning($this->userObj->getLogin(), $lng->txt("usrimport_cant_update"));
                     } elseif ($this->user_id != -1 && !is_null($this->userObj->getLogin())) {
                         $someonesId = ilObjUser::_lookupId($this->userObj->getLogin());
                         if (is_numeric($someonesId) && $someonesId != $this->user_id) {
                             $this->logFailure($this->userObj->getLogin(), $lng->txt("usrimport_login_is_not_unique"));
                         }
                     }
                     break;
                 case "Delete":
                     if (!$user_exists) {
                         $this->logWarning($this->userObj->getLogin(), $lng->txt("usrimport_cant_delete"));
                     }
                     break;
             }
             // init role array for next user
             $this->roles = array();
             break;
         case "Login":
             if (array_key_exists($this->cdata, $this->logins)) {
                 $this->logWarning($this->cdata, $lng->txt("usrimport_login_is_not_unique"));
             } else {
                 $this->logins[$this->cdata] = $this->cdata;
             }
             $this->userObj->setLogin($this->cdata);
             break;
         case "Password":
             switch ($this->currPasswordType) {
                 case "ILIAS2":
                     $this->userObj->setPasswd($this->cdata, IL_PASSWD_CRYPT);
                     break;
                 case "ILIAS3":
                     $this->userObj->setPasswd($this->cdata, IL_PASSWD_MD5);
                     break;
                 case "PLAIN":
                     $this->userObj->setPasswd($this->cdata, IL_PASSWD_PLAIN);
                     $this->acc_mail->setUserPassword($this->currPassword);
                     break;
                 default:
                     $this->logFailure($this->userObj->getLogin(), sprintf($lng->txt("usrimport_xml_attribute_value_illegal"), "Type", "Password", $this->currPasswordType));
                     break;
             }
             break;
         case "Firstname":
             $this->userObj->setFirstname($this->cdata);
             break;
         case "Lastname":
             $this->userObj->setLastname($this->cdata);
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilUserImportParser.php

示例7: add

 public function add()
 {
     global $lng, $ilUser;
     if ($_GET["mail_id"] != "") {
         if (is_array($mail_data = $this->umail->getMail($_GET["mail_id"]))) {
             require_once "Services/Contact/classes/class.ilAddressbook.php";
             $abook = new ilAddressbook($ilUser->getId());
             $tmp_user = new ilObjUser($mail_data["sender_id"]);
             if ($abook->checkEntryByLogin($tmp_user->getLogin()) > 0) {
                 ilUtil::sendInfo($lng->txt("mail_entry_exists"));
             } else {
                 $abook->addEntry($tmp_user->getLogin(), $tmp_user->getFirstname(), $tmp_user->getLastname(), $tmp_user->getEmail());
                 ilUtil::sendInfo($lng->txt("mail_entry_added"));
             }
         }
     }
     $this->showMail();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:18,代码来源:class.ilMailFolderGUI.php

示例8: getBannedUsers

 /**
  * Returns an multidimensional array containing userdata from users
  * having an entry in banTable with matching roomId.
  *
  * @global ilDBMySQL $ilDB
  * @return array
  */
 public function getBannedUsers()
 {
     global $ilDB;
     $query = 'SELECT * FROM ' . self::$banTable . ' WHERE room_id = %s ';
     $types = array('integer');
     $values = array($this->getRoomId());
     $rset = $ilDB->queryF($query, $types, $values);
     $result = array();
     if ($rset) {
         while ($row = $ilDB->fetchAssoc($rset)) {
             if ($row['user_id'] > 0) {
                 $user = new ilObjUser($row['user_id']);
                 $userdata = array('user_id' => $user->getId(), 'firstname' => $user->getFirstname(), 'lastname' => $user->getLastname(), 'login' => $user->getLogin(), 'remark' => $row['remark']);
                 $result[] = $userdata;
             } else {
                 //@todo anonymous user
             }
         }
     }
     return $result;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:28,代码来源:class.ilChatroom.php

示例9: loadFromUser

 /**
  * Load user data from ilias user object
  * @param stdclass $user
  * @param ilObjUser $iu
  */
 private function loadFromUser($user, ilObjUser $iu)
 {
     $prefix = ilViteroSettings::getInstance()->getUserPrefix();
     $user->username = $prefix . $iu->getLogin();
     $user->surname = $iu->getLastname();
     $user->firstname = $iu->getFirstname();
     $user->email = $iu->getEmail();
     $user->company = $iu->getInstitution();
     $user->locale = in_array($iu->getLanguage(), $this->available_locales) ? $iu->getLanguage() : "en";
     #$user->timezone = trim($iu->getTimeZone());
     $GLOBALS['ilLog']->write(__METHOD__ . ': Time zone is ' . $iu->getTimeZone());
     $user->phone = $iu->getPhoneOffice();
     $user->fax = $iu->getFax();
     $user->mobile = $iu->getPhoneMobile();
     $user->country = $iu->getCountry();
     $user->zip = $iu->getZipcode();
     $user->city = $iu->getCity();
     $user->street = $iu->getStreet();
 }
开发者ID:leifos-gmbh,项目名称:Vitero,代码行数:24,代码来源:class.ilViteroUserSoapConnector.php

示例10: stopUserOfflineMode

 /**
  * Stop offline mode for selected users
  */
 protected function stopUserOfflineMode()
 {
     if (!count((array) $_POST['user'])) {
         ilUtil::sendFailure($this->lng->txt('select_one'), true);
         $this->ctrl->redirect($this, 'offlineModeManager');
     }
     // display confirmation message
     include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
     $cgui = new ilConfirmationGUI();
     $cgui->setFormAction($this->ctrl->getFormAction($this));
     $cgui->setHeaderText($this->lng->txt("info_stop_offline_mode_sure"));
     $cgui->setCancel($this->lng->txt("cancel"), "cancelStopUserOfflineMode");
     $cgui->setConfirm($this->lng->txt("confirm"), "confirmedStopUserOfflineMode");
     foreach ($_POST["user"] as $id) {
         if (ilObject::_exists($id) && ilObject::_lookUpType($id) == "usr") {
             $user = new ilObjUser($id);
             $caption = ilUtil::getImageTagByType("sahs_offline", $this->tpl->tplPath) . " " . $this->lng->txt("stop_user_offline_mode_for_user") . ": " . $user->getLastname() . ", " . $user->getFirstname();
             $cgui->addItem("user[]", $id, $caption);
         }
     }
     $this->tpl->setContent($cgui->getHTML());
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:25,代码来源:class.ilObjSCORMLearningModuleGUI.php

示例11: addCrsGrpMembers

 public function addCrsGrpMembers()
 {
     global $ilCtrl, $lng;
     $this->pluginObj->includeClass('class.ilXAVCTableGUI.php');
     $this->tabs->activateTab('participants');
     $this->__setSubTabs('participants');
     $this->tabs->activateSubTab("addCrsGrpMembers");
     $lng->loadLanguageModule('crs');
     $my_tpl = new ilTemplate($this->pluginObj->getDirectory() . "/templates/default/tpl.meeting_participant_table.html", true, true);
     $oParticipants = $this->object->getParticipantsObject();
     /** @var $oParticipants  ilGroupParticipants */
     $admins = $oParticipants->getAdmins();
     $tutors = $oParticipants->getTutors();
     $members = $oParticipants->getMembers();
     $all_crs_members = array_unique(array_merge($admins, $tutors, $members));
     $counter = 0;
     $f_result_1 = NULL;
     foreach ($all_crs_members as $user_id) {
         if ($user_id > 0) {
             $tmp_user = new ilObjUser($user_id);
             $firstname = $tmp_user->getFirstname();
             $lastname = $tmp_user->getLastname();
             if ($tmp_user->hasPublicProfile() && $tmp_user->getPref('public_email') == 'y') {
                 $user_mail = $tmp_user->getEmail();
             } else {
                 $user_mail = '';
             }
         }
         $f_result_1[$counter]['checkbox'] = ilUtil::formCheckbox('', 'usr_id[]', $user_id);
         $f_result_1[$counter]['user_name'] = $lastname . ', ' . $firstname;
         $f_result_1[$counter]['email'] = $user_mail;
         ++$counter;
     }
     // show Administrator Table
     $tbl_admin = new ilXAVCTableGUI($this, 'addCrsGrpMembers');
     $ilCtrl->setParameter($this, 'cmd', 'editParticipants');
     $tbl_admin->setTitle($lng->txt("crs_members"));
     $tbl_admin->setId('tbl_admins');
     $tbl_admin->setRowTemplate($this->pluginObj->getDirectory() . "/templates/default/tpl.meeting_participant_row.html", false);
     $tbl_admin->addColumn('', 'checkbox', '1%', true);
     $tbl_admin->addColumn($this->pluginObj->txt('user_name'), 'user_name', '30%');
     $tbl_admin->addColumn($lng->txt('email'), 'email');
     $tbl_admin->setSelectAllCheckbox('usr_id[]');
     $tbl_admin->addMultiCommand('performAddCrsGrpMembers', $this->pluginObj->txt('add_crs_grp_members'));
     $tbl_admin->addCommandButton('editParticipants', $this->pluginObj->txt('cancel'));
     $tbl_admin->setData($f_result_1);
     $my_tpl->setVariable('ADMINS', $tbl_admin->getHTML());
     $this->tpl->setContent($my_tpl->get());
 }
开发者ID:KamuiXenom,项目名称:ILIAS_AdobeConnectPlugin,代码行数:49,代码来源:class.ilObjAdobeConnectGUI.php

示例12: setRowForUser

 protected function setRowForUser(&$set, $user_id)
 {
     $user = new ilObjUser($user_id);
     $set["first_name"] = $user->getFirstname();
     $set["last_name"] = $user->getLastname();
     $set["user_object"] = $user;
     $set["user_id"] = $user_id;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:8,代码来源:class.ilOrgUnitOtherRolesTableGUI.php

示例13: initFormSearch

 public function initFormSearch(ilObjUser $user = NULL)
 {
     global $ilCtrl;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'search'));
     $this->form->setTitle($this->getTitle());
     $this->form->addCommandButton('performSearch', $this->lng->txt('search'));
     $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $kind = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_for');
     $kind->setValue($this->search_type);
     $this->form->addItem($kind);
     // Users
     $users = new ilRadioOption($this->lng->txt('search_for_users'), 'usr');
     // UDF
     include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
     foreach (ilUserSearchOptions::_getSearchableFieldsInfo(!$this->isSearchableCheckEnabled()) as $info) {
         switch ($info['type']) {
             case FIELD_TYPE_UDF_SELECT:
             case FIELD_TYPE_SELECT:
                 $sel = new ilSelectInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                 $sel->setOptions($info['values']);
                 $users->addSubItem($sel);
                 break;
             case FIELD_TYPE_MULTI:
             case FIELD_TYPE_UDF_TEXT:
             case FIELD_TYPE_TEXT:
                 if (isset($info['autoComplete']) and $info['autoComplete']) {
                     $ilCtrl->setParameterByClass(get_class($this), 'autoCompleteField', $info['db']);
                     $ul = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                     $ul->setDataSourceSubmitOnSelection(TRUE);
                     $ul->setDataSourceSubmitUrl($this->ctrl->getLinkTarget($this, 'showSearchSelected', '', FALSE, FALSE));
                     $ul->setDataSource($ilCtrl->getLinkTarget($this, "doUserAutoComplete", "", true));
                     $ul->setSize(30);
                     $ul->setMaxLength(120);
                     if ($user instanceof ilObjUser) {
                         switch ($info['db']) {
                             case 'firstname':
                                 $ul->setValue($user->getFirstname());
                                 break;
                             case 'lastname':
                                 $ul->setValue($user->getLastname());
                                 break;
                             case 'login':
                                 $ul->setValue($user->getLogin());
                                 break;
                         }
                     }
                     $users->addSubItem($ul);
                 } else {
                     $txt = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                     $txt->setSize(30);
                     $txt->setMaxLength(120);
                     $users->addSubItem($txt);
                 }
                 break;
         }
     }
     $kind->addOption($users);
     // Role
     $roles = new ilRadioOption($this->lng->txt('search_for_role_members'), 'role');
     $role = new ilTextInputGUI($this->lng->txt('search_role_title'), 'rep_query[role][title]');
     $role->setSize(30);
     $role->setMaxLength(120);
     $roles->addSubItem($role);
     $kind->addOption($roles);
     // Course
     $groups = new ilRadioOption($this->lng->txt('search_for_crs_members'), 'crs');
     $group = new ilTextInputGUI($this->lng->txt('search_crs_title'), 'rep_query[crs][title]');
     $group->setSize(30);
     $group->setMaxLength(120);
     $groups->addSubItem($group);
     $kind->addOption($groups);
     // Group
     $groups = new ilRadioOption($this->lng->txt('search_for_grp_members'), 'grp');
     $group = new ilTextInputGUI($this->lng->txt('search_grp_title'), 'rep_query[grp][title]');
     $group->setSize(30);
     $group->setMaxLength(120);
     $groups->addSubItem($group);
     $kind->addOption($groups);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:81,代码来源:class.ilRepositorySearchGUI.php

示例14: parseUserPlaceholders

 /**
  * Return all Placeholders of user data
  *
  * @param ilObjUser $user
  * @return array
  */
 protected function parseUserPlaceholders(ilObjUser $user)
 {
     return array('USER_LOGIN' => $this->anonymized ? 'johndoe' : $user->getLogin(), 'USER_TITLE' => $this->anonymized ? 'Mister' : $user->getUTitle(), 'USER_FULLNAME' => $this->anonymized ? 'John Doe' : $user->getFullname(), 'USER_FIRSTNAME' => $this->anonymized ? 'John' : $user->getFirstname(), 'USER_LASTNAME' => $this->anonymized ? 'Doe' : $user->getLastname(), 'USER_BIRTHDAY' => $user->getBirthday(), 'USER_INSTITUTION' => $user->getInstitution(), 'USER_DEPARTMENT' => $user->getDepartment(), 'USER_STREET' => $this->anonymized ? 'Manhattan Street' : $user->getStreet(), 'USER_CITY' => $this->anonymized ? 'New York' : $user->getCity(), 'USER_ZIPCODE' => $this->anonymized ? 10026 : $user->getZipcode(), 'USER_COUNTRY' => $this->anonymized ? 'USA' : $user->getCountry());
 }
开发者ID:studer-raimann,项目名称:Certificate,代码行数:10,代码来源:class.srCertificateStandardPlaceholders.php

示例15: getUserDataFromActiveId

 /**
  * Returns the user information from an active_id (survey_finished.finished_id)
  *
  * @param integer $active_id The active id of the user
  * @return array An array containing the user data
  * @access public
  */
 function getUserDataFromActiveId($active_id)
 {
     global $ilDB;
     $surveySetting = new ilSetting("survey");
     $use_anonymous_id = array_key_exists("use_anonymous_id", $_GET) ? $_GET["use_anonymous_id"] : $surveySetting->get("use_anonymous_id");
     $result = $ilDB->queryF("SELECT * FROM svy_finished WHERE finished_id = %s", array('integer'), array($active_id));
     $row = array();
     $foundrows = $result->numRows();
     if ($foundrows) {
         $row = $ilDB->fetchAssoc($result);
     }
     $name = $use_anonymous_id ? $row["anonymous_id"] : $this->lng->txt("anonymous");
     $userdata = array("fullname" => $name, "sortname" => $name, "firstname" => "", "lastname" => "", "login" => "", "gender" => "", "active_id" => "{$active_id}");
     if ($foundrows) {
         if ($row["user_fi"] > 0 && $row["user_fi"] != ANONYMOUS_USER_ID && $this->getAnonymize() == 0) {
             include_once './Services/User/classes/class.ilObjUser.php';
             if (strlen(ilObjUser::_lookupLogin($row["user_fi"])) == 0) {
                 $userdata["fullname"] = $userdata["sortname"] = $this->lng->txt("deleted_user");
             } else {
                 $user = new ilObjUser($row["user_fi"]);
                 $userdata["fullname"] = $user->getFullname();
                 $gender = $user->getGender();
                 if (strlen($gender) == 1) {
                     $gender = $this->lng->txt("gender_{$gender}");
                 }
                 $userdata["gender"] = $gender;
                 $userdata["firstname"] = $user->getFirstname();
                 $userdata["lastname"] = $user->getLastname();
                 $userdata["sortname"] = $user->getLastname() . ", " . $user->getFirstname();
                 $userdata["login"] = $user->getLogin();
             }
         }
     }
     return $userdata;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:42,代码来源:class.ilObjSurvey.php


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