-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.php
42 lines (35 loc) · 1.56 KB
/
lib.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
function user_contact_recaptchaenabled() {
global $CFG;
return !empty($CFG->recaptchapublickey) && !empty($CFG->recaptchaprivatekey);
}
function user_contact_getallstandardrecipients($bid) {
$debug = false;
$blockcontext = context_block::instance($bid);
$contactpersons = get_users_by_capability($blockcontext, 'block/user_contact:contactperson', 'u.id, u.firstname, u.lastname, u.email, u.mailformat', 'u.lastname ASC','','','','',false);
if ($debug) {
echo '****** Written from line '.__LINE__.' of '.__FILE__.' ********<br />';
echo '<hr />';
echo 'contactperson (block/user_contact:contactperson)<br />';
print_object($contactpersons);
}
return $contactpersons;
}
function user_contact_getallhiddenrecipients($cid,$bid) {
global $sid;
$debug = false;
if ($cid == SITEID) {
$blockcontext = context_system::instance(0);
} else {
$blockcontext = context_block::instance($bid);
}
$hiddenrecipients = get_users_by_capability($blockcontext, 'block/user_contact:hiddenrecipient', 'u.id, u.firstname, u.lastname, u.email, u.mailformat', 'u.lastname ASC','','','','',false);
if ($debug) {
echo '****** Written from line '.__LINE__.' of '.__FILE__.' ********<br />';
echo '<hr />';
echo 'hiddencollector (block/user_contact:hiddenrecipients)<br />';
print_object($hiddenrecipients);
}
return $hiddenrecipients;
}
?>