Skip to content

Commit

Permalink
More work in progress on #2 and #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Moc committed Feb 12, 2021
1 parent 0212459 commit 8b1901d
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions admin_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,22 +221,31 @@ function checkPage()
if(!$sfs->sfsCheck($sfsdata))
{
//print_a("not a spammer");
e107::getMessage()->addSuccess("User is not a spammer.");
$this->redirect('list');
return;
e107::getMessage()->addSuccess("User <strong>{$userdata['user_loginname']}</strong> is not a spambot."); // TODO LAN
}
//
else
{
print_a("spammer!!");
e107::getMessage()->addWarning("User <strong>{$userdata['user_loginname']}</strong> is probably a spambot."); // TODO LAN

}

//$this->redirect('list');
$this->redirect('list');
return;
}

function reportPage()
{
if(!e107::getPlugPref('sfs', 'sfs_apikey'))
{
e107::getMessage()->addError("You need to enter your API Key in order to use this functionality!"); // TODO LAN
$this->redirect('list');
return;
}

$userID = $this->getId();
$apiKey = e107::getPlugPref('sfs', 'sfs_apikey');


// TODO - https://www.stopforumspam.com/usage
e107::getMessage()->addWarning("Not functional yet.");
$this->redirect('list');
Expand Down Expand Up @@ -283,21 +292,23 @@ public function onUpdateError($new_data, $old_data, $id)
// left-panel help menu area
public function renderHelp()
{
$text = '';

if($this->getAction() == "prefs")
if($this->getAction() == "list")
{
$text = '';
$caption = LAN_HELP;
$text .= 'TODO. Add more info about check and report.'; // TODO add help text
}

if($this->getAction() == "prefs")
{
$text .= '<strong>'.LAN_SFS_PREFS_DEBUG.'</strong>';
$text .= '<p>'.LAN_SFS_PREFS_DEBUG_HELP.'</p>';

/*$text .= '<strong>'.LAN_SFS_PREFS_APIKEY.'</strong>';
$text .= '<p>'.LAN_SFS_PREFS_APIKEY_HELP.'</p>';*/
$text .= '<strong>'.LAN_SFS_PREFS_APIKEY.'</strong>';
$text .= '<p>'.LAN_SFS_PREFS_APIKEY_HELP.'</p>';
}


return array('caption' => $caption,'text' => $text);
return array('caption' => LAN_HELP, 'text' => $text);
}

/*
Expand Down Expand Up @@ -326,9 +337,9 @@ function options($parms, $value, $id, $options)

$text = "<div class='btn-group pull-right'>";
//$text .= $this->renderValue('options', $value, $attributes, $id);
// $text .= $this->admin_button('report_sfs['.$id.']', $id, 'default', $icon);
//$text .= $this->admin_button('report_sfs['.$id.']', $id, 'default', $icon);
$text .= "<a class='btn btn-default' href='admin_config.php?mode=main&action=check&id=".$id."'>".$icon_check."</a>";
$text .= "<a class='btn btn-default' href='admin_config.php?mode=main&action=report&id=".$id."'>".$icon_report."</a>";
//$text .= "<a class='btn btn-default' href='admin_config.php?mode=main&action=report&id=".$id."'>".$icon_report."</a>";
$text .= "</div>";

return $text;
Expand Down

0 comments on commit 8b1901d

Please sign in to comment.