/**
*
*
* @throws Exception
*/
protected function getData()
{
$userID = $this->UserID ?: Gdn::session()->UserID;
$user = Gdn::userModel()->getID($userID);
$banned = val('Banned', $user);
$bits = BanModel::explodeBans($banned);
$reasons = array();
foreach ($bits as $bit) {
if (($bit & $this->ExcludeBans) === 0) {
$reasons[$bit] = t("BanReason.{$bit}");
}
}
$this->setData('Reasons', $reasons);
if (!$this->Summary) {
if ($this->ExcludeBans) {
$summary = "Also banned for the following:";
} else {
$summary = "Banned for the following:";
}
}
$this->setData('Summary', $this->Summary ?: $summary);
$this->EventArguments['User'] = $user;
$this->fireEvent('GetData');
}