ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSystemSupportContacts.php
Go to the documentation of this file.
1<?php
2
27{
33 public static function getList(): string
34 {
35 global $DIC;
36
37 $ilSetting = $DIC->settings();
38
39 return $ilSetting->get("adm_support_contacts") ?? '';
40 }
41
47 public static function setList($a_list)
48 {
49 global $DIC;
50
51 $ilSetting = $DIC->settings();
52
53 $list = explode(",", $a_list);
54 $accounts = array();
55 foreach ($list as $l) {
56 if (ilObjUser::_lookupId(trim($l)) > 0) {
57 $accounts[] = trim($l);
58 }
59 }
60
61 return $ilSetting->set("adm_support_contacts", implode(",", $accounts));
62 }
63
69 public static function getValidSupportContactIds(): array
70 {
71 $list = self::getList();
72 $list = explode(",", $list);
73
74 return ilObjUser::_lookupId($list);
75 }
76
83 public static function getMailsToAddress()
84 {
85 $emails = array();
86 foreach (self::getValidSupportContactIds() as $id) {
87 if (($e = ilObjUser::_lookupEmail($id)) != "") {
88 $emails[] = $e;
89 }
90 }
91 if (!empty($emails)) {
92 $emails = implode(',', $emails);
93 if (trim($emails)) {
94 return $emails;
95 }
96 }
97 return "";
98 }
99}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _lookupId(string|array $a_user_str)
static _lookupEmail(int $a_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getMailsToAddress()
Get mailto: emails.
static getValidSupportContactIds()
Get valid support contacts.
global $ilSetting
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26