ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilSystemSupportContacts.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
19 public static function getList()
20 {
21 global $DIC;
22
23 $ilSetting = $DIC->settings();
24
25 return $ilSetting->get("adm_support_contacts");
26 }
27
33 public static function setList($a_list)
34 {
35 global $DIC;
36
37 $ilSetting = $DIC->settings();
38
39 $list = explode(",", $a_list);
40 $accounts = array();
41 foreach ($list as $l) {
42 if (ilObjUser::_lookupId(trim($l)) > 0) {
43 $accounts[] = trim($l);
44 }
45 }
46
47 return $ilSetting->set("adm_support_contacts", implode(",", $accounts));
48 }
49
55 public static function getValidSupportContactIds()
56 {
57 $list = self::getList();
58 $list = explode(",", $list);
59
60 return ilObjUser::_lookupId($list);
61 }
62
69 public static function getMailsToAddress()
70 {
71 $emails = array();
72 foreach (self::getValidSupportContactIds() as $id) {
73 if (($e = ilObjUser::_lookupEmail($id)) != "") {
74 $emails[] = $e;
75 }
76 }
77 if (!empty($emails)) {
78 $emails = implode(',', $emails);
79 if (trim($emails)) {
80 return $emails;
81 }
82 }
83 return "";
84 }
85}
An exception for terminatinating execution or to throw for unit testing.
static _lookupEmail($a_user_id)
Lookup email.
static _lookupId($a_user_str)
Lookup id by login.
static getMailsToAddress()
Get mailto: emails.
static getValidSupportContactIds()
Get valid support contacts.
global $ilSetting
Definition: privfeed.php:17
$DIC
Definition: xapitoken.php:46