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


PHP ilObjUser::_lookupEmail方法代码示例

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


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

示例1: send

 public function send()
 {
     global $lng;
     $customer_array = $this->_getObjectsToRemind();
     foreach ($customer_array as $user_id => $objects_array) {
         $this->initLanguage($user_id);
         $user_lang = $this->getLanguage() ? $this->getLanguage() : $lng;
         $this->initMail();
         $this->setRecipients($user_id);
         $this->setSubject($this->getLanguageText('payment_reminder_notification_subject'));
         $this->setBody(ilMail::getSalutation($user_id, $this->getLanguage()));
         $this->appendBody("\n\n");
         $this->appendBody($user_lang->txt('bought_objects_expire_soon'));
         $this->appendBody("\n\n");
         foreach ($objects_array as $key => $pobject) {
             $this->appendBody("----------------------------------------------------------------------------------------------");
             $this->appendBody("\n\n");
             $this->appendBody($user_lang->txt('title') . ": " . $objects_array[$key]['object_title'] . "\n");
             $this->appendBody($user_lang->txt('access_enddate') . ": " . $objects_array[$key]['access_enddate']);
             $this->appendBody("\n");
             $this->appendBody("\n\n");
         }
         $this->appendBody("----------------------------------------------------------------------------------------------");
         //@todo fix this: $mailbox_link
         $this->appendBody($mailbox_link);
         $this->appendBody("\n\n");
         $this->appendBody(ilMail::_getAutoGeneratedMessageString($this->getLanguage()));
         $this->appendBody(ilMail::_getInstallationSignature());
         $mmail = new ilMimeMail();
         $mmail->autoCheck(false);
         $mmail->From('noreply');
         $mmail->To(ilObjUser::_lookupEmail($user_id));
         $mmail->Subject($this->getSubject());
         $mmail->Body($this->getBody());
         $mmail->Send();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:37,代码来源:class.ilPaymentNotification.php

示例2: adoptMembers

 /**
  * Take over course members to addressbook
  */
 public function adoptMembers()
 {
     global $lng;
     $ids = (int) $_GET['search_members'] ? array((int) $_GET['search_members']) : $_POST['search_members'];
     if ($ids) {
         foreach ($ids as $member) {
             $login = ilObjUser::_lookupLogin($member);
             if (!$this->abook->checkEntry($login)) {
                 $name = ilObjUser::_lookupName($member);
                 $email = '';
                 if (ilObjUser::_lookupPref((int) $member, 'public_email') == 'y') {
                     $email = ilObjUser::_lookupEmail($member);
                 }
                 $this->abook->addEntry($login, $name["firstname"], $name["lastname"], $email);
             }
         }
         ilUtil::sendInfo($lng->txt("mail_members_added_addressbook"));
     } else {
         ilUtil::sendInfo($lng->txt("mail_select_one_entry"));
     }
     $this->showMembers();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:25,代码来源:class.ilMailSearchGroupsGUI.php

示例3: addStatisticWorksheet

 public function addStatisticWorksheet(&$pewa)
 {
     include_once './Services/Excel/classes/class.ilExcelUtils.php';
     include_once './Services/Payment/classes/class.ilPaymentVendors.php';
     $this->__initBookingObject();
     $workbook = $pewa->getWorkbook();
     $worksheet = $workbook->addWorksheet(utf8_decode($this->lng->txt('bookings')));
     $worksheet->mergeCells(0, 0, 0, 3);
     $worksheet->setColumn(0, 0, 16);
     $worksheet->setColumn(0, 1, 32);
     $worksheet->setColumn(0, 2, 32);
     $worksheet->setColumn(0, 3, 16);
     $worksheet->setColumn(0, 4, 16);
     $worksheet->setColumn(0, 5, 16);
     $worksheet->setColumn(0, 6, 24);
     $worksheet->setColumn(0, 7, 8);
     $worksheet->setColumn(0, 8, 12);
     $worksheet->setColumn(0, 9, 16);
     $title = $this->lng->txt('bookings');
     $title .= ' ' . $this->lng->txt('as_of') . ' ';
     $title .= strftime('%Y-%m-%d %R', time());
     $worksheet->writeString(0, 0, $title, $pewa->getFormatTitle());
     $worksheet->writeString(1, 0, $this->lng->txt('payment_system'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 1, $this->lng->txt('paya_transaction'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 2, $this->lng->txt('title'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 3, $this->lng->txt('paya_vendor'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 4, $this->lng->txt('pays_cost_center'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 5, $this->lng->txt('paya_customer'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 6, $this->lng->txt('email'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 7, $this->lng->txt('paya_order_date'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 8, $this->lng->txt('duration'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 9, $this->lng->txt('price_a'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 10, $this->lng->txt('paya_payed_access'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 11, $this->lng->txt('street'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 12, $this->lng->txt('pay_bmf_po_box'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 13, $this->lng->txt('zipcode'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 14, $this->lng->txt('city'), $pewa->getFormatHeader());
     $worksheet->writeString(1, 15, $this->lng->txt('country'), $pewa->getFormatHeader());
     if (!count($bookings = $this->booking_obj->getBookings())) {
         return false;
     }
     include_once 'Services/User/classes/class.ilObjUser.php';
     $object_title_cache = array();
     $user_title_cache = array();
     $counter = 2;
     foreach ($bookings as $booking) {
         if (array_key_exists($booking['ref_id'], $object_title_cache)) {
             $tmp_obj = $object_title_cache[$booking['ref_id']];
         } else {
             $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($booking['ref_id']));
             $object_title_cache[$booking['ref_id']] = $tmp_obj;
         }
         if (array_key_exists($booking['b_vendor_id'], $user_title_cache)) {
             $tmp_vendor = $user_title_cache[$booking['b_vendor_id']];
         } else {
             $tmp_vendor = ilObjUser::_lookupLogin($booking['b_vendor_id']);
             $user_title_cache[$booking['b_vendor_id']] = $tmp_vendor;
         }
         if (array_key_exists($booking['customer_id'], $user_title_cache)) {
             $tmp_purchaser = $user_title_cache[$booking['customer_id']];
         } else {
             $tmp_purchaser_name = ilObjUser::_lookupName($booking['customer_id']);
             $tmp_purchaser_login = ilObjUser::_lookupLogin($booking['customer_id']);
             $tmp_purchaser_email = ilObjUser::_lookupEmail($booking['customer_id']);
             $tmp_purchaser = '' . $tmp_purchaser_name['firstname'] . ' ' . $tmp_purchaser_name['lastname'] . ' [' . $tmp_purchaser_login . ']';
             $user_title_cache[$booking['customer_id']] = $tmp_purchaser;
         }
         include_once './Services/Payment/classes/class.ilPayMethods.php';
         $str_paymethod = ilPayMethods::getStringByPaymethod($booking['b_pay_method']);
         $worksheet->writeString($counter, 0, $str_paymethod);
         $worksheet->writeString($counter, 1, $booking['transaction']);
         $worksheet->writeString($counter, 2, $tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted'));
         $worksheet->writeString($counter, 3, $tmp_vendor != '' ? $tmp_vendor : $this->lng->txt('user_deleted'));
         $worksheet->writeString($counter, 4, ilPaymentVendors::_getCostCenter($booking['b_vendor_id']));
         $worksheet->writeString($counter, 5, $tmp_purchaser != '' ? $tmp_purchaser : $this->lng->txt('user_deleted'));
         $worksheet->writeString($counter, 6, $tmp_purchaser_email);
         $worksheet->writeString($counter, 7, strftime('%Y-%m-%d %R', $booking['order_date']));
         $worksheet->writeString($counter, 8, $booking['duration']);
         $worksheet->writeString($counter, 9, $booking['price']);
         $payed_access = $booking['payed'] ? $this->lng->txt('yes') : $this->lng->txt('no');
         $payed_access .= '/';
         $payed_access .= $booking['access_granted'] ? $this->lng->txt('yes') : $this->lng->txt('no');
         $worksheet->writeString($counter, 10, $payed_access);
         $worksheet->writeString($counter, 11, $booking['street']);
         $worksheet->writeString($counter, 12, $booking['po_box']);
         $worksheet->writeString($counter, 13, $booking['zipcode']);
         $worksheet->writeString($counter, 14, $booking['city']);
         $worksheet->writeString($counter, 15, $booking['country']);
         unset($tmp_obj);
         unset($tmp_vendor);
         unset($tmp_purchaser);
         ++$counter;
     }
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:95,代码来源:class.ilObjPaymentSettingsGUI.php

示例4: showResults


//.........这里部分代码省略.........
     $user_search->setFields(array('lastname'));
     $result_obj = $user_search->performSearch();
     $all_results->mergeEntries($result_obj);
     $all_results->setMaxHits(100000);
     $all_results->preventOverwritingMaxhits(true);
     $all_results->filter(ROOT_FOLDER_ID, true);
     // Filter users (depends on setting in user accounts)
     include_once 'Services/User/classes/class.ilUserFilter.php';
     $users = ilUserFilter::getInstance()->filter($all_results->getResultIds());
     if (count($users)) {
         $tbl_users = new ilTable2GUI($this);
         $tbl_users->setTitle($lng->txt('system') . ': ' . $lng->txt('persons'));
         $tbl_users->setRowTemplate('tpl.mail_search_users_row.html', 'Services/Contact');
         $result = array();
         $counter = 0;
         foreach ($users as $user) {
             $login = ilObjUser::_lookupLogin($user);
             if ($_GET["ref"] != "wsp") {
                 $result[$counter]['check'] = ilUtil::formCheckbox(0, 'search_name_to_usr[]', $login) . ilUtil::formCheckbox(0, 'search_name_cc[]', $login) . ilUtil::formCheckbox(0, 'search_name_bcc[]', $login);
             } else {
                 $result[$counter]['check'] = ilUtil::formCheckbox(0, 'search_name_to_usr[]', $user);
             }
             $result[$counter]['login'] = $login;
             if (in_array(ilObjUser::_lookupPref($user, 'public_profile'), array('y', "g"))) {
                 $name = ilObjUser::_lookupName($user);
                 $result[$counter]['firstname'] = $name['firstname'];
                 $result[$counter]['lastname'] = $name['lastname'];
             } else {
                 $result[$counter]['firstname'] = '';
                 $result[$counter]['lastname'] = '';
             }
             if (ilObjUser::_lookupPref($user, 'public_email') == 'y') {
                 $has_mail_usr = true;
                 $result[$counter]['email'] = ilObjUser::_lookupEmail($user);
             }
             ++$counter;
         }
         if ($_GET["ref"] != "wsp") {
             $tbl_users->addColumn($this->lng->txt('mail_to') . '/' . $this->lng->txt('cc') . '/' . $this->lng->txt('bc'), 'check', '10%');
         } else {
             $tbl_users->addColumn("", "", "1%");
         }
         $tbl_users->addColumn($this->lng->txt('login'), 'login', '15%');
         $tbl_users->addColumn($this->lng->txt('firstname'), 'firstname', '15%');
         $tbl_users->addColumn($this->lng->txt('lastname'), 'lastname', '15%');
         if ($has_mail_usr == true) {
             foreach ($result as $key => $val) {
                 if ($val['email'] == '') {
                     $result[$key]['email'] = ' ';
                 }
             }
             $tbl_users->addColumn($this->lng->txt('email'), 'email', '15%');
         }
         $tbl_users->setData($result);
         $tbl_users->setDefaultOrderField('login');
         $tbl_users->setPrefix('usr_');
         $tbl_users->enable('select_all');
         $tbl_users->setSelectAllCheckbox('search_name_to_usr');
         $tbl_users->setFormName('recipients');
         $this->tpl->setVariable('TABLE_USERS', $tbl_users->getHTML());
     }
     include_once 'Services/Search/classes/class.ilQueryParser.php';
     include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
     include_once 'Services/Search/classes/class.ilSearchResult.php';
     include_once 'Services/Membership/classes/class.ilParticipants.php';
     $group_results = new ilSearchResult();
开发者ID:arlendotcn,项目名称:ilias,代码行数:67,代码来源:class.ilMailSearchGUI.php

示例5: testCreateSetLookupDelete

 /**
  * Creates a user, sets preferences, lookups data, delete user
  * @group IL_Init
  */
 public function testCreateSetLookupDelete()
 {
     include_once "./Services/User/classes/class.ilObjUser.php";
     // delete all aatestuser from previous runs
     while (($i = ilObjUser::_lookupId("aatestuser")) > 0) {
         $user = new ilObjUser($i);
         $user->delete();
     }
     $user = new ilObjUser();
     // creation
     $d = array("login" => "aatestuser", "passwd_type" => IL_PASSWD_PLAIN, "passwd" => "password", "gender" => "m", "firstname" => "Max", "lastname" => "Mutzke", "email" => "de@de.de", "client_ip" => "1.2.3.4", "ext_account" => "ext_mutzke");
     $user->assignData($d);
     $user->create();
     $user->saveAsNew();
     $user->setLanguage("no");
     $user->writePrefs();
     $id = $user->getId();
     $value .= $user->getFirstname() . "-";
     // update
     $user->setFirstname("Maxi");
     $user->update();
     $value .= $user->getFirstname() . "-";
     // other update methods
     $user->refreshLogin();
     // lookups
     $value .= ilObjUser::_lookupEmail($id) . "-";
     $value .= ilObjUser::_lookupGender($id) . "-";
     $value .= ilObjUser::_lookupClientIP($id) . "-";
     $n = ilObjUser::_lookupName($id);
     $value .= $n["lastname"] . "-";
     ilObjUser::_lookupFields($id);
     $value .= ilObjUser::_lookupLogin($id) . "-";
     $value .= ilObjUser::_lookupExternalAccount($id) . "-";
     $value .= ilObjUser::_lookupId("aatestuser") . "-";
     ilObjUser::_lookupLastLogin($id);
     $value .= ilObjUser::_lookupLanguage($id) . "-";
     ilObjUser::_readUsersProfileData(array($id));
     if (ilObjUser::_loginExists("aatestuser")) {
         $value .= "le-";
     }
     // preferences...
     $user->writePref("testpref", "pref1");
     $value .= ilObjUser::_lookupPref($id, "testpref") . "-";
     $user->deletePref("testpref");
     if (ilObjUser::_lookupPref($id, "testpref") == "") {
         $value .= "pref2" . "-";
     }
     // activation
     $user->setActive(false);
     if (!ilObjUser::getStoredActive($id)) {
     }
     $value .= "act1-";
     $user->setActive(true);
     if (ilObjUser::getStoredActive($id)) {
     }
     $value .= "act2-";
     ilObjUser::_toggleActiveStatusOfUsers(array($id), false);
     if (!ilObjUser::getStoredActive($id)) {
     }
     $value .= "act3-";
     // deletion
     $user->delete();
     $this->assertEquals("Max-Maxi-de@de.de-m-1.2.3.4-Mutzke-aatestuser-ext_mutzke-{$id}-no-le-" . "pref1-pref2-act1-act2-act3-", $value);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:68,代码来源:ilObjUserTest.php

示例6: getHTML

 /**
  * render attendance list
  *
  * @return string
  */
 public function getHTML()
 {
     $tpl = new ilTemplate('tpl.attendance_list_print.html', true, true, 'Services/Membership');
     // title
     $time = ilFormat::formatUnixTime(time(), true);
     $tpl->setVariable('TXT_TITLE', $this->title);
     if ($this->description) {
         $tpl->setVariable('TXT_DESCRIPTION', $this->description . " (" . $time . ")");
     } else {
         $tpl->setVariable('TXT_DESCRIPTION', $time);
     }
     // header
     $tpl->setCurrentBlock('head_item');
     foreach ($this->presets as $id => $item) {
         if ($item[1]) {
             $tpl->setVariable('TXT_HEAD', $item[0]);
             $tpl->parseCurrentBlock();
         }
     }
     if ($this->blank_columns) {
         foreach ($this->blank_columns as $blank) {
             $tpl->setVariable('TXT_HEAD', $blank);
             $tpl->parseCurrentBlock();
         }
     }
     // handle members
     $member_ids = array();
     if ($this->show_admins) {
         $member_ids = array_merge((array) $member_ids, $this->participants->getAdmins());
     }
     if ($this->show_tutors) {
         $member_ids = array_merge((array) $member_ids, $this->participants->getTutors());
     }
     if ($this->show_members) {
         $member_ids = array_merge((array) $member_ids, $this->participants->getMembers());
     }
     $member_ids = ilUtil::_sortIds((array) $member_ids, 'usr_data', 'lastname', 'usr_id');
     // rows
     foreach ($member_ids as $user_id) {
         if ($this->callback) {
             $user_data = call_user_func_array($this->callback, array($user_id));
             $tpl->setCurrentBlock("row_preset");
             foreach ($this->presets as $id => $item) {
                 if ($item[1]) {
                     switch ($id) {
                         case "name":
                             if (!$user_data[$id]) {
                                 $name = ilObjUser::_lookupName($user_id);
                                 $value = $name["lastname"] . ", " . $name["firstname"];
                                 break;
                             }
                         case "email":
                             if (!$user_data[$id]) {
                                 $value = ilObjUser::_lookupEmail($user_id);
                                 break;
                             }
                         case "login":
                             if (!$user_data[$id]) {
                                 $value = ilObjUser::_lookupLogin($user_id);
                                 break;
                             }
                         default:
                             $value = (string) $user_data[$id];
                             break;
                     }
                     $tpl->setVariable("TXT_PRESET", $value);
                     $tpl->parseCurrentBlock();
                 }
             }
         }
         if ($this->blank_columns) {
             for ($loop = 0; $loop < sizeof($this->blank_columns); $loop++) {
                 $tpl->touchBlock('row_blank');
             }
         }
         $tpl->touchBlock("member_row");
     }
     return $tpl->get();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:84,代码来源:class.ilAttendanceList.php

示例7: getRatersData

 public function getRatersData($a_appraisee_id)
 {
     global $ilDB;
     $res = $anonymous_ids = array();
     $set = $ilDB->query("SELECT * FROM svy_360_rater" . " WHERE obj_id = " . $ilDB->quote($this->getSurveyId(), "integer") . " AND appr_id = " . $ilDB->quote($a_appraisee_id, "integer"));
     while ($row = $ilDB->fetchAssoc($set)) {
         if ($row["anonymous_id"]) {
             $res["a" . $row["anonymous_id"]] = array("lastname" => "unknown code " . $row["anonymous_id"], "sent" => $row["mail_sent"], "finished" => null);
             $anonymous_ids[] = $row["anonymous_id"];
         } else {
             $name = ilObjUser::_lookupName($row["user_id"]);
             $name["user_id"] = "u" . $name["user_id"];
             $name["email"] = ilObjUser::_lookupEmail($row["user_id"]);
             $name["sent"] = $row["mail_sent"];
             $name["finished"] = (bool) $this->is360SurveyStarted($a_appraisee_id, $row["user_id"]);
             $res["u" . $row["user_id"]] = $name;
         }
     }
     if (sizeof($anonymous_ids)) {
         $data = $this->getSurveyCodesTableData("en", $anonymous_ids);
         foreach ($data as $item) {
             if (isset($res["a" . $item["id"]])) {
                 $res["a" . $item["id"]] = array("user_id" => "a" . $item["id"], "lastname" => $item["last_name"], "firstname" => $item["first_name"], "login" => "", "email" => $item["email"], "code" => $item["code"], "href" => $item["href"], "sent" => $res["a" . $item["id"]]["sent"], "finished" => (bool) $this->is360SurveyStarted($a_appraisee_id, null, $item["code"]));
             }
         }
     }
     return $res;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:28,代码来源:class.ilObjSurvey.php

示例8: getOptions

    /**
     * get options of user and set variables $signature and $linebreak
     * this method shouldn't bew called from outside
     * use getSignature() and getLinebreak()
     * @access	private
     * @return	boolean
     */
    function getOptions()
    {
        global $ilDB;
        $res = $ilDB->queryf('
			SELECT * FROM ' . $this->table_mail_options . '
			WHERE user_id = %s', array('integer'), array($this->user_id));
        $row = $res->fetchRow(DB_FETCHMODE_OBJECT);
        $this->cronjob_notification = stripslashes($row->cronjob_notification);
        $this->signature = stripslashes($row->signature);
        $this->linebreak = stripslashes($row->linebreak);
        $this->incoming_type = $row->incoming_type;
        if (!strlen(ilObjUser::_lookupEmail($this->user_id))) {
            $this->incoming_type = $this->LOCAL;
        }
        return true;
    }
开发者ID:arlendotcn,项目名称:ilias,代码行数:23,代码来源:class.ilMailOptions.php

示例9: initMailOptionsForm

 /** 
  * Initialises the mail options form
  */
 private function initMailOptionsForm()
 {
     global $ilCtrl, $ilSetting, $lng, $ilUser;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($ilCtrl->getFormAction($this, 'saveMailOptions'));
     $this->form->setTitle($lng->txt('mail_settings'));
     // BEGIN INCOMING
     include_once 'Services/Mail/classes/class.ilMailOptions.php';
     if ($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1') {
         $options = array(IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'), IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'), IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both'));
         $si = new ilSelectInputGUI($lng->txt('mail_incoming'), 'incoming_type');
         $si->setOptions($options);
         if (!strlen(ilObjUser::_lookupEmail($ilUser->getId())) || $ilSetting->get('usr_settings_disable_mail_incoming_mail') == '1') {
             $si->setDisabled(true);
         }
         $this->form->addItem($si);
     }
     // BEGIN LINEBREAK_OPTIONS
     $options = array();
     for ($i = 50; $i <= 80; $i++) {
         $options[$i] = $i;
     }
     $si = new ilSelectInputGUI($lng->txt('linebreak'), 'linebreak');
     $si->setOptions($options);
     $this->form->addItem($si);
     // BEGIN SIGNATURE
     $ta = new ilTextAreaInputGUI($lng->txt('signature'), 'signature');
     $ta->setRows(10);
     $ta->setCols(60);
     $this->form->addItem($ta);
     // BEGIN CRONJOB NOTIFICATION
     if ($ilSetting->get('mail_notification')) {
         $cb = new ilCheckboxInputGUI($lng->txt('cron_mail_notification'), 'cronjob_notification');
         $cb->setInfo($lng->txt('mail_cronjob_notification_info'));
         $cb->setValue(1);
         $this->form->addItem($cb);
     }
     $this->form->addCommandButton('saveMailOptions', $lng->txt('save'));
 }
开发者ID:JKN-INC,项目名称:SHELBY-ILIAS,代码行数:43,代码来源:class.ilPersonalSettingsGUI.php

示例10: send

    public function send()
    {
        global $ilDB, $lng, $ilSetting;
        $is_message_enabled = $ilSetting->get("mail_notification_message");
        $res = $ilDB->queryF('SELECT mail.* FROM mail_options
						INNER JOIN mail ON mail.user_id = mail_options.user_id
						INNER JOIN mail_obj_data ON mail_obj_data.obj_id = mail.folder_id
						WHERE cronjob_notification = %s
						AND send_time >= %s
						AND m_status = %s', array('integer', 'timestamp', 'text'), array(1, date('Y-m-d H:i:s', time() - 60 * 60 * 24), 'unread'));
        $users = array();
        $user_id = 0;
        while ($row = $ilDB->fetchAssoc($res)) {
            if ($user_id == 0 || $row['user_id'] != $user_id) {
                $user_id = $row['user_id'];
            }
            $users[$user_id][] = $row;
        }
        foreach ($users as $user_id => $mail_data) {
            $this->initLanguage($user_id);
            $user_lang = $this->getLanguage() ? $this->getLanguage() : $lng;
            $this->initMail();
            $this->setRecipients($user_id);
            $this->setSubject($this->getLanguageText('mail_notification_subject'));
            $this->setBody(ilMail::getSalutation($user_id, $this->getLanguage()));
            $this->appendBody("\n\n");
            if (count($mail_data) == 1) {
                $this->appendBody(sprintf($user_lang->txt('mail_at_the_ilias_installation'), count($mail_data), ilUtil::_getHttpPath()));
            } else {
                $this->appendBody(sprintf($user_lang->txt('mails_at_the_ilias_installation'), count($mail_data), ilUtil::_getHttpPath()));
            }
            $this->appendBody("\n\n");
            $counter = 1;
            foreach ($mail_data as $mail) {
                $this->appendBody("----------------------------------------------------------------------------------------------");
                $this->appendBody("\n\n");
                $this->appendBody('#' . $counter . "\n\n");
                $this->appendBody($user_lang->txt('date') . ": " . $mail['send_time']);
                $this->appendBody("\n");
                if ($mail['sender_id'] == ANONYMOUS_USER_ID) {
                    $sender = ilMail::_getIliasMailerName();
                } else {
                    $sender = ilObjUser::_lookupLogin($mail['sender_id']);
                }
                $this->appendBody($user_lang->txt('sender') . ": " . $sender);
                $this->appendBody("\n");
                $this->appendBody($user_lang->txt('subject') . ": " . $mail['m_subject']);
                $this->appendBody("\n\n");
                if ($is_message_enabled == true) {
                    $this->appendBody($user_lang->txt('message') . ": " . $mail['m_message']);
                    $this->appendBody("\n\n");
                }
                ++$counter;
            }
            $this->appendBody("----------------------------------------------------------------------------------------------");
            $this->appendBody("\n\n");
            $this->appendBody($user_lang->txt('follow_link_to_read_mails') . " ");
            $this->appendBody("\n");
            $mailbox_link = ilUtil::_getHttpPath();
            $mailbox_link .= "/goto.php?target=mail&client_id=" . CLIENT_ID;
            $this->appendBody($mailbox_link);
            $this->appendBody("\n\n");
            $this->appendBody(ilMail::_getAutoGeneratedMessageString($this->getLanguage()));
            $this->appendBody(ilMail::_getInstallationSignature());
            $mmail = new ilMimeMail();
            $mmail->autoCheck(false);
            $mmail->From(ilMail::getIliasMailerAddress());
            $mmail->To(ilObjUser::_lookupEmail($user_id));
            $mmail->Subject($this->getSubject());
            $mmail->Body($this->getBody());
            $mmail->Send();
        }
    }
开发者ID:arlendotcn,项目名称:ilias,代码行数:73,代码来源:class.ilMailSummaryNotification.php

示例11: getHTML

 /**
  * render attendance list
  *
  * @return string
  */
 public function getHTML()
 {
     $tpl = new ilTemplate('tpl.attendance_list_print.html', true, true, 'Services/Membership');
     // title
     $time = ilFormat::formatUnixTime(time(), true);
     $tpl->setVariable('TXT_TITLE', $this->title);
     if ($this->description) {
         $tpl->setVariable('TXT_DESCRIPTION', $this->description . " (" . $time . ")");
     } else {
         $tpl->setVariable('TXT_DESCRIPTION', $time);
     }
     // header
     $tpl->setCurrentBlock('head_item');
     foreach ($this->presets as $id => $item) {
         if ($item[1]) {
             $tpl->setVariable('TXT_HEAD', $item[0]);
             $tpl->parseCurrentBlock();
         }
     }
     if ($this->blank_columns) {
         foreach ($this->blank_columns as $blank) {
             $tpl->setVariable('TXT_HEAD', $blank);
             $tpl->parseCurrentBlock();
         }
     }
     // handle members
     $valid_user_ids = $filters = array();
     if ($this->roles) {
         if ($this->has_local_role) {
             $members = array();
             foreach ($this->participants->getMembers() as $member_id) {
                 foreach ($this->participants->getAssignedRoles($member_id) as $role_id) {
                     $members[$role_id][] = $member_id;
                 }
             }
         } else {
             $members = $this->participants->getMembers();
         }
         foreach ($this->roles as $role_id) {
             switch ($this->role_data[$role_id][1]) {
                 case "admin":
                     $valid_user_ids = array_merge($valid_user_ids, $this->participants->getAdmins());
                     break;
                 case "tutor":
                     $valid_user_ids = array_merge($valid_user_ids, $this->participants->getTutors());
                     break;
                     // member/local
                 // member/local
                 default:
                     if (!$this->has_local_role) {
                         $valid_user_ids = array_merge($valid_user_ids, (array) $members);
                     } else {
                         $valid_user_ids = array_merge($valid_user_ids, (array) $members[$role_id]);
                     }
                     break;
             }
         }
     }
     if ($this->include_subscribers) {
         $valid_user_ids = array_merge($valid_user_ids, $this->participants->getSubscribers());
     }
     if ($this->include_waiting_list) {
         $valid_user_ids = array_merge($valid_user_ids, $this->waiting_list->getUserIds());
     }
     if ($this->user_filters) {
         foreach ($this->user_filters as $sub_id => $sub_item) {
             $filters[$sub_id] = (bool) $sub_item[2];
         }
     }
     $valid_user_ids = ilUtil::_sortIds(array_unique($valid_user_ids), 'usr_data', 'lastname', 'usr_id');
     // rows
     foreach ($valid_user_ids as $user_id) {
         if ($this->callback) {
             $user_data = call_user_func_array($this->callback, array($user_id, $filters));
             if (!$user_data) {
                 continue;
             }
             $tpl->setCurrentBlock("row_preset");
             foreach ($this->presets as $id => $item) {
                 if ($item[1]) {
                     switch ($id) {
                         case "name":
                             if (!$user_data[$id]) {
                                 $name = ilObjUser::_lookupName($user_id);
                                 $value = $name["lastname"] . ", " . $name["firstname"];
                                 break;
                             }
                         case "email":
                             if (!$user_data[$id]) {
                                 $value = ilObjUser::_lookupEmail($user_id);
                                 break;
                             }
                         case "login":
                             if (!$user_data[$id]) {
                                 $value = ilObjUser::_lookupLogin($user_id);
//.........这里部分代码省略.........
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilAttendanceList.php

示例12: generateXavcLoginName

 /** Generates the login name for a user depending on assignment_mode setting
  * 
  * @param integer $user_id user_id 
  */
 public static function generateXavcLoginName($user_id)
 {
     // set default when there is no setting set: assign_user_email
     $assignment_mode = ilAdobeConnectServer::getSetting('user_assignment_mode') ? ilAdobeConnectServer::getSetting('user_assignment_mode') : 'assign_user_email';
     switch ($assignment_mode) {
         case 'assign_user_email':
             $xavc_login = IL_INST_ID . '_' . $user_id . '_' . ilObjUser::_lookupEmail($user_id);
             break;
         case 'assign_ilias_login':
             $xavc_login = IL_INST_ID . '_' . $user_id . '_' . ilObjUser::_lookupLogin($user_id);
             break;
             //The SWITCH aai/DFN case, only return e-mail address
         //The SWITCH aai/DFN case, only return e-mail address
         case 'assign_dfn_email':
         case 'assign_breezeSession':
             $xavc_login = ilObjUser::_lookupEmail($user_id);
             break;
     }
     return $xavc_login;
 }
开发者ID:HochschuleLuzern,项目名称:ILIAS_AdobeConnectPlugin,代码行数:24,代码来源:class.ilAdobeConnectUserUtil.php

示例13: getHandinParameters

 /**
  * Function for getting the parameters needed for handing in a document to Ephorus.
  *
  * @param object $document - The document there the parameters are needed from
  * @return array - Hand-in parameters bool - false
  */
 public static function getHandinParameters($document)
 {
     $user = ilObjUser::_lookupName($document->user_id);
     return array("code" => self::getSetting('handin_code'), "firstName" => $user["firstname"], "middleName" => "", "lastName" => $user["lastname"], "studentEmail" => ilObjUser::_lookupEmail($document->user_id), "studentNumber" => $document->user_id, "comment" => "", "fileName" => $document->filetitle, "file" => file_get_contents($document->filename), "processType" => $document->processtype);
 }
开发者ID:jmcgettrick,项目名称:ilias-ephorus,代码行数:11,代码来源:class.DLEApi.php


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