-
Notifications
You must be signed in to change notification settings - Fork 767
/
helper_functions.php
29 lines (25 loc) · 1.01 KB
/
helper_functions.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
<?php if (!defined('APPLICATION')) exit();
if (!function_exists('UserVerified')):
/**
* Return the verified status of a user with a link to change it.
* @param array|object $User
* @return string
*/
function UserVerified($User) {
$UserID = GetValue('UserID', $User);
if (GetValue('Verified', $User)) {
$Label = T('Verified');
$Title = T('Verified Description', 'Verified users bypass spam and pre-moderation filters.');
$Url = "/user/verify.json?userid=$UserID&verified=0";
} else {
$Label = T('Not Verified');
$Title = T('Not Verified Description', 'Unverified users are passed thru any enabled spam and pre-moderation filters.');
$Url = "/user/verify.json?userid=$UserID&verified=1";
}
if (Gdn::Session()->CheckPermission('Garden.Moderation.Manage')) {
return Anchor($Label, $Url, array('title' => $Title, 'class' => 'User-Verified Hijack'));
} else {
return Wrap($Label, 'span', array('title' => $Title, 'class' => 'User-Verified'));
}
}
endif;