official additioin + zero bonus

This commit is contained in:
xiaomlove
2022-09-25 16:33:52 +08:00
parent e94c7340e4
commit 3f559de57f
21 changed files with 206 additions and 55 deletions

View File

@@ -730,6 +730,7 @@ function get_user_row($id)
} else {
$arr['__is_rainbow'] = 0;
}
$arr['__is_donor'] = is_donor($arr);
return apply_filter("user_row", $arr);
});
@@ -1031,3 +1032,8 @@ function user_can($permission, $fail = false, $uid = 0): bool
}
throw new \App\Exceptions\InsufficientPermissionException();
}
function is_donor(array $userInfo): bool
{
return $userInfo['donor'] == 'yes' && ($userInfo['donoruntil'] === null || $userInfo['donoruntil'] == '0000-00-00 00:00:00' || $userInfo['donoruntil'] >= date('Y-m-d H:i:s'));
}